Frontend developer interview questions

A frontend developer interview usually tests JavaScript fundamentals, TypeScript, React (state, rendering and data fetching), API basics and testing, plus how you work with designers and explain problems. Expect questions that move from definitions to real performance and architecture decisions. Practise each answer out loud and use STAR for the behavioural ones.

· 14 questions · Questions from the MiraiHire question bank; tips written by the MiraiHire team.

Technical questions

  1. What is the difference between let, const and var in JavaScript?

    Foundational

    What the interviewer is looking for: Cover scope (block vs function), hoisting and reassignment, then say which you use by default and why.

  2. Explain how the JavaScript event loop handles promises and timers.

    Applied

    What the interviewer is looking for: Explain the call stack, the microtask queue (promises) and the task queue (timers), and why a resolved promise runs before setTimeout(0).

  3. How would you find and fix a memory leak in a long-running JavaScript application?

    Advanced

    What the interviewer is looking for: Show a method: reproduce, compare heap snapshots, look for listeners, timers and caches that never release, fix and measure again.

  4. What problems does TypeScript solve compared with plain JavaScript?

    Foundational

    What the interviewer is looking for: Talk about catching errors before runtime, safer refactoring and editor help, and mention the cost: a build step and learning curve.

  5. When would you use a union type, and how do you narrow it safely?

    Applied

    What the interviewer is looking for: Give a real example, then show narrowing with typeof, in, or a discriminant field, and why that is safer than a type assertion.

  6. How would you type a function that returns different shapes depending on its input?

    Advanced

    What the interviewer is looking for: Compare overloads, generics with conditional types and a discriminated union, and say which keeps call sites simplest.

  7. What are props and state in React, and how do they differ?

    Foundational

    What the interviewer is looking for: Props come from the parent and are read-only; state belongs to the component and changes trigger a re-render. A small example helps.

  8. How do you avoid unnecessary re-renders in a React component tree?

    Applied

    What the interviewer is looking for: Start with measuring (React Profiler), then explain lifting state correctly, memo, useMemo/useCallback, and splitting context.

  9. How would you structure data fetching and caching in a large React application?

    Advanced

    What the interviewer is looking for: Discuss a single data layer (for example a query library), cache keys, invalidation, loading and error states, and server rendering.

  10. What is the difference between REST and GraphQL?

    Foundational

    What the interviewer is looking for: REST uses resources and HTTP methods; GraphQL lets the client ask for exactly the fields it needs. Compare caching and complexity.

  11. What makes a good unit test?

    Foundational

    What the interviewer is looking for: Fast, independent, one clear behaviour per test, readable names, and it fails for the right reason.

Behavioural questions

  1. Tell me about a project you are proud of. What was your part in it?

    Foundational

    What the interviewer is looking for: Use STAR and focus on your own actions with "I", then the result with a number if you can.

  2. Describe a disagreement with a teammate and how you resolved it.

    Applied

    What the interviewer is looking for: Stay respectful about the other person, show you understood their view, and end with the outcome and the working relationship.

Answering behavioural questions

Use STAR: the Situation, your Task, the Actions you took and the Result, ideally with a number. Paste your answer into the free STAR checker to see which part is missing.

Check my answer with STAR →

Situational questions

  1. How would you explain a technical problem to a non-technical stakeholder?

    Foundational

    What the interviewer is looking for: Start with the impact on them, use a simple comparison, avoid jargon, and finish with what you need from them.

Practise these questions

MiraiHire gives you interview practice sets from this question bank, by text or voice, with feedback. Free to start.

Start practising free