A minute-by-minute coding-round protocol
Why you care
Most failed coding rounds fail on allocation, not knowledge: twenty-five minutes on an unchecked approach, no time to test, and a bug found at minute 44 by the interviewer instead of by you. On the job it is the transform written before anyone agreed what the output rows look like. Interviewers watch your order of work because it predicts how you behave on a ticket. This card gives a rehearsal schedule so the order becomes habit. It is a practice device, not a rule any company publishes.
Explain like I'm 5
A train has six stations and a fixed arrival time. A schedule does not make it faster. It tells you at each platform whether you are late, so you can drop something while there is still time.
Core concept
The protocol is six phases in a fixed order, sized for a 45-minute round:
- Clarify (0-5): inputs, outputs, sizes, duplicates, empty input, failure behaviour.
- Baseline and cost (5-10): a correct slow approach with its time and space.
- Approach (10-15): the invariant or structure that beats the baseline, with its cost.
- Implement (15-30): write it once, cleanly.
- Test (30-40): hand dry-run, then edge cases whose expected results you wrote first.
- Wrap-up (40-45): restate complexity and name one improvement.
- Gates, not clocks. A phase ends when its output exists (a written contract, a stated cost, a chosen approach). Minutes only tell you when to cut.
- Hard cut at minute 15. No approach yet means you code the baseline.
- Scale it. Keep the ratio 5:5:5:15:10:5 in whole minutes; below 20 minutes the plan refuses to split. The hard cut stays at a third of the round (15 of 45, 21 of 60). Ask the recruiter for the duration, language and whether code runs.
Do not defend it against the interviewer: if they ask for a different test, they have overridden your plan.
Minimal example The 45 minutes on one screen
phases = [("clarify", 5), ("baseline", 5), ("approach", 5), ("implement", 15), ("test", 10), ("wrap-up", 5)]
t = 0
for name, mins in phases:
print(f"{t:>2}-{t + mins:<2} {name}")
t += mins
print("total", t) 0-5 clarify
5-10 baseline
10-15 approach
15-30 implement
30-40 test
40-45 wrap-up
total 45In production Rescale the plan to the real duration
Most rounds are not 45 minutes. This keeps the ratio with integer arithmetic, hands leftover minutes to the largest fractional parts, and refuses a round too short to give every phase a minute.
WEIGHTS = {"clarify": 5, "baseline": 5, "approach": 5, "implement": 15, "test": 10, "wrap-up": 5}
MIN_TOTAL = 20
def plan(total):
"""Split `total` whole minutes in the 5/5/5/15/10/5 ratio, largest remainder first."""
if total < MIN_TOTAL:
raise ValueError(f"{total} min is below the {MIN_TOTAL}-minute minimum")
base = sum(WEIGHTS.values())
quota = {k: total * w for k, w in WEIGHTS.items()} # integer arithmetic only
mins = {k: q // base for k, q in quota.items()}
spare = total - sum(mins.values())
by_rem = sorted(WEIGHTS, key=lambda k: (-(quota[k] % base), list(WEIGHTS).index(k)))
for k in by_rem[:spare]:
mins[k] += 1
return mins
def clock(mins):
t, rows = 0, []
for name, m in mins.items():
rows.append(f"{t}-{t + m} {name}")
t += m
return " | ".join(rows)
for total in (45, 60, 30, 35, 20, 12, 0):
try:
p = plan(total)
assert sum(p.values()) == total
print(total, "->", clock(p))
except ValueError as e:
print(f"ValueError: {e}")45 -> 0-5 clarify | 5-10 baseline | 10-15 approach | 15-30 implement | 30-40 test | 40-45 wrap-up
60 -> 0-7 clarify | 7-14 baseline | 14-21 approach | 21-41 implement | 41-54 test | 54-60 wrap-up
30 -> 0-4 clarify | 4-7 baseline | 7-10 approach | 10-20 implement | 20-27 test | 27-30 wrap-up
35 -> 0-4 clarify | 4-8 baseline | 8-12 approach | 12-23 implement | 23-31 test | 31-35 wrap-up
20 -> 0-2 clarify | 2-4 baseline | 4-6 approach | 6-13 implement | 13-18 test | 18-20 wrap-up
ValueError: 12 min is below the 20-minute minimum
ValueError: 0 min is below the 20-minute minimumEvery row sums to its total (the assert proves it). The 12-minute and 0-minute rounds fail loudly instead of printing a one-minute test.
See it happen Where the 45 minutes go
- The first five minutes produce no code, only a written contract: inputs, outputs, sizes and edge cases.
- Minutes 5-10 produce a correct slow approach and its cost, so a valid answer exists before any optimising.
- Minutes 10-15 pick the invariant or structure that beats the baseline, or fall back to the baseline if none appears.
- Fifteen minutes of implementation is a single clean pass; stopping to redesign here eats the test window.
- Ten minutes of testing is a hand dry-run plus edge cases you picked before running them.
- The last five minutes restate cost and name one improvement; the interviewer remembers the ending.
- The naive timeline: almost no clarifying, code until minute 40, and the first test in the last five minutes leaves no room to fix anything.
In your world
The situation
You practise in evening blocks with no clock, code the first idea that appears and run it on the sample input only.
What actually breaks
In a timed mock you read for one minute, code for 28 and run the sample at minute 31. It passes. The interviewer then feeds an empty list and a list of equal values, and both fail. Your log says "solved"; the mock says "no hire".
What you'd do on Monday
Set five alarms at 5, 10, 15, 30 and 40 minutes and at each write one line saying which gate output exists.
gates = {
5: "contract written: input, output, sizes, empty and duplicate behaviour",
10: "baseline stated with time and space",
15: "approach chosen, or baseline chosen as the plan",
30: "code complete",
40: "three edge cases run, expected values written before running",
}Imagine you work at Zoho
The numbers
Illustrative: 600 candidates × 45 min = 27,000 min = 450 interviewer-hours. With 15 interviewers giving 6 interview-hours a day, capacity is 90 hours a day, so 450 ÷ 90 = 5 days. If rounds drift to 55 minutes: 600 × 55 = 33,000 min = 550 hours, 550 ÷ 90 ≈ 6.1, so 7 days.
What the Scenario-A answer does here
A timer on your screen works for one person. Ten extra minutes per candidate adds 100 interviewer-hours.
What flips at this scale
The schedule becomes a shared contract: the same six gates and a hard stop at minute 45, so transcripts are comparable.
The trade-off you'd defend
I would defend a fixed gated format over free-form conversation at this size, trading flexibility for comparable scores and a predictable five-day plan.
Illustrative capacity arithmetic; not Zoho-published numbers or its actual process.
Gotchas
Coding before the output contract is agreed
The code prints a clean answer and the interviewer says it is not what they asked.
The prompt had two valid readings and you silently took one. The 2 largest of [5, 5, 3] differ depending on whether duplicates count.
Spend the first five minutes on the contract and say the choice aloud.
import heapq
xs = [5, 5, 3]
print(heapq.nlargest(2, xs), heapq.nlargest(2, set(xs)))[5, 5] [5, 3]No fallback stated
At minute 24 the clever approach has an open case and no code exists.
No baseline was named at minute 10.
At minute 15, without a clear approach, code the baseline.
Tricky questions
Skip the slow version and state only the optimal one.
The baseline takes two minutes and gives you a fallback, a number to beat and an oracle for testing the fast version.
Scenario question
You're handed a 60-minute round and a prompt you only half understand at minute 8.
Model answer
I would rescale first: about 7, 7, 7, 20, 13 and 6 minutes, cutting at minute 21, a third of 60. At minute 8 I ask the one question that unblocks me and state a baseline. The trade-off is less breadth of ideas, but 13 minutes stay reserved for tests.
Interview corner
CommonHow do you structure a coding interview?
TrickYou are 15 minutes in with no approach. What now?
Experience checkWhen did you last build before the requirements were clear?
Memory hook
A timetable does not make the train faster, it tells you at each station what to drop.
Protect the test window: cut the approach search at minute 15 and code the baseline.
Self-check
How long is each phase in the 45-minute plan?
Clarify 5, baseline 5, approach 5, implement 15, test 10, wrap-up 5.
What do you do at minute 15 without an approach?
Implement the baseline and say so.
What does an interviewer redirect do to your plan?
It overrides it; follow them, then return to the gate you skipped.
Run one easy problem with alarms at 5, 10, 15, 30 and 40 minutes. Paste the filled gate log and the minute of your first edge case. Repeat three days later; the second minute should not be later.