Frontend Developer mock interview
Last updated
Frontend interviews look for people who can implement a UI and explain why it is fast, accessible, and possible to change. A polished demo that ignores keyboard use or loading states usually loses to a plainer answer that names those cases.
Practice the questions below in the order a loop runs: a component exercise, a performance or CSS bug, then a story about shipping with design and backend partners.
Free plan: 2 interviews a month, free account, no card.
What the loop usually looks like
- Portfolio or recruiter screen (25 min). A recent UI you shipped, the constraint, and your role versus the designer.
- Live UI exercise (45 to 60 min). Build a small component, then add loading, error, and empty states.
- Deep dive (45 min). Accessibility, rendering performance, or a bug you traced in production.
What interviewers score
- Accessible interactions
- Loading and error states
- Rendering cost
- Collaboration with design
What interviewers probe at each level
Junior
Expect questions on HTML semantics, the box model, flex and grid, event handling, and a fetch with loading and error states. A common next question is "what does the user see while this loads?" You do not need framework internals, but you need to explain your own code line by line without losing the thread.
Mid level
Rounds turn to state ownership (component, URL or server), rendering cost, accessible custom controls, and how you test code that depends on time or the network. Expect "what happens with 2,000 items?" and "what if the design cannot be built as drawn?" Name the trade-off you took and the case you did not cover.
Senior
Interviewers look for design-system trade-offs, performance budgets, a plan for diagnosing a slow interaction with evidence, and migration steps that keep the product shipping. They also ask you to review a junior engineer's component and give feedback. Saying what you would not build is a strong signal at this level.
Mistakes that cost candidates this round
- Building only the happy path and adding loading, error and empty states when the interviewer prompts you.
- Using a div for a button, then having no answer for keyboard focus.
- Reaching for a library before naming which state needs managing.
- Fixing a layout shift by animating over it instead of reserving the space.
- Spending the answer on framework API names and skipping what the user experiences.
How to spend a 45 to 60 minute live UI exercise
This is an example plan, not a rule. Spend about five minutes clarifying what the component must do and who uses it. Spend ten on a semantic skeleton and the keyboard path, because adding focus handling later is harder than starting with it. Use another ten on the happy path, ten more on loading, error and empty states, five on a keyboard-only pass, and five on what you would do next if you had another hour.
Talk while you build. Interviewers score the choices you name, such as why this element is a button, where the state lives and what happens when the response is slow. Silence leaves them guessing whether a missing error state was a decision or an oversight.
Keyboard and performance facts interviewers expect you to know
For a custom dropdown, the W3C WAI-ARIA Authoring Practices describe the keys users expect from a listbox: Down and Up move focus between options, Home and End are recommended for lists with more than five options, and typing a character jumps to a matching option. In a select-only combobox, Down, Up, Home and End open the list, Escape closes it and returns focus to the combobox, and Enter selects. WCAG 2.2 success criterion 2.4.7 (Focus Visible, Level AA) requires that keyboard focus can be seen.
For performance, web.dev rates Interaction to Next Paint as good at 200 milliseconds or less and poor above 500, and Cumulative Layout Shift as good at 0.1 or less and poor above 0.25. Images or videos with no declared dimensions are a common cause of layout shift. You do not need to recite thresholds, but you do need to say how you would measure the problem before changing code.
Follow-ups to expect after the first answer
After the dropdown question, interviewers often ask what changes with 2,000 options and type-ahead. After a slow-dashboard answer, they ask how you would prove the fix worked. After a layout-shift answer, expect a question about web fonts that load late. After a story about a bug only some users saw, expect "what would you add so you find the next one sooner?"
Interviews at this level also reuse plain JavaScript and CSS: closures and event-loop ordering, why a selector with higher specificity wins, and how to show a form validation error so a screen reader announces it. If you would rather rehearse in a language other than English, the languages page lists what is supported.
10 frontend developer interview questions and model answers
1. How do you make a custom dropdown usable with a keyboard and a screen reader?
Technical. What they are testing: Accessibility as a requirement, not a polish pass.
I use a button that toggles a listbox, move focus with arrow keys, and close on Escape. The button exposes expanded state and the listbox exposes the selected option. I test it with the keyboard only before I look at the visual design.
2. A page is slow only after a user opens a heavy dashboard. Where do you look?
Technical. What they are testing: Performance diagnosis.
I record a profile and look for a long task during the interaction, not during first load. Common causes are rendering a large list without windowing, or fetching everything when one chart is visible. I would virtualize the list or split the chart bundle before I rewrite the page.
3. When should component state live in a URL instead of memory?
Technical. What they are testing: State ownership.
If a user should share or refresh the view, the filter, tab, or selected id belongs in the URL. Memory is fine for a hover, a draft that is not saved, or a modal that should not become a bookmark. I say which state is which before I add a store.
4. How do you prevent a layout shift when an image loads?
Technical. What they are testing: CLS and reserved space.
I set width and height, or an aspect-ratio box, so the slot exists before the bytes arrive. For late content I reserve the same space the loaded block will use. I do not fix a jump by animating it after the fact.
5. How do you work with a design that cannot be built as drawn?
Domain. What they are testing: Cross-functional honesty.
I show the constraint in the browser: a wrapping label, a missing focus state, or a breakpoint that collides. I propose the closest pattern we already use, and I ask the designer which part is the requirement. I do not silently ship a different component.
6. Tell me about a UI bug that only some users could reproduce.
Behavioral. What they are testing: Debugging with incomplete reports.
I asked for the browser, the viewport, and the steps, then reproduced it on that combination. It was a flex overflow that only appeared with a long translated string. The fix was a min-width of zero and a test fixture with a long label.
7. Design asks for a new pattern that duplicates one we have. What do you do?
Situational. What they are testing: Design-system judgment.
I put both on one page and name the difference a user would notice. If there is no difference, I ask to use the existing component and file the visual tweak as a variant. A second pattern is worth it only when the interaction is actually different.
8. How do you test a component that depends on time or the network?
Technical. What they are testing: Test design.
I inject the clock and the fetch function. Tests cover success, empty, error, and a slow response that must show a pending state. I do not assert on implementation details like a particular hook name.
9. Describe a time you cut scope to hit a release.
Behavioral. What they are testing: Shipping judgment.
I listed the screens in the critical path and moved the settings page to the next release. I wrote down what a user could not do yet, and I confirmed support had that sentence. The release notes matched the build.
10. What is your approach to CSS that has grown hard to change?
Domain. What they are testing: Maintainability.
I stop adding exceptions and name the layout rule that is being broken. Then I delete one override at a time with a visual check. A rewrite of the whole stylesheet is the last option, and only behind a page I can compare.
Frequently asked questions
Do frontend interviews still include coding algorithms?
Many do, especially at larger companies. Product companies often replace one algorithm round with a UI exercise. Prepare both, and lead with the exercise if the posting shows Figma or accessibility in the requirements.
How detailed should visual answers be?
Name the user-visible states and the keyboard path. Pixel values matter less than what happens when the text is long, the request fails, or the user never touches a mouse.
Should I memorize framework APIs?
Know the ones you claim on your resume well enough to use them without notes. Interviewers forgive a method name. They do not forgive a component with no error state.
Where do I practice the spoken part?
Run a frontend mock on VirtualInterview.ai and answer by voice. The interviewer can follow up on the state or accessibility choice you just named.
Keep practicing
- Software Engineer mock interview
- Full-Stack Developer mock interview
- UX Designer mock interview
- Mobile Developer mock interview
- Technical interview practice
- How AI mock interviews work
- Mock interviews for students
- Free AI mock interview (2 interviews a month, free account, no card)
- AI mock interview tools compared
- Questions every round asks, with worked answers
- Practice in another language
- All role mock interviews