How to Prepare for a Coding Interview: Topics, Practice and Timeline
Prepare for a coding interview with a clear plan: core topics, a repeatable problem method, timed practice, mock interviews, and an 8-week timeline.
By Galactic News Editorial · Published 2026-11-19T04:39:46+00:00 · Updated 2026-11-19T04:39:46+00:00
How to Prepare for a Coding Interview: Topics, Practice and Timeline
To prepare for a coding interview, you need three things: core data structures and algorithms, a repeatable way to solve problems out loud, and timed practice under real conditions. This guide covers the topics that matter, a method to use on every problem, and an eight-week timeline. It suits software engineering roles at most companies. Adjust the emphasis to match the job description.
First, learn what the interview actually measures
Most coding interviews test how you think, not only whether your code runs. Interviewers watch you clarify the problem, choose a data structure, explain trade-offs, and test your own code. A candidate who talks through a structured approach often beats one who silently produces a correct answer. That finding comes from the framework in Cracking the Coding Interview, which stresses process over memorised solutions.
Formats vary by company. Microsoft's own careers guidance says technical rounds last about 45 minutes and candidates code in the language they are strongest in, using a tool where code can be run and compiled. Most interviews at Microsoft include two to four conversations with potential teammates. Other companies use online assessments first, then live rounds. Read the recruiter's instructions. Ask what the format will be if it is not stated.
How to prepare for a coding interview: the 8-week timeline
Eight weeks of steady work builds a strong base for most coding interviews. Five days a week, one hour a day, is a realistic routine. Spend ten minutes revising, forty minutes on a new problem, and ten minutes writing down what you learned. At the weekend, do one timed mock round of two problems in sixty minutes, then review your mistakes.
| Week | Focus | Goal |
|---|---|---|
| 1 | One language, Big O | Write loops, functions, and maps without looking up syntax; explain O(n) and O(n log n) |
| 2 | Arrays and strings | Two pointers, sliding window, prefix sums |
| 3 | Hash maps and sets | Counting, fast lookup, deduplication |
| 4 | Stacks, queues, linked lists | Reversal, cycle detection, bracket matching |
| 5 | Trees and graphs | Depth-first and breadth-first traversal |
| 6 | Recursion and dynamic programming | Break problems into smaller copies of themselves |
| 7 | Sorting and searching | Know at least one n log n sort in detail; binary search |
| 8 | Mock interviews and review | Timed rounds, out-loud thinking, mistake list review |
If you have only two weeks, cut the list. Cover arrays, hash maps, and one tree topic. Do one mock interview every other day. A short, focused plan beats a long plan you abandon.
Prepare coding interview topics that matter most
Interview questions repeat a small set of patterns. Learn the patterns and you cover far more questions per hour of study. The table below lists the core topics, what to practise, and what trade-offs to explain.
| Topic | Practise this | Explain this trade-off |
|---|---|---|
| Arrays and strings | Two pointers, sliding window, in-place updates | Fast access versus costly inserts |
| Hash maps and sets | Counting, membership tests, fast lookup | Speed versus extra memory |
| Linked lists | Reversal, merging, cycle detection | Cheap link updates versus poor random access |
| Trees and tries | Traversal, prefix lookup, recursion | Height and balance versus memory |
| Graphs | Traversal, shortest path, connected parts | Representation choice versus speed |
| Sorting | At least one n log n sort, preferably two | Speed versus stability and memory |
| Dynamic programming | Memoisation, tabulation, state choice | Time saved versus memory spent |
Microsoft's preparation guidance names sorting as a must-know: candidates should know the details of at least one n log n sorting algorithm, preferably two. Do not skip it.
A repeatable method for every problem
Use the same steps on every problem. A fixed method keeps you calm under pressure. The seven-step method from Cracking the Coding Interview works well.
- Listen. Read the problem fully. Do not start coding yet.
- Example. Work a small example by hand. Confirm the expected output.
- Ask questions. Clarify input size, edge cases, and empty inputs. State your assumptions out loud.
- Brute force. State the simple solution first. Explain its time and space cost with Big O.
- Optimise. Look for bottlenecks, unnecessary work, and duplicated work. A hash map is often the first optimisation to try for repeated lookups.
- Walk through. Trace your plan on the example before you write code.
- Implement, then test. Write clean code. Test it against edge cases by hand. Fix bugs before you declare it done.
Talk while you work. The interviewer is grading your thinking, not just your final code. Say what you are about to try and why. If you get stuck, say so. Then try a smaller case or a different angle.
Practise under real conditions
How you practise matters more than how many problems you solve. Learn one concept, then solve three to five problems on it, from easy to medium. Try each problem for twenty to thirty minutes before you read any hint. If you are stuck, read only the idea, close it, and write the code yourself.
Use a plain editor for timed practice. Real interviews give you no autocomplete and no debugger. Practise typing complete solutions and checking them by hand. Platforms such as LeetCode, HackerRank, and NeetCode offer curated lists, including the well-known Blind 75 set of must-solve questions. Pick one platform and stick with it.
Do mock interviews. Peer practice services let you interview a stranger and be interviewed in return. Treat mocks like real interviews. Speak your reasoning aloud. Time yourself. Afterwards, write down every mistake in a list and review it before the next mock.
Do not skip the behavioural round
Most loops include behavioural questions. Prepare five to eight true stories about your work. Each story should take about two minutes. Cover a conflict, a failure, a time you took ownership, and a time you helped a teammate. Tell each story with the STAR model: situation, task, action, result, and reflection. Microsoft's interview tips page recommends the STAR model for exactly this purpose.
The day before the interview, rest. Review your mistake list and your stories. Check your setup if the interview is remote. Sleep properly. A tired brain solves nothing well.
Bottom line
Pick one language. Learn the core topics in order. Use the same seven-step method on every problem. Practise under a timer and out loud. Do mocks, review your mistakes, and prepare your stories. Eight weeks of that routine gives most candidates a real shot.