Prepare for front end developer interview questions by practising a clear explanation, a small example, and the trade-off behind each decision. Focus on HTML, CSS, JavaScript, your role's framework, and the behaviour of a real interface when requests fail or users need keyboard access. Use the questions below to rehearse aloud, then build the product-search exercise to check whether your explanations survive implementation.
Which topics should you prioritise for your interview?
Read the job description and ask what the technical round involves before you choose a study plan. A component-building session needs different practice from a JavaScript problem-solving round or a frontend architecture discussion. Confirm the language, framework, available tools, and whether you'll work in an existing repository.
For a junior role, prioritise correct HTML, layout, JavaScript fundamentals, and a working component you can explain. For a mid-level role, add request handling, testing, state ownership, and debugging. For a senior role, prepare the same fundamentals plus boundaries between teams, migration choices, observability, and the cost of maintaining your decisions. These are preparation priorities, rather than predictions about a particular employer.
In your answers, connect a definition to a decision: what it means, where you used it, and what would change your choice. If you haven't used something in production, say so and work through a smaller example. An invented performance improvement can collapse as soon as someone asks how you measured it.
How do you explain HTML semantics and accessible controls?
HTML defines the document's structure, CSS controls presentation, and JavaScript adds behaviour. Semantic HTML makes the structure meaningful: headings organise content, a link navigates somewhere, and a button performs an action. Choose the element for its job before styling it.
For example, a product filter toggle should normally start with a button rather than a clickable div. Explain its accessible name, keyboard operation, and visible focus state. A form field needs an associated label; placeholder text alone leaves users without a persistent label. Image alternatives depend on the image's purpose, with decorative images usually receiving an empty alt value.
Expect the follow-up, 'Would adding ARIA fix the div?' Explain that a role alone doesn't supply keyboard behaviour or focus handling. Native controls give you a stronger starting point, though you still need to test the complete interaction. MDN's HTML accessibility guide is useful for checking those native behaviours before rehearsal.
How would you fix a layout that breaks on smaller screens?

Start with the box model: content, padding, border, and margin determine the space an element occupies. With border-box sizing, the declared width includes padding and borders. Inspect the element that's causing overflow before adding another breakpoint.
Use flexbox for arranging items along a main axis, such as a toolbar, and grid when relationships across rows and columns matter, such as a results gallery. Neither rule is absolute; describe the actual alignment requirement. A responsive layout adjusts to available space, while an adaptive approach commonly switches between more distinct layouts.
Consider a long product name pushing a filter panel off screen. Check minimum sizing, wrapping, fixed widths, and the parent layout. During practice, sketch the same result cards on narrow and wide paper to explain how their arrangement changes. Test narrow widths, enlarged text, and long content rather than only a few familiar device sizes. If asked about positioning, explain normal flow first: relative offsets preserve the original space, absolute positioning removes the element from that flow, and sticky positioning depends on its scroll context.
How do CSS specificity and maintainable styling fit together?
Specificity helps decide which declaration wins when otherwise comparable rules compete, but it operates within the wider cascade. Origin, importance, cascade layers, and order can also matter. Avoid claiming that the selector with the most classes always wins.
A useful answer is: 'I'd inspect the computed style and competing declarations, then reduce the conflict at its source. I'd prefer a component class over adding another ID or an important override.' Explain how scoped styles, predictable naming, or agreed component variants keep changes local.
For units, distinguish a root-font-relative rem from em, whose reference depends on the property. Percentages also depend on their property's reference, so 'relative to the parent' is too vague as a universal definition. If a design needs to support larger text, show how your spacing and layout respond rather than promising that one unit solves accessibility.
What do scope, closures, and this explain about JavaScript?
The useful distinction between var and let is function scope versus block scope. Const also has block scope and prevents reassignment of the binding; it doesn't freeze an object. Let and const cannot be accessed before their declarations have been initialised.
A closure lets a function retain access to its surrounding lexical environment. Imagine a function that creates a search handler and remembers a request counter. Each later call can use that counter without making it global. The follow-up is whether the closure is holding the value you expect, especially inside delayed callbacks.
For an ordinary function, this depends on how it is called; an arrow function captures this from its surrounding context. Explain why passing a method as a callback can lose the intended receiver and how binding or a wrapper can preserve it. Add that strict equality avoids coercion during comparison, and modules let you expose explicit dependencies instead of adding everything to global scope.
How do promises and the event loop affect a UI?
A promise represents a future outcome, and async/await gives you a way to express promise-based control flow. Awaiting a promise doesn't turn a long synchronous calculation into background work. If you block the main thread with that calculation, clicks and rendering can still suffer.
For a small browser example, describe a synchronous log, a resolved promise callback, and a zero-delay timer scheduled in the same task. The synchronous work completes first, then the promise callback runs before the timer callback. Explain the call stack and microtasks rather than saying that a zero delay means immediate execution. MDN's execution model provides the underlying terminology.
Connect this to a search UI: the user can type a new query while an earlier request is pending, and those requests may finish out of order. Debouncing limits request frequency, but it doesn't establish which result is current. You need an explicit stale-response strategy as well.
When would you use event delegation?
Event delegation attaches a listener to a shared ancestor and uses information about the originating element to decide what happened. It can simplify a changing list of similar controls instead of attaching separate listeners to each one.
Explain the difference between target, where the event originated, and currentTarget, where the current listener is attached. If a button contains an icon, checking only whether the target itself is a button can miss the click. Finding the nearest matching control can help, followed by a check that it belongs to the intended container.
The follow-up is whether every event behaves this way. Don't assume every event bubbles, and don't remove native button behaviour just to demonstrate delegation. In a framework, start with its normal event model and introduce manual listeners only when the interaction calls for them.
How do you choose state boundaries and framework features?
Keep state close to the components that need to change it. A text field's draft value can stay local; a selected item shared by siblings may belong in their common parent. Server data has separate concerns such as freshness, caching, and invalidation, so it shouldn't automatically become permanent global UI state.
In React, props carry inputs from a parent, while state records information a component owns across renders. Treat both as immutable snapshots. A controlled input receives its value from state and reports changes through a handler; an uncontrolled input keeps its current value in the DOM. Stable keys help preserve item identity when lists change. The virtual DOM describes React's render representation, rather than a promise that every React page is fast.
Explain hooks through a real need, such as local state or synchronising an external subscription. If the role uses Angular, prepare inputs and outputs, dependency injection, template-driven versus reactive forms, routing, and lifecycle cleanup. For Vue, rehearse reactive state, component communication, and cleanup. Study the framework in the invitation instead of giving shallow answers about all three.
When is an Effect appropriate in React?
An Effect is appropriate when a component needs to synchronise with something outside React, such as a subscription or browser API. A filtered list that can be calculated from current props and state usually doesn't need an Effect plus another state variable. React's guidance on unnecessary Effects makes that distinction explicit.
For example, calculate visible products during rendering from the current products and filter. If that calculation becomes measurably expensive, consider whether memoisation is useful. Don't add it automatically.
For an external subscription, describe dependencies and cleanup together. An interviewer may ask what happens when the selected item changes quickly or the component unmounts. Explain how you'll avoid leaving an old subscription active. For data fetching, acknowledge that a framework's data-loading mechanism may handle concerns better than an ad hoc Effect.
How would you investigate a slow or broken interface?
Separate slow loading from slow interaction. A large initial download, a slow endpoint, expensive JavaScript, and repeated rendering are different problems. Begin with a reproducible user action, inspect network and performance evidence, and change one suspected cause at a time.
For a slow product list, ask whether the delay occurs before data arrives or while rendering results. Depending on the evidence, you might reduce transferred code, defer a nonessential feature, paginate data, optimise images, or render fewer rows. Memoising every callback without a measured problem adds complexity without proving improvement.
For a browser-specific defect, reproduce it in the affected browser, inspect supported features and computed styles, and reduce the failing case. Explain progressive enhancement and a fallback where appropriate. For algorithmic questions, practise array transformations, deduplication, and their time and space costs, then relate that reasoning to actual UI data sizes.
How should a frontend handle API errors and slow responses?
Model loading, success, empty, and error states explicitly. An empty result is a successful response with nothing to show; a failed request needs a different message and recovery action. Preserve user input so retrying doesn't require reconstructing the whole interaction.
For a rapidly changing search query, cancel obsolete work when possible and check that a response still belongs to the latest request before displaying it. Cancellation alone doesn't replace reasoning about stale results. Also distinguish network failure, an unsuccessful HTTP response, and data that doesn't match the expected structure.
If asked about REST versus GraphQL, explain how the client requests resources versus a specified data shape, then discuss caching, error handling, and backend support for this application. Neither approach removes the need for loading states or validation. Don't invent an API contract; ask which behaviours the server guarantees.
How would you test a product-search component?
Start with behaviour the user can observe. A user enters a query, sees relevant results, encounters an empty response, or retries after failure. Test those transitions and the keyboard path through the controls. A component that passes a snapshot test can still be unusable.
Use focused unit tests for isolated transformation logic, integration tests for component behaviour across request states, and a small set of end-to-end tests for important complete journeys. Explain what each test protects and what it costs to maintain.
Include the race case: request A starts, request B starts, B succeeds, then A succeeds. The screen should continue to represent B. For accessibility, combine automated checks with keyboard testing and appropriate assistive-technology review. A passing automated scan doesn't prove the whole experience works for everyone.
Can you work through a realistic frontend coding exercise?

Use this practice task: build a product-search page with a labelled search field, a results grid, and a retry control. Ask a friend to act as the interviewer and change one requirement after your first working version. These are practice constraints, rather than a reported employer question.
Before coding, ask whether search is submitted or live, whether results are paginated, and what should happen when the query is empty. For the exercise, agree on live search with a short debounce, no pagination, and an empty query that clears results. Sketch the mobile and wide layouts on paper before choosing grid columns.
Keep the current query, request status, result data, and error information distinct. Start with a working request and readable result cards. Add debouncing, a latest-request identifier, and cancellation where supported. Render only the response associated with the current request, and ensure that clearing the input also invalidates pending results.
Use these acceptance checks during your rehearsal:
- The search field has a persistent label and an obvious keyboard focus state.
- Slow, empty, failed, and successful requests produce different, understandable states.
- An older response cannot overwrite the newest query's results or loading state.
- Long names and enlarged text fit the narrow layout without hiding controls.
- Retry preserves the query, and clearing it prevents old results from returning.
If time runs short, explain which behaviour you would implement next and why. A correct small version gives the interviewer something concrete to discuss. Our live coding interview guide helps you practise the explanation and recovery around that implementation.
How do you discuss projects, design feedback, and architecture?
Choose one real project and prepare the user problem, your responsibility, the decision you made, the alternative you rejected, and the evidence you had afterward. If you didn't measure an outcome, describe what you observed and what you would measure next. Keep confidential details out of your example.
When a design arrives, ask about responsive behaviour, interaction states, accessibility, and reusable components before treating it as a finished specification. If you disagree with a designer, show the failing interaction or constraint and offer a workable alternative. Explain how you involved product or backend colleagues when the decision crossed team boundaries.
For senior architecture questions, define rendering requirements, state ownership, API boundaries, deployment constraints, and failure recovery before naming libraries. Explain how you'd introduce a change incrementally and observe its effect. Our pair programming interview advice is useful when the interviewer wants to collaborate on those decisions rather than watch silently.
How can you rehearse these answers in 45 minutes?

Spend ten minutes explaining three fundamentals without notes, twenty minutes building the product-search exercise, ten minutes handling a changed requirement, and five minutes reviewing the recording or your paper scorecard. This is a suggested practice session, so shorten the scope if it prevents you from finishing a working version.
Score correctness, explanation, failure handling, and verification from zero to two each: zero means missing, one means prompted or incomplete, and two means clear and independently demonstrated. Use the lowest category to choose your next drill rather than treating the total as a hiring prediction. Repeat the weakest answer using a different example.
If you use Hiintly to surface suggestions during a spoken rehearsal, close the suggestions afterward and explain the same decision independently. Its free 10-minute session becomes available again after a 5-minute cooldown, so a short explanation drill can fit between coding sessions. Follow the employer's rules for any tools in an actual assessment.
Finish by preparing questions about how the team reviews frontend changes, tests accessibility, and handles production UI failures. The guide to questions to ask the interviewer can help you turn those answers into a clearer picture of the work. Your next practice session should address one observed weakness, with a fresh example that shows whether you fixed it.
Frequently Asked Questions
- What should a junior frontend developer practise first?
- Start with semantic HTML, responsive CSS, JavaScript scope and asynchronous behaviour, then build one small component with loading, empty, and error states. Explain each choice aloud.
- Do I need to know React, Angular, and Vue for the same interview?
- Use the job description and invitation to identify the expected framework. Build depth in that framework while keeping HTML, CSS, and JavaScript fundamentals strong.
- How should I answer when I do not know a frontend concept?
- State what you do know, ask a clarifying question, and reason through a small example. Say how you would verify uncertain behaviour rather than presenting a guess as a fact.
- Are frontend interviews only about coding?
- The format varies by employer. Ask whether the round covers implementation, debugging, architecture, or project discussion, and prepare for collaboration as well as technical explanations.
- How can I practise request race conditions?
- Simulate two searches and make the earlier request finish last. Verify that results and loading state still correspond to the newest query, including after the field is cleared.
- Can I use AI during a frontend interview?
- Check the employer’s assessment rules before using any assistant. For practice, use suggestions to identify gaps, then repeat your answer and coding exercise without help.

aa.png)


