· 14 questions · Questions from the MiraiHire question bank; tips written by the MiraiHire team.
Technical questions
What is the difference between let, const and var in JavaScript?
FoundationalWhat the interviewer is looking for: Cover scope (block vs function), hoisting and reassignment, then say which you use by default and why.
Explain how the JavaScript event loop handles promises and timers.
AppliedWhat 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).
How would you find and fix a memory leak in a long-running JavaScript application?
AdvancedWhat 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.
What problems does TypeScript solve compared with plain JavaScript?
FoundationalWhat 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.
When would you use a union type, and how do you narrow it safely?
AppliedWhat 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.
How would you type a function that returns different shapes depending on its input?
AdvancedWhat the interviewer is looking for: Compare overloads, generics with conditional types and a discriminated union, and say which keeps call sites simplest.
What are props and state in React, and how do they differ?
FoundationalWhat 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.
How do you avoid unnecessary re-renders in a React component tree?
AppliedWhat the interviewer is looking for: Start with measuring (React Profiler), then explain lifting state correctly, memo, useMemo/useCallback, and splitting context.
How would you structure data fetching and caching in a large React application?
AdvancedWhat 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.
What is the difference between REST and GraphQL?
FoundationalWhat 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.
What makes a good unit test?
FoundationalWhat the interviewer is looking for: Fast, independent, one clear behaviour per test, readable names, and it fails for the right reason.
Behavioural questions
Tell me about a project you are proud of. What was your part in it?
FoundationalWhat the interviewer is looking for: Use STAR and focus on your own actions with "I", then the result with a number if you can.
Describe a disagreement with a teammate and how you resolved it.
AppliedWhat 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
How would you explain a technical problem to a non-technical stakeholder?
FoundationalWhat 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