Diagnose which pattern a problem is and why you missed it

Updated · techinterview.org

coding prompt

Post-mortem for a problem you got wrong: names the pattern, shows the tell in the statement, and fixes your attempt with the smallest possible change.

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

fill in

which-pattern-did-i-miss.prompt
I attempted this coding problem and did not get it, or got it late. Help me learn the pattern, not just the answer.

Problem:
{{question}}

My attempt (code or approach, including where I got stuck):
{{my_attempt}}

Respond in this order:
- The pattern this problem belongs to, in one line, and the exact phrase or constraint in the statement that should have signalled it.
- What my attempt got right. Be specific.
- The smallest change to my attempt that makes it correct. Prefer editing my code over rewriting it.
- The complexity before and after.
- Three other problems that use the same pattern, ordered easy to hard, with a one-line note on how each disguises the pattern.
- One question I should ask myself next time I see a statement like this.

Do not write a fresh solution from scratch unless my attempt is unsalvageable, and say so if it is.
how to run it

Use it right after a failed practice problem, while your reasoning is fresh. Paste your real code, including the broken parts. If the model rewrites everything, push back: ask for the minimal edit again.

what good output looks like

It points at a specific word in the problem statement, edits your code rather than replacing it, and the three sibling problems are ones you could go solve immediately.

← 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