Micro-questions over the coding round module. Answer in a full sentence before opening the toggle. Format explained in the arrays bank.
This one is about method, so answering it out loud is the point twice over.
A. The method
1. What are the seven steps?
Answer
- Restate and clarify. 2. Work a small example by hand. 3. State the brute force and its complexity out loud. 4. Optimise, saying what you are trading. 5. Get agreement before coding. 6. Code, narrating, then trace your own code. 7. State complexity and check edge cases unprompted.
2. How long does step 1 take, and on which problems?
Answer
Two minutes, always — including easy ones.
3. Which clarifying questions actually change the answer?
Answer
Input size (decides whether is acceptable — means it probably is); sorted? duplicates? negatives? empty? nulls?; can I mutate the input, is there extra memory?; exactly one valid answer or several?
4. Why is clarifying not a formality?
Answer
It buys thinking time, prevents solving the wrong problem, and demonstrates the exact behaviour they want on a real team.
5. What does working a small example by hand give you?
Answer
Half the time the pattern falls out of doing it — and it gives you test data for step 6 for free.
6. Why state the brute force out loud?
Answer
It guarantees you have something, and it frames the optimisation as deliberate rather than lucky.
B. The optimisation moves
7. Name the six moves.
Answer
Hash map (space for time); sort first (pay to unlock two pointers or a sweep); two pointers / sliding window (exploit sortedness or contiguity); precompute (prefix sums, suffix maxima); memoise (kill overlapping subproblems); the right data structure (heap for top-K, monotonic stack for next-greater, union-find for connectivity).
8. Which is the single most common move?
Answer
The hash map — turning an scan into an lookup.
9. What should you say at step 5, and why does it matter?
Answer
Something like “So: sort, then two pointers, time, extra space. Shall I code that?” — because if your approach is wrong, this is where a good interviewer redirects you, rather than after twenty minutes of typing.
10. What must you do before saying you are done?
Answer
Trace your own code on the example from step 2, out loud. Finding your own bug is a strong positive signal; being told about it is not.
11. Which edge cases do you check unprompted?
Answer
Empty, single element, all identical, overflow, the maximum size.
C. What gets people rejected
12. What is the number-one rejection cause?
Answer
Silence. Eight quiet minutes reads as being stuck even if you are thinking productively.
13. What do you do instead?
Answer
Narrate — “I’m considering whether sorting helps here… it would cost but then I could use two pointers…”
14. What does coding immediately signal?
Answer
Someone who would start building before understanding a requirement.
15. What is the right attitude to a hint?
Answer
Hints are the interviewer trying to pass you. Take them visibly and gratefully.
16. Name the two complexity claims people most often get wrong.
Answer
Forgetting the sort they called is , and forgetting that string concatenation in a loop is .
17. What is “optimising the wrong thing”?
Answer
Micro-optimising an solution instead of finding the one.
D. Complexity talk that sounds senior
18. Explain amortised properly.
Answer
ArrayList.add is amortised — most appends are , a resize is , and averaged over appends it is constant. Say “amortised” and mean it.
19. What does space include that people forget?
Answer
The call stack. A recursive solution on a skewed tree is space, not .
20. Give the mechanical-sympathy remark.
Answer
ArrayList beats LinkedList for middle insertion at realistic sizes, because contiguous memory is cache-friendly — Big-O hides constants, and constants can decide the answer.
21. Give the input-size table.
Answer
→ exponential/backtracking fine; → ; → ; → only.
22. Why is that table “the closest thing to a cheat code”?
Answer
Reading the constraints tells you the intended complexity, which tells you the intended approach.
E. Things worth knowing cold
23. Hash map complexity, average and worst?
Answer
average, worst case when all keys collide. In Java, treeified buckets make it instead.
24. Heap costs, and the top-K consequence?
Answer
insert/extract, peek. “Top K” is a heap of size K — rather than for a full sort.
25. What mistake do “a stunning number of people” make?
Answer
Reaching for DFS on a shortest-path problem. BFS finds shortest paths in unweighted graphs; DFS does not.
26. Dijkstra and negative edges?
Answer
Dijkstra fails — Bellman–Ford handles them.
27. What must you get right in binary search, and what is secondary?
Answer
The invariant — not the mid calculation. Decide whether your loop is while (lo < hi) or while (lo <= hi) and keep the invariant consistent. (Still use lo + (hi - lo) / 2 to avoid overflow.)
28. When does the comparison sorting lower bound not apply?
Answer
When you are not comparing — counting and radix sort, with bounded integer keys. Knowing when the bound does not apply is a nice card to have.
F. Practice that works
29. What is the re-solve rule?
Answer
Solve, then re-solve from scratch three days later. Recognition is not recall — if you cannot reproduce it cold, you did not learn it.
30. How should you practise, physically?
Answer
Out loud, standing up, on a timer. Interviews are a performance under time pressure; practising silently at your own pace trains the wrong skill.
31. What one line do you write after each problem?
Answer
What was the signal that pointed at this pattern? That line is what transfers to a problem you have not seen — the solution itself does not transfer.
32. Breadth or depth?
Answer
Breadth of pattern over depth of problem count. Fifteen patterns well understood beats three hundred problems half-remembered.
33. Summarise the module in one sentence.
Answer
Clarify, example, brute force, optimise out loud, agree, code narrating, test yourself — and practise recall standing up on a timer, not recognition at your desk.
Scorecard
| Pass | Date | Got it | Close | Blank | Questions missed |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | |||||
| 3 |
Related
- The Coding Round — the module
- The patterns folder — the breadth this note argues for
- Growth & Asymptotics — Question Bank
Software engineering
Infrastructure & security
Computer science
Hardware & engineering