Technical Interview Preparation
A technical interview tests problem solving, communication, correctness, and trade-off awareness—not only whether code compiles. Treat the interview as a small engineering design review with a time budget.
A repeatable sequence
- Clarify: restate inputs, outputs, constraints, mutability, duplicates, ordering, and invalid cases.
- Model: choose a data structure or system boundary and explain why.
- Baseline: state a simple correct approach and its complexity.
- Optimize: use constraints to remove repeated work or improve locality.
- Prove: state the invariant, induction, exchange argument, or safety property that makes the approach correct.
- Implement: write readable code with explicit names and bounds.
- Test: dry-run normal, empty, singleton, duplicate, boundary, and adversarial inputs.
- Analyze: give time, space, latency, capacity, and failure trade-offs.
Communication patterns
Say the decision before the code:
“Because the input is sorted and we need logarithmic search, I will maintain an inclusive interval and use a lower-bound invariant.”
Ask clarifying questions instead of silently assuming. If a requirement is ambiguous, state the assumption and explain how the design changes if it is false.
Coding checklist
- Define the invariant before writing the loop.
- Avoid integer overflow in midpoint, multiplication, and capacity calculations.
- Decide whether ownership, mutation, and aliasing are allowed.
- Do not hide complexity inside a library call without knowing its behavior.
- Keep error handling consistent with the requested API.
- Compile mentally after each structural change.
System-design interview outline
For a system-design question:
- Clarify users, traffic, latency, consistency, retention, and failure goals.
- Estimate request rate, storage, bandwidth, and peak multipliers.
- Draw the request path and data ownership.
- Choose APIs, storage, queues, caches, indexes, and partitions.
- Explain consistency and failure behavior before adding scale.
- Address observability, security, migrations, and operations.
- Identify bottlenecks and the next scaling boundary.
Behavioral and experience bridge
Technical answers are stronger when connected to evidence. Prepare concise stories covering an incident, a disagreement, a trade-off, a failure, a performance improvement, and a project you would redesign. State the situation, action, result, and what you learned; quantify impact without inventing numbers.
Common failure modes
- Coding before confirming the problem.
- Giving an optimal algorithm without explaining correctness.
- Ignoring constraints until the solution is complete.
- Claiming “exactly once” without defining the failure boundary.
- Treating average latency as the user experience while ignoring p99.
- Overfitting to a familiar pattern even when the data model differs.
- Running out of time because edge cases were postponed until the end.
Practice rubric
After each practice problem, record:
| Dimension | Question |
|---|---|
| Understanding | Did I identify the actual contract and constraints? |
| Approach | Could I explain the baseline and optimization? |
| Correctness | What invariant or proof makes it work? |
| Implementation | Did the code expose unsafe assumptions? |
| Testing | Which case would fail first? |
| Complexity | Can I justify every term? |
| Communication | Would another engineer be able to review it? |
Cross-references
- DSA problem-solving chapter
- Technical communication
- System design
- Behavioral interviews
- Coding patterns
- Company preparation