Вопросы для собеседования.

Разговоры на любые темы
Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Multithreading vs multitasking
Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

E7O8R_yWYAkFCfI.png
Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Чем отличается margin от padding? Когда надо использовать каждое?
Киберпанк не умер. Он просто наступил.

pitman
Сообщения: 778
Зарегистрирован: Пт авг 31, 2012 8:03 pm

Re: Вопросы для собеседования.

Сообщение pitman »

Архитектура Little Endian

Код: Выделить всё

UINT16 var[4]={0x01,0x02,0x03,0x04};
UINT32 x;
x=*((INT32*)(&var[1]));
Чему равно х ?
Действительно, было в Михал Иваныче что-то аристократическое. Пустые бутылки он не сдавал, выбрасывал.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Requirements
- Assume the language standard is C# v. 7.0
- We expect good performance.
- If missing requirements details, make reasonable assumptions
- Solution must be simple and compact
- No defensive coding, no comments, no unrequested features.
- Only one file 10-20 lines of code
- Work only inside Google Docs: no external editor/IDE/debugger, no copy-paste
to/from such an editor. We must see the flow of how you write the code.

Note: you have a total of 30 minutes for both questions!
Ensure you have filled all pages.
Task 1
Implement function

int verify(string text)

which verifies whether parentheses within text are
correctly nested. You need to consider three kinds: (), [], <> and only these kinds.
Examples
verify("---(++++)----") -> 1
verify("") -> 1
verify("before ( middle []) after ") -> 1
verify(") (") -> 0
verify("<( >)") -> 0
verify("( [ <> () ] <> )") -> 1
verify(" ( [)") -> 0
Answer
// fill
Task 2
Simplify the implementation below as much as you can.
Even better if you can also improve performance as part of the simplification!
FYI: This code is over 35 lines and over 300 tokens, but it can be written in
5 lines and in less than 60 tokens.
Code
public static int func(String s, String a, String b){
Regex rx = new Regex(@"^$");
MatchCollection matches = rx.Matches(s);
if (matches.Count > 0)
return -1;
else
{
int i = s.Length - 1;
int aIndex =- 1;
int bIndex =- 1;
while ((aIndex == -1) && (bIndex == -1) && (i >= 0))
{
if (s.Substring(i, Math.Max(Math.Min(i+1, s.Length-i)-i, 1)).Equals(a))
aIndex = i;
if (s.Substring(i, Math.Max(Math.Min(i+1, s.Length-i)-i, 1)).Equals(b))
bIndex = i;
i--;
}
if (aIndex != -1)
{
if (bIndex == -1)
return aIndex;
else
return Math.Max(aIndex, bIndex);
}
else
{
if (bIndex != -1)
return bIndex;
else
return -1;
}
}
}

Answer
// fill


Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Requirements
- Assume the language standard is C# v. 7.0
- We expect good performance.
- If missing requirements details, make reasonable assumptions
- Solution must be simple and compact
- No defensive coding, no comments, no unrequested features.
- Only one file 10-20 lines of code
- Work only inside Google Docs: no external editor/IDE/debugger, no copy-paste
to/from such an editor. We must see the flow of how you write the code.

Note: you have a total of 30 minutes for both questions!
Ensure you have filled all pages.
Task 1
Implement function

int verify(string text)

which verifies whether parentheses within text are
correctly nested. You need to consider three kinds: (), [], <> and only these kinds.
Examples
verify("---(++++)----") -> 1
verify("") -> 1
verify("before ( middle []) after ") -> 1
verify(") (") -> 0
verify("<( >)") -> 0
verify("( [ <> () ] <> )") -> 1
verify(" ( [)") -> 0
Answer
// fill
Task 2
Simplify the implementation below as much as you can.
Even better if you can also improve performance as part of the simplification!
FYI: This code is over 35 lines and over 300 tokens, but it can be written in
5 lines and in less than 60 tokens.
Code
public static int func(String s, String a, String b){
Regex rx = new Regex(@"^$");
MatchCollection matches = rx.Matches(s);
if (matches.Count > 0)
return -1;
else
{
int i = s.Length - 1;
int aIndex =- 1;
int bIndex =- 1;
while ((aIndex == -1) && (bIndex == -1) && (i >= 0))
{
if (s.Substring(i, Math.Max(Math.Min(i+1, s.Length-i)-i, 1)).Equals(a))
aIndex = i;
if (s.Substring(i, Math.Max(Math.Min(i+1, s.Length-i)-i, 1)).Equals(b))
bIndex = i;
i--;
}
if (aIndex != -1)
{
if (bIndex == -1)
return aIndex;
else
return Math.Max(aIndex, bIndex);
}
else
{
if (bIndex != -1)
return bIndex;
else
return -1;
}
}
}

Answer
// fill


Киберпанк не умер. Он просто наступил.

Аватара пользователя
arxont
Сообщения: 3948
Зарегистрирован: Пт авг 31, 2012 11:29 pm

Re: Вопросы для собеседования.

Сообщение arxont »

Киберпанк не умер. Он просто наступил.

Аватара пользователя
ra0ued
Сообщения: 2080
Зарегистрирован: Чт авг 30, 2012 2:54 pm
Откуда: zabtech.ru
Контактная информация:

Re: Вопросы для собеседования.

Сообщение ra0ued »

Я тут кароче пока задротил алгоритмы и системный дизайн, меня на собесе в авито неожиданно разъебали проверкой базовых вещей. Итак, я не смог внятно ответитъ на следующие вопросы:

- Чем TCP отличается от UDP?
- Чем процесс отличается от потока (unix)?
- Что происходит в ОC когда вы загружаете в памятъ своего приложения мегабайтную строку, например (unix)?
- Какие могут бытъ нюансы, когда обращаетесъ к строке как к массиву?
- Чем Docker отличается от виртуализации?
- Зачем у веб-приложений таймауты?
- Какие знаете провайдеры индексов в базах данных?
- Триггеры и хранимые процедуры, как работают?

Ответить