interview playbook · you failed before? start here
Failure-mode clinic
A failed interview is data, not a verdict on you.
Find the card that sounds like your last round. Train that one routine for two weeks. Then test it in a mock.
01
How to use this page
Don't fix everything at once. Pick one card, the one that hurt the most. Do its routine on every practice problem until it feels boring. Boring is good — boring means it will still work when you are nervous.
02
Seven failures, seven routines
blanked
My mind went blank on the approach
You read the problem and nothing came. Later, at home, the idea was obvious.
why it happens
- Under fear, even things you know well feel far away.
- You tried to see the best answer straight away, so you saw nothing.
- You had no checklist to fall back on.
the routine
- Read the problem twice. Say it back in your own words.
- Solve one tiny example by hand, on paper. Watch what you did.
- Say the brute force out loud, even if it is slow.
- Ask: which part of the brute force is slow? That part needs a better data structure.
- Run the pattern checklist: sorted? → two pointers / binary search. Subarray? → sliding window / prefix sum. Top k? → heap. Tree or graph? → DFS / BFS. All choices? → backtracking. Repeated sub-work? → DP.
idea → code
I had the idea but couldn't write the code
You explained the approach well. Then the editor stayed empty, or the code fell apart halfway.
why it happens
- Java details are not automatic yet:
HashMapmethods,int[]vsList<Integer>,charmaths. - You started typing before the steps were clear.
- Common shapes (BFS, binary search, sliding window) are not in your fingers yet.
the routine
- Write the plan as 3–6 short comments first. One comment = one step.
- Fill in the code under each comment, one step at a time.
- Learn the 8–10 common templates until you can type them from memory.
- Do 15 minutes of Java reps daily: maps, sorting with comparators,
ArrayDeque,StringBuilder.
- Java details are not automatic yet:
bugs
My code had bugs
Off by one. A
NullPointerException. A sum that went negative. The interviewer found it before you did.why it happens
- You ran the code in your head on the happy example only.
- Loop bounds were guessed, not checked.
- An
intwent pastInteger.MAX_VALUE(2,147,483,647) and wrapped around.
the routine
- Before you say "done", dry run one small example with a trace table: one row per loop step.
- Check the boundaries: first index, last index, empty input, one element.
- Use
longfor sums and products that can grow big. - Read your code once like a reviewer, top to bottom, slowly.
train itJava I/O & debuggingdry runs (mindset)edge-case checklists
time
I ran out of time
At minute 40 you were still thinking, or half the code was on screen.
why it happens
- You chased the best answer for too long and wrote nothing.
- You thought in silence, so the interviewer could not help you.
- You tried to write perfect code in one go.
the routine
- Follow the 45-minute plan. Glance at the clock at each phase change.
- No better idea by about minute 12? Code the brute force. A working answer beats a perfect idea.
- Practise with a real timer. Stop when it rings, then note where the minutes went.
- Get it working first. Clean it up only if time is left.
big-o
I couldn't answer the complexity question
"What is the time and space of this?" You said O(n) and hoped.
why it happens
- You memorised answers instead of counting.
- You forgot that the recursion stack and the
HashMapalso use space. - Average and worst case got mixed up.
the routine
- Name n first: "n is the length of the array".
- Count: how many times does each loop run? Multiply nested loops, add loops one after another.
- Say time and space as two separate sentences.
- For recursion, space includes the stack depth. For
HashMap, say "O(1) on average".
follow-ups
The follow-up question broke me
You solved it. Then: "What if the input is sorted? What if it doesn't fit in memory?" Silence.
why it happens
- You practised one version of each problem only.
- You knew what the solution does, not why it works.
the routine
- After every practice problem, ask yourself three follow-ups: sorted input? many queries? data too big for memory?
- For each, say which part of your solution changes and what it costs now.
- Also ask: duplicates? negatives? empty input?
train itall problemspatternsdrills
nerves & talking
I went quiet, and nerves took over
You think better in silence. But to the interviewer, silence looks like being stuck.
why it happens
- Thinking aloud is a skill. Nobody is born with it, introverts least of all.
- You were afraid a half-formed idea would sound dumb.
- You had no ready lines, so every sentence had to be invented under stress.
the routine
- Learn five lines by heart from the scripts page: clarify, brute force, stuck, hint, done.
- Daily: solve one Easy problem out loud, alone. Record it on your phone. Listen once.
- Before the round, take one slow breath and say your first line: "Let me restate the problem."
- Do at least three mock rounds with a real person before the real one.
train itwhat to saymock rounds
03
After every round, practice or real
Write this down within an hour, while you still remember. Your notes will show which card is really yours.
Round log