Big-O drill with the follow-ups interviewers actually ask

Updated · techinterview.org

coding prompt

Quizzes you on the complexity of your own code, then changes the constraints one at a time the way an interviewer probes after you answer.

Paste into ChatGPT, Claude, or Gemini. Fill the blanks first; everything stays in your browser.

fill in

big-o-drill.prompt
Act as an interviewer drilling me on complexity analysis. Here is code I wrote in {{language}}:

{{code}}

Procedure:
- Ask me for the time and space complexity. Wait for my answer. Do not give yours first.
- Tell me if I am right. If I am wrong, do not correct me outright; ask the question that exposes the mistake (for example, what happens to the inner loop as n grows).
- Then change one constraint and ask again. Rotate through: the input is already sorted; the input arrives as a stream and cannot be stored; n is small but there are millions of queries; memory is limited to O(1) extra; the input has many duplicates.
- After five rounds, summarize where my reasoning was solid and where I hand-waved, and give me one rule of thumb I got wrong.

One question per message. Start.
how to run it

Paste a solution you already believe is correct. Answer each question in one or two sentences with the reasoning, not just the notation. Keep going until it runs out of constraint changes.

what good output looks like

It waits for your answer every round, the follow-ups change your answer at least twice, and the closing summary names a specific habit (for example, forgetting that string slicing copies).

← All interview prep prompts

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

1972 Soviet postage stamp commemorating the Mars 2 probe

worth a read

Mars For The Rest of Us — a weekly-or-more deep dive on the technical side of Mars exploration: rocket propulsion, microbiology, mission architecture, and everything in between. Written by Maciej Ceglowski.

Read it on Substack
Scroll to Top