Prompting and delegating
What to delegate to an AI assistant, what to write yourself, and how to write scoped prompts that interviewers reward.
During an AI-assisted interview, every prompt does double duty: it steers the model and shows the interviewer how clearly you understand the problem. A vague prompt signals that you are hoping the assistant figures things out for you; a tight prompt shows you already know what the code needs to do.
What to delegate vs. what to keep
A reliable rule of thumb: if you can specify the exact acceptance test in two sentences, delegate the typing; if you haven't nailed down the invariant yet, think and design first.
| Good to delegate | Better to own yourself |
|---|---|
| Boilerplate: dataclasses, CLI/arg parsing, serializers | Choosing the core algorithm and data structures |
| Implementing a pattern already established in the repo | Defining the tricky invariant or state machine |
| Scaffolding repetitive unit test cases | Deciding which edge cases actually prove correctness |
| Translating a clear step-by-step plan into syntax | Judging whether the diff is clean and safe |
| Looking up unfamiliar standard-library signatures | Answering complexity and follow-up probes |
Four ingredients of a clean interview prompt
Strong prompts specify location, change, constraints, and check:
Notice why the second prompt works well in an interview:
- You diagnosed the bottleneck (
O(n)list scan) before asking for code. - You chose the data structure (
OrderedDict) instead of outsourcing the choice. - You pinned down invariants and edge cases (
capacity <= 0, unchanged API). - You kept the change small enough to review immediately.
Stick to one change per prompt
Bundling three requests ("fix the bug, add the Phase 2 feature, and write comprehensive tests") produces a 150-line diff that burns your clock during review and hides subtle regressions. Break it into three small round trips: fix and verify the bug, implement and verify the feature, then add targeted edge-case tests.
When output is wrong, diagnose instead of repeating
If the assistant returns buggy code, never reply with "that still fails, try again." Point at the exact defect and supply the missing constraint:
If a model misses the same logic twice in a row, stop prompting and write those lines by hand. It is almost always faster, and interviewers view taking over cleanly as a strong senior signal.
Narrate before and after every prompt
In a BYO-IDE screen share, the interviewer may not be able to read small chat text as you type. Even in CoderPad where prompts are logged, narrating keeps the session collaborative:
- Before sending: "I'm going to ask it to write the log-line parser for these three sample rows, keeping the message body unsplit."
- After reading the output: "It handles the happy path, but
line.split(' ')breaks when the message contains spaces. I'll change that tosplit(' ', 3)myself."
Moments when skipping AI is the smarter call
Using AI well includes knowing when not to reach for it:
- Tiny fixes you already see: Typing a two-line guard takes five seconds; prompting and reviewing takes thirty.
- The core 10-line algorithm: Writing the central search loop yourself guarantees you can trace every branch during follow-up questions.
- After two bad retries: Don't wrestle the chat box while the clock ticks.
- Whenever the round restricts it: Some loops turn off AI for Phase 1 or for final wrap-up questions.
Try practising clear delegation on B03LRU cache from scratch (where it is tempting to let the AI design the whole cache) and A03Card game: three cards that sum to 15 (where the core combinatorics are short enough to own directly).