- PVSM.RU - https://www.pvsm.ru -
Мы подготовили для Вас новый выпуск, ставшей уже традиционной, ITренировки — подборки задач с собеседований в IT-компании мира.

В отобранные задачи попали задачи с собеседований Samsung. Соискателю также могут задать вопрос про шифр и Шерлока Холмса (нет, не пляшушие человечки [1], как можно было подумать). Уровень сложности мы постарались варьировать — от простых до серьезных.
We have 10 machines that produce screws, each weighing 1 gram. One of the machines, however, produces screws weighing 0.9 grams only. We are allowed only one weighing and need to determine which machine is faulty.
Sherlock Holmes was decoding an encrypted message. If in the encryption, DISTANCE is written as IDTUBECN and DOCUMENT is written as ODDVNTNE.
Can you help him decipher HTTQYAD?
Сможете ли Вы помочь ему расшифровать HTTQYAD?
A Research team want to establish a research center in a region where they found some rare-elements.They want to make it closest to all the rare-elements as close as possible so that they can reduce overall cost of research over there.It is given that all the rare-element’s location is connected by roads.It is also given that Research Center can only be build on road.Team decided to assign this task to a coder.If you feel you have that much potential..Here is the Task :- Find the optimal position of research center from given locations of rare-elements.
Locations are given in the matrix cell form where 1 represents roads and 0 no road. Number of rare-element and their location was also given(number<=5) and order of square matrix was less than equal to (20).
Локации даны в виде матрицы, где 1 в ячейке означает наличие дороги, а 0 — её отсутствие.
Также даны локации элментов (числом <= 5). Порядок квадратной матрицы <= 20.
In a typical process, a stack segment of program contains local variables along with information that is saved each time a function is called. Each time a function is called, the address of where to return to and certain information about the caller’s environment, such as some of the machine registers, are saved on the stack. The newly called function then allocates room on the stack for its automatic and temporary variables.
Stack may grow downward or upward depending on environment for which code is compiled, i.e., depends on compiler. Write down the program to determine whether stack grows downward or upward?
Стек может расти вниз или вверх в зависимости от среды, для которой скомпилирован код, т. е. зависит от компилятора. Реализуйте программу для определения, растет ли стек вниз или вверх.
Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element on the right side of x in array. Elements for which no greater element exist, consider next greater element as -1.
Examples:
a) For any array, rightmost element always has next greater element as -1.
b) For an array which is sorted in decreasing order, all elements have next greater element as -1.
c) For the input array [4, 5, 2, 25], the next greater elements for each element are as follows.Element NGE 4 --> 5 5 --> 25 2 --> 25 25 --> -1d) For the input array [13, 7, 6, 12], the next greater elements for each element are as follows.
Element NGE 13 --> -1 7 --> 12 6 --> 12 12 --> -1
Элемент NGE 4 --> 5 5 --> 25 2 --> 25 25 --> -1
d) Для элементов массива [13, 7, 6, 12] NGE будет следующим:
Элемент NGE 13 --> -1 7 --> 12 6 --> 12 12 --> -1
Ответы будут даны в течение следующей недели — успейте решить. Удачи!
Автор: reci
Источник [2]
Сайт-источник PVSM.RU: https://www.pvsm.ru
Путь до страницы источника: https://www.pvsm.ru/samsung/280793
Ссылки в тексте:
[1] пляшушие человечки: https://ru.wikipedia.org/wiki/%D0%9F%D0%BB%D1%8F%D1%88%D1%83%D1%89%D0%B8%D0%B5_%D1%87%D0%B5%D0%BB%D0%BE%D0%B2%D0%B5%D1%87%D0%BA%D0%B8
[2] Источник: https://habr.com/post/358918/?utm_campaign=358918
Нажмите здесь для печати.