Frontend Developer
Interview Questions
19 practice questions across 12 skills — each with what the interviewer is really listening for. Prepare with intent, not guesswork.
Free · No signup · Grouped by skill
How to use this page
Don't memorise answers. For each question, read what the interviewer is looking for, then practise answering out loud in your own words with a real example. The notes describe strong answers and common red flags — they are for your prep, not a script.
JavaScript
3 questionsExplain the difference between == and === in JavaScript. When would loose equality bite you?
BasicWhat the interviewer is looking for: A strong answer covers type coercion with ===, gives a surprising coercion example, and recommends strict equality by default. Not knowing coercion happens with == is a red flag.
What is a closure in JavaScript, and give a practical use for one.
IntermediateWhat the interviewer is looking for: Look for a function retaining access to its lexical scope after the outer function returns, plus a real use like a counter or data privacy. Reciting a definition with no example suggests memorisation over understanding.
Explain the event loop and how async callbacks, promises, and the call stack interact.
AdvancedWhat the interviewer is looking for: Strong candidates describe the call stack, task and microtask queues, and why promises resolve before timers. Believing JavaScript is multi-threaded or ignoring the microtask queue are red flags.
TypeScript
2 questionsWhat problems does TypeScript solve over plain JavaScript, and what are its limits?
IntermediateWhat the interviewer is looking for: Look for compile-time type safety, better tooling and refactoring, and the caveat that types are erased at runtime so it does not validate external data. Claiming it makes runtime bugs impossible is a red flag.
What is the difference between an interface and a type alias in TypeScript?
IntermediateWhat the interviewer is looking for: A good answer notes interfaces are extendable and mergeable while type aliases handle unions and primitives, and that either is fine for object shapes. Insisting one is always correct without nuance is a minor red flag.
React
2 questionsExplain the difference between state and props in React.
BasicWhat the interviewer is looking for: Strong answers explain props are read-only inputs from a parent while state is internal and mutable via setState/hooks. Mutating props or confusing the two is a red flag.
What does the dependency array of useEffect control, and what bugs come from getting it wrong?
AdvancedWhat the interviewer is looking for: Look for understanding that it decides when the effect re-runs, and that missing dependencies cause stale closures while wrong ones cause infinite loops. Not being able to explain stale state is a red flag.
Performance Optimization
1 questionHow do you optimise a React list that re-renders slowly with thousands of items?
AdvancedWhat the interviewer is looking for: Strong candidates mention virtualization, stable keys, memoization, and profiling before optimising. Reaching for memo everywhere without measuring is a red flag.
HTML
1 questionWhy does semantic HTML matter beyond just rendering the page?
BasicWhat the interviewer is looking for: Look for accessibility, SEO, and clearer structure for assistive tech, not just visual output. Using div-for-everything with no awareness of semantics is a red flag.
CSS
2 questionsExplain the CSS box model and how box-sizing: border-box changes it.
BasicWhat the interviewer is looking for: A strong answer covers content, padding, border, and margin, and that border-box includes padding and border in the declared width. Confusing margin and padding is a red flag.
When would you reach for flexbox versus grid in a layout?
IntermediateWhat the interviewer is looking for: Look for flexbox for one-dimensional layouts and grid for two-dimensional ones, with a willingness to combine them. Claiming one fully replaces the other suggests limited layout experience.
Responsive Design
1 questionHow do you make sure a component works well on both mobile and desktop?
BasicWhat the interviewer is looking for: Strong answers describe a mobile-first approach, relative units, breakpoints tied to content, and testing on real viewports. Fixed pixel widths everywhere is a red flag.
REST APIs
1 questionYou need to fetch data from a REST API and show a loading and error state. How do you structure that?
IntermediateWhat the interviewer is looking for: Look for handling the three states (loading, success, error), cancelling stale requests, and not leaving the user staring at a blank screen. Ignoring the error path is a common red flag.
Accessibility
1 questionWhat are common accessibility issues in a typical web app, and how do you catch them?
IntermediateWhat the interviewer is looking for: Strong candidates mention keyboard navigation, focus management, colour contrast, alt text, and ARIA used sparingly, plus tooling like axe. Treating accessibility as optional polish is a red flag.
Git
1 questionYour feature branch has drifted far behind main and now has conflicts. How do you get it up to date safely?
IntermediateWhat the interviewer is looking for: Strong answers describe merging or rebasing main in, resolving conflicts deliberately, and testing before pushing, plus caution about rewriting shared history. Blindly accepting one side of every conflict is a red flag.
Problem-Solving
1 questionHow would you debug a layout that looks correct in Chrome but broken in Safari?
IntermediateWhat the interviewer is looking for: Look for a systematic approach — reproducing, isolating CSS, checking feature support and vendor differences, and using devtools. Guessing random fixes without isolating the cause is a red flag.
Jest
1 questionHow do you approach writing a Jest test for a component with an API call?
IntermediateWhat the interviewer is looking for: A good answer mocks the network layer, tests behaviour and rendered output rather than implementation details, and covers loading/error paths. Testing internal state instead of user-visible behaviour is a red flag.
Behavioural & role-general
2 questionsDescribe a time you had to improve a slow or clunky UI. What did you change and how did you measure it?
BasicWhat the interviewer is looking for: Strong answers identify the bottleneck with data, make a targeted change, and measure the improvement. Vague 'made it faster' claims without measurement are red flags.
How do you keep up with the fast-changing frontend ecosystem without chasing every new framework?
BasicWhat the interviewer is looking for: Look for a balance of fundamentals and pragmatic evaluation of new tools against real needs. Either resisting all change or adopting hype uncritically are both red flags.