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

Developer preparing for a coding interview with practice problems

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.

WeekFocusGoal
1One language, Big OWrite loops, functions, and maps without looking up syntax; explain O(n) and O(n log n)
2Arrays and stringsTwo pointers, sliding window, prefix sums
3Hash maps and setsCounting, fast lookup, deduplication
4Stacks, queues, linked listsReversal, cycle detection, bracket matching
5Trees and graphsDepth-first and breadth-first traversal
6Recursion and dynamic programmingBreak problems into smaller copies of themselves
7Sorting and searchingKnow at least one n log n sort in detail; binary search
8Mock interviews and reviewTimed 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.

TopicPractise thisExplain this trade-off
Arrays and stringsTwo pointers, sliding window, in-place updatesFast access versus costly inserts
Hash maps and setsCounting, membership tests, fast lookupSpeed versus extra memory
Linked listsReversal, merging, cycle detectionCheap link updates versus poor random access
Trees and triesTraversal, prefix lookup, recursionHeight and balance versus memory
GraphsTraversal, shortest path, connected partsRepresentation choice versus speed
SortingAt least one n log n sort, preferably twoSpeed versus stability and memory
Dynamic programmingMemoisation, tabulation, state choiceTime 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.

  1. Listen. Read the problem fully. Do not start coding yet.
  2. Example. Work a small example by hand. Confirm the expected output.
  3. Ask questions. Clarify input size, edge cases, and empty inputs. State your assumptions out loud.
  4. Brute force. State the simple solution first. Explain its time and space cost with Big O.
  5. Optimise. Look for bottlenecks, unnecessary work, and duplicated work. A hash map is often the first optimisation to try for repeated lookups.
  6. Walk through. Trace your plan on the example before you write code.
  7. 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.