How to pass a technical interview: tips from an expert
What is a technical interview? What algorithm is used to build it? What typical mistakes should you avoid during your next one? Boris Tseytlin, Senior Machine Learning Scientist and owner of the Boris Again, Telegram channel, explained how a technical interview generally proceeds and how to prepare for it.
In this article
What is a technical interview and why is it needed?
— A technical interview is one of the stages of hiring technical specialists in an IT company. At this stage, an engineer from the company tests the candidate's knowledge. During a technical interview, the interviewer checks the extent to which the candidate's skills correspond to the position for which the person is to be hired. It is at technical interviews that most candidates are eliminated.
There is usually more than one technical interview, and they come in different types.
A typical hiring process involves two technical interviews:
- The first resembles an exam in theoretical and applied knowledge.
- The second concerns system design with open questions like: "How would you build a video streaming service", "You have a service with a heavy load and a database that no longer fits on the disk of one server. How would you solve such a problem?" etc.
I will focus for this discussion on the first type of interview. Large companies have their own specific rules for conducting technical interviews. Interviewing with a large company can include several interviews with tasks on algorithms. I'm not going to talk about large companies here, but about the hiring process in most companies.
How does a technical interview go?
— The details of the technical interview vary greatly from company to company, but it is possible to identify common approaches.
The standard structure of the first technical interview generally involves two components. For the first 10-15 minutes, the candidate is asked simple questions about the programming language and technology. If the position involves the use of Python, for example, people often ask: "What is a decorator," "What is GIL and how does it work," and "How does Python work with memory." During this portion of the interview, the interviewer tries to assess the candidate's level.
Another structure is also popular for the initial portion of the interview. In this formulation, the candidate is asked a question about their past experience, and then the interviewer delves into the topics mentioned above with additional questions. The details depend on the position:
- The programmer is usually asked about the language and algorithms, data structures, and technologies from the company's stack.
- For the analyst, there will be more questions about SQL and databases, probability theory, and mathematical statistics.
- At ML interviews, specialists are asked about statistics and probability theory, machine learning theory, and details of how models work.
The remaining 30-45 minutes in any of the first technical interview structures is a life-coding task. The interviewer and the candidate are connected to a collaborative environment where they can write code together, but they cannot execute it. The interviewer explains the problem condition, and the candidate asks questions, clarifies the condition, writes code, and evaluates the asymptotic complexity of the solution in O(N) notation.
Tips for how to pass a technical interview
— The most important thing is to abandon the mentality of a student at an exam. The interview should be perceived as communication between two specialists. Bad interviewers give the impression of an interrogation, but do not give in to this. If you are worrying and defending yourself, you are likely to fail. A simple life hack for the right attitude is to imagine that you and the interviewer are already colleagues and are on the same side.
The second thing to remember is that it is not only your technical knowledge that is tested at the interview. People are trying to figure out if they want to work with you. Accordingly, you need to demonstrate your thinking: do not hesitate to ask questions and do not be afraid if you do not know something.
— To pass the first stage with simple questions, you need to prepare. The interviewer generally tries to weed out people who don't know anything at all. Usually, every interviewer asks the same questions, a list of which can be found on the Internet. If you don't know the answer to a question that can be found on the Internet in five minutes, then this is your dealbreaker. Also, be prepared to be asked questions about the technologies that you mentioned in your resume.
The algorithmic portion of the interview is the most difficult. Preparation for it is divided into two stages:
- Learn the interview process; and
- Practice solving problems.
The interview process is standard. Knowing the rules of the game helps a lot. The algorithm is as follows:
- The interviewer explains the task condition. At this point, you need to ask questions about the condition and find out all the restrictions that often are not specifically mentioned. For example: "What if the array is empty," "Are all elements unique," "What are the memory and speed limits." The most common reason for the failure of this stage is misunderstanding a condition.
- Do not write the solution code until the interviewer gives you the "green light." The best way to fail an interview is to start writing in the wrong direction, stall, and then exceed the allowable time. Detaining the interviewer can also lead to failure.
- During this portion of the interview, verbally discuss the problem and solution with the interviewer. It's important to think out loud and ask questions. At this stage, you can write tests in the code. Try to discover all the unique cases that need to be processed. Often, after doing this, you realize that you still did not quite understand the condition correctly.
- Your task is to come up with the optimal solution. If it doesn't work out, as a rule, the interviewer will give you a hint. Needing a hint is, of course, a negative, but it is better to solve with a hint than not to solve at all.
- After obtaining permission to write code, begin implementation.
- After writing the code, be sure to check it. Often, candidates miss simple things out of excitement. They may, for example, forget to return the result of execution. The tests written earlier will be useful here: does the implementation cover all cases? Run your eyes over your code and say the main points out loud. Such small mistakes as, for example, confusing the signs "more" and "less" are not terrible, but catching them gives you extra points.
— Now that you know the structure, all that is left is to practice solving problems and writing code without execution and IDE help. Open leetcode, sort the tasks by complexity or popularity, and solve some. Most likely, to prepare for typical interviews, it will be sufficient to solve Easy-level tasks.
View vacancies in the Work section.