📜 ⬆️ ⬇️

Two tasks for a developer interview

Previously, I often had to interview people in different positions, most of them were application and database developers. This process is quite tedious, because Programmers are bold, creative, inquisitive and goal-oriented people.
In my practice, there were all sorts of questions. In the article I will highlight three main types and tell you what I finally stopped at and why.

Tasks for ingenuity


You are standing on a steep mountain whose height is 100 meters. You have a rope 80 meters long. On the rock at a height of about 50 meters from the ground there is a ledge on which you can stand and gain a foothold. How to go down?

There were people who already knew the answer, but pretended to be a deeply thoughtful person, and then, oh, a miracle! gave birth to a solution. Many honestly did not cope with the task. But it was still some kind of introductory task.

Then I revised my view and refused to do such tasks. After all, the main thing for me was to find an intelligent programmer who would later have to solve completely different tasks, namely, to program, and most of the time would not involve finding mega cool solutions, and if you suddenly need some kind of brainstorming, you can other colleagues and try their wits.
')

Knowledge of technology


The second type of questions I asked was related to the knowledge of tools, mechanisms, technologies, for example:

  1. Tell us what encapsulation is.
  2. How to make a function call from a dll-library written in C ++ in Java.
  3. What are the disadvantages of MS SQL Server and MySQL? What is their fundamental difference?

In time, I refused these questions. In my opinion, not every programmer should know this perfectly. Yes, encapsulation is an important OOP tool, but if a programmer has been writing without OOP all his life, then what, is he now bad? He just did not need. But on the other hand, he can write an effective string compression algorithm or some kind of driver. About the holivars between different DBMS, I generally keep quiet, you can always open the documentation, forums, and read, that yes how. It is the same with mechanisms, it is not necessary to know what is coming from and how, it is necessary to be able to “find a solution” to this issue. If you have never called a function from dll - this is not a reason not to take you and does not characterize you as sensible or confused. See how others do it and everything will work out for you.

Practical tasks


As a result, I have only specific tasks left: here is the hour for you, here is the toolkit, here is the task you need to do, and then we will discuss how you implemented it, why, what are the advantages of your decision, how fast it works, what has not been done.

In my opinion, this is the most correct way to check a person, i.e. is he ready to deal with a practically useful task in close to real conditions? I gave the task to everyone the same and already solved.

First, to see how different people behave in the same conditions. Secondly, so that there are no complaints, they say, I did something to you there, you did not take me, and then you used my work at home. For this, I showed a ready-running application in which this function has already been implemented. Everything is fair and transparent.

And finally, if you are interested to try your hand, as if you suddenly got to those interviews, here are two tasks.

The first task

There are two tables of Russian words_1 and words_2 with fields (word as VARCHAR, ref as INT), where word is a word, ref is a link (numeric code) to some other (not important) table, which lists all the definitions of these words. In each table, all words are unique (no repetitions). In the first table there are some words that are not in the second, and vice versa, in the second table there are some words that are not in the first, but most of the words in both tables are the same. You need to get a single table with all the words and the corresponding links.

Initial conditions / difficulties:

  1. For the same words, the links in different tables may be different, because dictionaries were downloaded from different places;
  2. the number of words in each table is hundreds of thousands, i.e. the comparison algorithm "in the forehead" is not suitable for everyone; 100 thousand x 100 thousand at least give 10 billion comparisons;
  3. if you are a database developer, then the task needs to be done in sql.

Source Tables:

words_1
lamp shade - 1
cinema - 2
aircraft - 3
person - 4

words_2
cinema - 15
music - 16
aircraft - 17

The resulting table based on the first table:

all_words_1
lamp shade - 1
cinema - 2
music - 16
aircraft - 3
person - 4

The resulting table based on the second table:

all_words_2
lamp shade - 1
cinema - 15
music - 16
aircraft - 17
person - 4

Second task

There is a defs table with fields (def as TEXT, ref as INT), where def is the definition of a word, ref is a link (numeric code) to the word itself from some other table (not important). It is necessary for each word from the dictionary to remove all the partial duplication of definitions, leaving only the most complete non-repetitive.

Initial conditions / difficulties:

  1. definitions can be quite long, several thousand characters;
  2. the number of records in the table is several million, if somehow stupidly “head on” comparing full-text records with each other, the server will stoop;
  3. if you are a database developer, then the task needs to be done in sql.

Source table:

refs
animal with big ears - 1
animal with big ears and a long nose - 1
big animal with a long nose - 1
little fluffy animal - 2
a small fluffy animal that nibbles on nuts - 2

(Note, 1 is an elephant, 2 is a protein.)

Result table:

clear_refs
animal with big ears and a long nose - 1
big animal with a long nose - 1
a small fluffy animal that nibbles on nuts - 2

Something like that. And remember, you have an hour or two of time, in the end, the interviewer wants to see, first of all, not the text of your program, but the finished tables with the desired result.

Source: https://habr.com/ru/post/179937/


All Articles