Frontend comparisons, settled
The “what's the difference between…” questions that come up in every frontend interview — answered properly, with runnable code and what the interviewer is actually testing.
27 free articles · no signup
Recommended
Complete Frontend Kit
Every topic on this page, plus 200+ interview questions with detailed answers, coding challenges and a revision sheet.
== vs === : Loose vs Strict Equality
=== compares without conversion; == coerces first, following rules worth knowing. The classic surprises explained, plus the one place == is correct.
JSRead →call vs apply vs bind in JavaScript
call and apply invoke now, bind returns a new function. Plus what interviewers test: why bind can't be undone and why arrow functions ignore all three.
JSRead →Class vs Functional Components in React
Hooks replaced classes. The lifecycle-to-useEffect mapping, the `this` problem, and the one thing class components are still required for.
ReactRead →Context API vs Redux
Context delivers a value down the tree; Redux manages state. The re-render problem that makes context a poor store — and when you truly need Redux.
ReactRead →Controlled vs Uncontrolled Components in React
Controlled vs uncontrolled components in React: who owns the input value, when to use each, the two warnings everyone hits, and why file inputs differ.
ReactRead →CSR vs SSR vs SSG: Rendering Strategies
Where your HTML is built decides first paint, SEO and cost. CSR, SSR, SSG and ISR compared on the metrics that matter, with the Next.js mapping.
CoreRead →Debounce vs Throttle in JavaScript
Debounce waits for the burst to stop; throttle runs at a fixed maximum rate. Both implemented from scratch, plus the React hook trap that breaks them.
JSRead →em vs rem in CSS
em is relative to the element's own font size and compounds when nested; rem is always root-relative. Which to use for text, padding and breakpoints.
CoreRead →Flexbox vs CSS Grid
Flexbox lays out one axis and sizes from content; Grid defines two axes up front. The property mapping, auto-fit vs auto-fill, and the overflow trap.
CoreRead →inline vs block vs inline-block in CSS
block fills the width, inline ignores width and vertical margin, inline-block does both. Plus the vertical-padding overflow and the mystery 4px gap fix.
CoreRead →localStorage vs sessionStorage vs Cookies
localStorage persists, sessionStorage dies with the tab, cookies go to the server on every request. Sizes, expiry, and where an auth token really belongs.
JSRead →map vs forEach in JavaScript
map returns a new array, forEach returns undefined. Plus what interviewers really ask: why you can't break out of either, and why async forEach won't wait.
JSRead →null vs undefined in JavaScript
undefined means a value was never assigned; null means you assigned emptiness. Why typeof null is "object", and when == null is the right check.
JSRead →Promise.all vs Promise.allSettled
Promise.all rejects on the first failure; Promise.allSettled always resolves with every outcome. The result shapes, when to use each, and race vs any.
JSRead →Props vs State in React
Props come from the parent and are read-only; state is owned by the component and changing it re-renders. Plus lifting state up and the derived-state trap.
ReactRead →React Query vs Redux
They solve different problems: React Query caches server data, Redux stores client state. Why most apps need far less Redux than they think.
ReactRead →REST vs GraphQL for Frontend Developers
REST gives you resources and free HTTP caching; GraphQL gives you exactly the fields you ask for. Over-fetching, N+1, caching, and when each wins.
CoreRead →Shallow Copy vs Deep Copy in JavaScript
A shallow copy duplicates the top level and shares everything nested; a deep copy duplicates all of it. structuredClone, the JSON trap, and the React bug.
JSRead →slice vs splice in JavaScript
slice copies and returns a new array; splice mutates the original and returns what it removed. Negative indexes, argument traps, and why React needs slice.
JSRead →Spread vs Rest Operator in JavaScript
Spread and rest both use ... but do opposite things. The position rule that tells them apart, the shallow-copy trap, and rest params vs arguments.
JSRead →TypeScript vs JavaScript
TypeScript is JavaScript plus a compile-time type checker that disappears at runtime. What it catches, what it costs, and whether to learn it first.
CoreRead →useEffect vs useLayoutEffect
useEffect runs after the browser paints; useLayoutEffect runs before it, blocking the screen. The flicker it fixes, the SSR warning, and when to switch.
ReactRead →useMemo vs React.memo
useMemo caches a value inside a component; React.memo skips a component's re-render. Why memo usually does nothing, and how the two work together.
ReactRead →useMemo vs useCallback: What's the Difference?
useMemo caches a value, useCallback caches a function — and useCallback is literally useMemo under the hood. When each actually helps, with runnable code.
ReactRead →useRef vs useState in React
useState re-renders when it changes, useRef doesn't. Which to use for timers, DOM nodes, previous values and the stale closure bug that catches everyone.
ReactRead →useState vs useReducer in React
useState for independent values, useReducer when several fields change together. The signals to switch, impossible states, and why dispatch is stable.
ReactRead →var vs let vs const in JavaScript
Scope, hoisting, the temporal dead zone and reassignment, with the loop-closure classic and why const objects are still mutable. Interview-ready.
JSRead →
Going for a senior role
Targeting a ₹10L+ frontend role?
These comparisons cover the round where they check whether you actually understand the thing you use every day. The Complete Frontend Kit covers everything on either side of it — the questions that follow, the machine-coding round, and the system-design conversation that decides the band you land in.
- JavaScript, React, TypeScript, CSS and system design in one place
- Model answers written the way a panel wants to hear them
- Machine-coding problems with worked solutions
- A revision sheet for the morning of the interview
- One-time payment · lifetime access · free updates
Complete Frontend Kit
200+ questions · all topics
