How much you really need
Far less than the scare stories suggest. Beginners get problems solvable in fifteen or twenty minutes that don't require exotic data structures.
Months with a thick textbook aren't necessary. Twenty or thirty simple problems are enough to feel steady.
What you need to know
Arrays and strings. Iterating, searching, reversing, counting, removing duplicates. That's the basis of most junior problems.
Dictionaries and sets. Understanding that lookup in them is fast and in a list it's slow. Half of these problems are solved by realising a dictionary is the answer.
Sorting, as a user. Know it exists, be able to sort by your own criterion. Nobody asks you to write quicksort from scratch.
Complexity, informally. Enough to tell the difference between "we pass through once" and "for every element we scan the whole list again". A rough answer about logarithms is fine.
Recursion, basically. Understand the idea and be able to write something simple: factorial, walking a tree.
What you don't need
Dynamic programming, graphs, elaborate trees, clever search algorithms. If a junior gets asked those, it's usually either overreach by the company or a bonus problem you aren't obliged to solve.
The standard problems
Work through two or three of each kind:
- Reverse a string or array.
- Find duplicate elements.
- Count character or word frequency.
- Check that brackets are balanced.
- Find two numbers with a given sum.
- Merge two sorted lists.
- Check a palindrome.
- Find the most frequent value.
- Remove duplicates preserving order.
- Count something in a text.
That set covers the overwhelming majority of entry-level interviews.
How to prepare
Solve out loud. The main skill isn't solving but explaining. Practise narrating: what I understood, which approach, why that one, how I'll check it.
Record yourself. Unpleasant but useful: you'll hear where you mumble and where you swallow the reasoning.
Don't memorise solutions. Memorised answers are obvious, and a small change to the problem sinks you.
In the interview itself
- Clarify the problem. What if the input is empty? Can the numbers be negative? One question before starting makes a very good impression.
- State the approach before writing code. "I'll pass through once, accumulate into a dictionary, then take the maximum."
- Write and explain simultaneously. Silence is the worst thing you can do.
- Check the edge cases. Empty input, one element, all identical. Almost everyone forgets — remembering is a visible plus.
An interview problem is a conversation, not an exam. They're assessing a colleague, not a competitor.
Хватит читать — пора делать
На CohortX можно найти команду под пет-проект и получить тот самый опыт, о котором спрашивают на собеседовании.
Похожие статьи
- Fifteen SQL queries you'll be asked at an interviewStandard problems with notes on what each one tests, and the places beginners get them wrong.
- Пятнадцать запросов SQL, которые спросят на собеседованииТиповые задачи с пояснениями, что именно проверяет каждая, и разбор мест, где новички ошибаются.
- Online interviews: setup and preparationWhat to check before the call, how to behave on camera, and what to do when the connection fails at the worst moment.