Representative practice prompts
Five Anduril frontend interview practice questions
For each prompt, clarify the contract, get working behaviour first, explain where state lives, and test the failure cases. Each prompt links to the public report it is modelled on and to a practice page.
Prompt 1
Build a file explorer from nested data in React
Given a nested array of folders and files, render a tree where each row shows a file or folder icon next to its name, and clicking a folder shows its children below it. Get it working before you style it.
Practice version modelled on a reported round: Public report: Taro frontend internship loop, July 2023
What this measures
Recursive rendering, where open-folder state lives, stable keys, and whether you deliver working behaviour inside the time box.
Clarify first
- Ask whether folders start open or closed, whether several folders can be open at once, and whether clicking a file must do anything.
- Confirm the data shape: is every folder given a children array, can a folder be empty, and do items carry ids or must keys come from their paths?
Strong answer should cover
- Render one recursive node component that takes an item and its depth; a folder renders its children only when open, a file renders a row with its icon.
- Keep open state as a set of folder ids at the top, or inside each folder component if nothing else needs it, and say why you chose one.
- Key rows by id or path, indent by depth, and make each folder row a button with aria-expanded so the tree works from the keyboard.
- Test an empty folder, a deep path, two folders with the same name in different places, and toggling a folder twice.
Common miss: Styling the tree before the toggle works, or keying rows by name so two folders called src collide.
Practise the file explorer tree (Premium) Prompt 2
Write a timer class, then build a React app around it
Write a Timer class in plain JavaScript with start, pause and reset and a way to read the elapsed time, then build a small React app that drives it with buttons and a live display.
Practice version modelled on a reported round: Public report: Taro software engineer loop with a frontend focus, December 2024
What this measures
Separating logic from the view, correct time accounting across pauses, and clean teardown of subscriptions and intervals when the component unmounts.
Clarify first
- Ask whether the timer counts up or down, what resolution the display needs, and whether reset should keep it running.
- Confirm whether the class may own an interval itself or should expose elapsed time computed from timestamps.
Strong answer should cover
- Store the start timestamp and the accumulated time instead of counting ticks, so pauses and late intervals do not drift.
- Give the class subscribe and unsubscribe methods, or compute elapsed time on demand, and keep it free of React so it can be tested alone.
- In React, create the instance once, subscribe in an effect, update state on each tick, and clean up on unmount.
- Test pause then resume, reset while running, a second start, and unmounting while the timer runs.
Common miss: Putting the timing logic inside the component so the class is a thin wrapper, or leaving an interval running after unmount.
Practise the React countdown timer (Premium) Prompt 3
Build a component in plain JavaScript, then port it to a framework
Starting from an empty file, build a small interactive component with plain JavaScript and the DOM, then rebuild the same behaviour in React, Vue or Angular without changing what the user sees.
Practice version modelled on a reported round: Public report: Taro software engineer coding interview, 2025
What this measures
DOM fundamentals without a framework, then whether you can map imperative updates onto declarative state without changing behaviour.
Clarify first
- Ask which framework you may choose for the second half and whether the plain version must keep working.
- Write the behaviour as a short list of inputs and outputs before starting either version.
Strong answer should cover
- In the plain version, keep state in one object, render from it with a single function, and attach listeners with event delegation instead of one per element.
- Name what changes in the port: state moves into the framework, rendering becomes declarative, and listeners move into the template.
- Reuse pure logic, such as a class or helper functions, unchanged in both versions.
- Run the same list of cases against both versions so the port is checked against the original.
Common miss: Rewriting from scratch in the framework so the two versions drift apart, or using innerHTML with user text in the plain version.
Practise the dropdown class and its React port (free) Prompt 4
Implement lodash-style flatten, map and reduce
Implement flatten, map and reduce without the native methods, then test them on nested arrays, sparse arrays and an empty input.
Practice version modelled on a reported round: Public report: Blind comment on the frontend interview, May 2024
What this measures
Precise behaviour of array helpers, recursion depth, and the edge cases you state before you write code.
Clarify first
- Ask whether flatten is one level, a given depth or fully deep, and whether holes in sparse arrays must be skipped.
- Confirm the reduce contract with and without an initial value, including the empty-array error.
Strong answer should cover
- Write flatten with a depth argument and recursion, or with an explicit stack if very deep inputs are possible.
- Make map and reduce skip holes like the native methods, pass the index and the array to the callback, and throw a TypeError for reduce on an empty array without an initial value.
- Keep each helper pure and return new arrays.
- State the time complexity and test nested, sparse, empty and single-element inputs.
Common miss: A reduce that silently returns undefined for an empty array, or a flatten that ignores the depth argument.
Practise flattening one level (free) Prompt 5
Build an autocomplete search in React
Build a search input that suggests matches as the user types, ignores late responses to old queries and lets the user pick a suggestion from the keyboard.
Practice version modelled on a reported round: Public report: Blind comment on an autocomplete round, May 2024
What this measures
Request ordering, debouncing, and an accessible listbox pattern under time pressure.
Clarify first
- Ask whether suggestions come from a local list or an API, and what should show while a request is pending or fails.
- Confirm the keyboard behaviour: arrow keys to move, Enter to select, Escape to close.
Strong answer should cover
- Debounce the input, and ignore or abort responses that belong to an older query so a slow answer cannot overwrite a newer one.
- Keep the query, the suggestions, the active index and the request status as separate pieces of state.
- Use the combobox and listbox roles with aria-activedescendant so screen readers announce the active option.
- Test fast typing, an empty result, a failed request and selecting with the keyboard.
Common miss: Rendering whichever response arrives last, so typing quickly shows results for an old query.
Practise the React autocomplete starter (free)