Technical interviews
A repeatable method for solving technical interview problems
Original guide by MockInterview AI · Updated 12 September 2026
Technical interviews evaluate the quality of your reasoning as well as the final code. Interviewers need to see how you turn an ambiguous prompt into a well-defined problem, choose an approach, and verify that approach. A calm, repeatable process is more useful than memorizing isolated solutions.
Clarify the contract
Restate the input and expected output in your own words. Ask about input size, duplicates, ordering, invalid values, and whether the data can be modified. These questions often determine whether a hash map, sort, stack, graph traversal, or dynamic-programming approach is appropriate.
Start with a simple approach
Describe a correct baseline before optimizing. A brute-force solution gives you a reference point and lets you explain what repeated work is expensive. Then identify the bottleneck and introduce a data structure or invariant that removes it.
Narrate invariants while you work
Instead of reading code line by line, explain what remains true after each loop or traversal. For a sliding window, say what the window represents and when its left edge moves. For a graph search, say what the queue and visited set guarantee. Invariants make correctness easier to inspect.
Test boundaries before finishing
Walk through an empty input, one item, duplicate values, already sorted data, and the largest meaningful input. State time and space complexity in terms of the input size, and mention any assumptions that affect the result.
Prompts to practice
- Explain the trade-off between a hash map and sorting for Two Sum.
- How would you test a function that merges overlapping intervals?
- Describe an approach before writing code for a shortest-path problem.
Use the framework as a starting point, then adapt it to your own experience and voice.
Practice this framework