How to prepare for a React machine coding round
A machine coding round asks you to build working React UI against the clock. Here's how to spend the first few minutes, what order to build in, which skills to practice, and how to rehearse with real problems and tests.

A restaurant hiring a cook often asks for a trial shift. Knowing recipes isn't the test. The head chef watches how you set up your station, whether the dish comes out on time, and whether you taste it before it leaves the kitchen. A React machine coding round is a trial shift for frontend developers: you cook in front of someone, against the clock.
To prepare for a React machine coding round, practice building small, complete components against a clock: plan the state first, get a plain working version early, then add edge cases, keyboard support, and cleanup, and talk through what you're doing as you go. Here's how to practice each part.
What happens in a React machine coding round?
You get a short prompt for a piece of UI, an editor, and a fixed amount of time. You build it in React while the interviewer watches and asks questions. Once the first version works, they may extend it: "now let only three run at once", or "now add a pause button". Unlike a question you answer out loud, the result has to run. Clicking the buttons should do what the prompt says.
The prompts are familiar pieces of UI that fit in one sitting but still hide a few tricky parts:
- Lists and state: a to-do list with filters, an accordion, or a shopping cart.
- Timers: a stopwatch, a countdown timer, or a traffic light.
- Data: an autocomplete, a paginated list, or search without races.
- Widgets: tabs with keyboard support, a modal dialog, or nested checkboxes.
- Small games: tic-tac-toe or a memory game.
What should you do in the first few minutes?
Don't start typing. Spend the first few minutes on questions:
- What must it do, and what's out of scope? Does the list need sorting? Can two panels be open at once?
- What happens at the edges: an empty list, a failed request, a count at its limit?
- Which keys should work? Should the arrow keys move between tabs?
Then plan the state out loud. Thinking in React gives you the steps: break the UI into components, build a static version from props, find the smallest set of state, and decide which component owns each piece. If the UI has separate looks, like loading, done, and error, hold them in one status value. Several booleans can contradict each other, as reacting to input with state shows.
What order should you build in?
Build in layers, so you have something that works at every point:
- A static version. Hard-code the data and render the markup with real elements: buttons for actions, labels for fields.
- State and events. Make the main flow work from start to finish. A plain version that runs beats a clever one that doesn't.
- The edges. Empty, loading, and error states, buttons that turn off at a limit, and fast repeated clicks.
- Keyboard and focus. Make it work without a mouse. Accessible React components covers what that takes.
- Cleanup and tidying. Stop every timer and listener, move repeated logic into a custom hook, and rename anything unclear.
If time runs out at any step, you still have a working app to show and talk about.

Which React skills should you practice?
The prompts above lean on the same few skills. Learn each one from its lesson, then use it in a problem:
- Updating state without changing it. Add, remove, and toggle items with spread,
map, andfilter. Read updating arrays in state, then build a kanban board. - Lists with stable keys. Give every item a key from its data, as rendering lists explains.
- Controlled inputs. Read forms and inputs, then build a sign-up form with validation.
- Effects with cleanup. Timers and listeners that stop when they should. Read synchronizing with effects, then build the stopwatch.
- Fetching without races. Loading and error states, and ignoring answers that arrive late. Read fetching data, then build a user profile fetch.
- Small custom hooks. useDebouncedValue and useClickOutside are pieces you'll reuse inside bigger prompts, like an autocomplete or a menu.
Which slips cost the most time?
A handful of bugs are easy to write in a hurry and slow to find:
- Changing an array in state with
push, so the screen doesn't update. - Starting an interval in an effect with no cleanup. In development, Strict Mode sets each effect up twice when a component appears, so a timer with no cleanup runs twice and counts double.
- Using the index as a key in a list that can reorder or lose items, so typed text jumps to the wrong row.
- Copying a value you could calculate into state, then keeping it in step with an effect.
- Putting everything in one big component, so every change is hard to follow.
Common React mistakes beginners make explains each of these, with the fix.
How should you practice?
Practice the way you'll be tested. For each of the React coding problems:
- Read the problem and start a timer before you write anything.
- Build it without hints, saying your plan out loud.
- Run the tests. Each failing test names a behavior you missed.
- Read the solution and compare how it holds the state.
- A week later, build the ones that took longest again, from scratch.
Start with a few easy problems in one sitting, then move to one medium or hard problem per session. When those feel steady, do a full rehearsal. A mock interview gives you a timed React round with an AI interviewer: questions first, then a hands-on task, with follow-ups and a written report at the end.
What should you do on the day?
- Say what you're about to build before you build it.
- Get the main flow working before you style anything.
- Check it in the browser as you go, not only at the end.
- When you make a choice, say why: "I'm calculating the filtered list during render, so it can't fall out of step with the items."
- Save a few minutes at the end to walk through your code and say what you'd add with more time.
Before the round, brush up on the ideas behind the code with the React interview questions. If a topic still feels shaky, the React course teaches it from the start.


