Interview questions
Frontend developer interview questions for freshers
Fresher frontend interviews test three layers: JavaScript fundamentals (the biggest filter), a framework — almost always React — and enough CSS to prove you can build what a designer hands you. Portfolio projects carry more weight here than in most other roles.
The trap is that frontend knowledge is easy to half-know. You've used useEffect fifty times, but can you explain when it runs? These questions target exactly that gap between using and understanding.
Question 1
Explain the difference between let, const, and var.
The standard JavaScript opener. Cover block versus function scoping and hoisting, and say when you'd use each (default to const). A code-snippet follow-up about var in a loop is common — be ready to trace it.
Question 2
What is a closure, and where have you actually used one?
The definition is table stakes; the second half is the real question. A debounced search input or an event handler capturing a variable are honest, everyday examples from your own code.
Question 3
Explain event delegation.
One listener on a parent handling events that bubble up from children. Explain why it matters — dynamic lists, memory — and you've shown you understand the event model rather than memorizing an API.
Question 4
What does useEffect do, and when does it run?
The React filter question. Cover the dependency array's three cases (none, empty, values) and cleanup functions. Mentioning a bug you personally caused with a wrong dependency array is oddly persuasive — it proves real use.
Question 5
What is the virtual DOM, and why does React use one?
Explain the idea — diff a lightweight copy, batch minimal real-DOM updates — without overselling it as "fast." Saying that direct DOM manipulation is expensive and React minimizes it is the honest, accurate version.
Question 6
How would you center a div?
Yes, it's a meme, and yes, it's still asked. Give flexbox in one breath, grid with place-items as the alternative, and you're done. Fumbling this one costs more than it should.
Question 7
Explain the CSS box model.
Content, padding, border, margin — then earn the point by explaining box-sizing: border-box and why nearly every codebase sets it globally. That one detail separates reading from building.
Question 8
What's the difference between == and ===?
Loose equality coerces types; strict doesn't. Give a dangerous example ('0' == 0 is true) and state the rule you follow — always === — so it's clear this is practice, not trivia.
Question 9
How do you make a website responsive?
More than "media queries": mobile-first flow, flexible units, flexbox and grid, responsive images. Describing how you actually tested a project at 360px is worth more than listing techniques.
Question 10
Walk me through a frontend project in your portfolio.
Expect this early and prepare it like a demo: what it does, one interesting technical decision, one thing that broke and how you fixed it. "I followed a tutorial" ends the conversation; "I extended it by…" restarts it.
Common questions
Do I need to know React for a fresher frontend job?
In most markets, effectively yes — the majority of fresher frontend postings list React. Vue or Angular experience transfers conceptually, but React fluency is the safest interview bet.
Are frontend freshers asked data structures too?
Often, but lighter than backend roles: arrays, strings, maybe a two-pointer problem — usually in JavaScript. Fundamentals plus framework questions still dominate the round.
How much CSS do I actually need?
Enough to build a layout from a mockup without a fight: flexbox, grid, positioning, the box model, responsive patterns. You don't need arcane selectors; you need to never be stuck on centering.