A React live coding prompt is almost never one screenful. The spec sits in one pane, the starter component in another, the test list below the fold, and a single-screenshot tool reads one of the three, then confidently answers a question nobody asked. The fix is a capture that takes several shots before it sends anything: Ctrl+Alt+S, drag a box, about three seconds to scroll, drag again, then Enter sends them together as one problem. Here is that session on a debounced search task, and why the Big-O line at the bottom is the least useful part of what comes back.
Why a frontend prompt breaks a single-screenshot tool
An algorithm prompt is self-contained: title, constraints, two examples, one panel, one crop. A CodeSandbox or StackBlitz style React task spreads what you need across three places.
- The spec pane holds the behaviour requirements and the numbers. "Wait 300ms after the user stops typing" is usually stated exactly once, here.
- The starter file holds the contract: the component name, the props it already receives, which hooks are imported, whether a
fetchResultshelper exists that you are meant to call, not write. - The test list holds the edge cases. Names like
does not fire on unmountorignores a stale responsetell you what the grader cares about, and they sit at the bottom.
Crop one pane and the answer comes back fluent and wrong in a specific way. It invents prop names. It writes a class component when the starter uses hooks. It reaches for lodash.debounce when the README banned new dependencies. It picks 500ms because 300ms was two scrolls away.
One capture session, three drags, one Enter
Expand any collapsed sections first, because OCR reads pixels and not the DOM. The constraint that shapes the rest is the roughly three second gap between drags, so decide where you are scrolling first.
Ctrl+Alt+S, then drag one: the spec
Box the requirements text: the delay, any rule about dependencies, the behaviour on empty input. Keep it tight; a drag that swallows the file tree just gives the OCR noise.
Scroll, then drag two: the starter file
From the import lines down to the export. The import list is load-bearing: it says whether useRef is already available and whether a fetch helper is provided.
Scroll, then drag three: the tests
The test names or the acceptance list. This is the drag people skip, and the one that turns a generic debounce into an answer handling unmount and stale responses.
Enter to send, Esc to abandon
Enter submits all three shots together as one problem, and OCR runs server-side so text-only models can read them. Esc cancels the session, which is what you want if a drag caught the wrong region.
What comes back on a debounced search box
The standard version: a controlled search input, results fetched from an API, debounced by 300ms, with tests for unmount and out-of-order responses. What returns is intuition, a dry run, then complexity.
The intuition
- Two pieces of state, not one.
queryupdates on every keystroke so the input stays controlled and typing never lags. A second value,debounced, trails behind and is the only thing the fetch effect depends on. Collapsing them into one is the common wrong answer, and the input visibly stutters. - The timer has to survive re-renders. A
let idin the component body is a fresh binding every render, so a cleanup reading it clears nothing. Keep the id in the closure of the effect that set it, or in auseRef. - Cleanup is the mechanism.
useEffect(() => { const id = setTimeout(...); return () => clearTimeout(id); }, [query, delay]). Cancelling on the next keystroke is what makes this a debounce rather than a delay.delaybelongs in the dependency array when it is a prop. - The fetch needs a guard. An
AbortControlleraborted in the fetch effect's cleanup, or a check that the resolved query still matches the current one beforesetState.
The dry run
Worth reading twice, because it is the part you will narrate out loud. With a 300ms delay:
- t = 0, you type
r. The effect schedules timer A for t = 300. - t = 90,
e. The cleanup fires first and clears A. Timer B is set for t = 390. - t = 180 and t = 260,
athenc. Each clears the timer before it, leaving D set for t = 560. - t = 560, you have stopped typing, D fires and sets
debouncedtoreac. The fetch effect runs once. Four keystrokes, one request. - Unmount at t = 500, before D fires: the cleanup clears D, so nothing sets state on an unmounted component. That is one of the tests.
- Out of order: with two requests in flight, the response for
reacan land after the one forreac. The abort or the stale check drops it. That is the other test, and the one candidates miss.
Where the Big-O line is beside the point
The answer ends with complexity, because that is what the format returns for every problem. Here it will say something close to O(1) per keystroke and O(n) to render n results. True, and useless in the moment. Nobody grading a frontend round is checking asymptotics. They are checking whether the effect cleans up, whether the input stays controlled, whether you cancel the in-flight request, and whether list keys are stable identifiers rather than the array index. Read the intuition and dry run, skim the complexity.
The exceptions are narrow. Filtering a few thousand rows on every keystroke, a virtualised list, or a sort inside render turns that line back into the answer. When the prompt names a dataset size, that is the tell.
Which layouts actually need more than one shot
| Prompt layout | Drags | What a single crop loses |
|---|---|---|
| Algorithm prompt in one panel | One | Little, if constraints and examples are in the box |
| CodeSandbox or StackBlitz React task | Three | Prop names in the starter file, the delay stated only in the spec |
| Take-home README plus a repo file | Two or three | The "no new dependencies" rule, which lives in the README |
| A doc the interviewer scrolls | Whatever you catch | Whatever they scrolled past |
Where this is the wrong tool
A React live round is a conversation, not a submission. The interviewer will interrupt: why a ref and not state for the timer, what happens if it unmounts mid-flight, now make it cancel on blur. An answer you did not understand collapses at the first follow-up, faster here than on an algorithm round, because the grader watches you refactor rather than reading a finished function.
- Windows 10 and 11 only. No macOS, Linux, mobile or browser-extension build. If your round is on a Mac, none of this applies.
- Capture exclusion covers screen sharing and recording, nothing else. OfferPilot AI's overlay is excluded from screen capture at the operating system level, so it is absent from Zoom, Teams, Meet, OBS and screenshots while staying visible on your own monitor. It does nothing about a webcam, a lockdown browser, eye tracking, a proctor in the room, or a phone camera behind you.
- The rules belong to the company. Some frontend screens explicitly allow documentation and AI assistance, some do not. Read the instructions, and ask if they are ambiguous.
- The last mile is yours. Code that reads correctly still needs the right import paths, the right file, and the sandbox's test runner.
Practise the loop before you need it
Hold P for a see-through overlay so the answer and the starter file are readable in one glance, Ctrl+Alt+H to hide it, Ctrl+Alt+Q to cycle the answer mode. Grok, DeepSeek and Gemini each answer every question in parallel, once, so switching between them costs no extra time; read Gemini first on coding problems. Then run a few React tasks a week with Code Copilot, reading the intuition and dry run before the code, then rebuilding the component from memory while narrating it. For the half of the round that is not code, the company Q&A generator and the question banks cover the follow-ups. The free tier is 5 minutes a day with no card, enough to check that a three-drag capture reads your sandbox; plans start at $39 a month.
Related guides
- Full Stack Take-Home vs Live Coding: What Each Format Grades
- AI Copilot for Product Manager Case Interviews: 5 Case Types
- AI Interview Copilot for New Grad SWE: Which Rounds It Helps
- Data Engineer SQL Interview Round: What to Expect in 45 Minutes
- ML System Design Interview: The Answer Spine Candidates Skip