TomoLink
Interview Guide

Frontend Developer Interview Questions 2025

HTML, CSS, JavaScript, React & TypeScript questions — everything asked in frontend developer interviews for freshers.

HTML & CSS Interview Questions

Core concepts asked in every frontend developer interview.

Q1

What is the difference between block, inline, and inline-block elements?

Block: takes full width, starts on new line (div, p). Inline: only as wide as content, no new line (span, a). Inline-block: inline positioning but can have width/height (button, img).

Q2

What is the CSS Box Model?

Content → Padding → Border → Margin. box-sizing: border-box includes padding & border within the element's width; content-box (default) does not.

Q3

What is the difference between position: absolute, relative, fixed, sticky?

Relative: offset from its normal position. Absolute: relative to nearest positioned ancestor. Fixed: relative to viewport. Sticky: relative until scroll threshold, then fixed.

Q4

What is Flexbox? How is it different from Grid?

Flexbox: one-dimensional (row or column). Grid: two-dimensional. Use Flexbox for component layouts; use Grid for page/section layouts.

Q5

What is specificity in CSS?

Specificity determines which CSS rule applies. Order: !important > Inline > ID (#) > Class (.) > Element. Equal specificity = last rule wins.

JavaScript Interview Questions

Core JS concepts — asked in virtually every frontend role from startups to FAANG.

JS

What is the difference between var, let, and const?

var: function-scoped, hoisted. let: block-scoped, not hoisted to usable state. const: block-scoped, cannot be reassigned (but object properties can mutate).

JS

What is event delegation?

Attaching one event listener to a parent element instead of multiple children. Uses event bubbling — events bubble up to parent. Efficient for dynamic lists.

JS

What is a closure?

A function that remembers its outer scope even after the outer function has returned. Used in memoization, factory functions, and module patterns.

JS

What is the difference between == and ===?

== does type coercion (1 == '1' is true). === strict equality with no type coercion (1 === '1' is false). Always prefer ===.

JS

What is the Event Loop in JavaScript?

JS is single-threaded. The Event Loop picks tasks from the callback queue and executes them after the call stack is empty. Microtasks (Promises) run before macrotasks (setTimeout).

JS

What is a Promise? How is it different from async/await?

Promise represents a future value — pending, fulfilled, or rejected. async/await is syntactic sugar over Promises — makes async code read like synchronous code.

JS

What is the difference between null and undefined?

undefined: variable declared but not assigned. null: explicitly set to 'no value'. typeof null === 'object' is a JavaScript quirk.

React Interview Questions

React-specific questions for frontend roles requiring React knowledge.

R

What is the Virtual DOM and why does React use it?

A lightweight JS copy of the real DOM. React diffs the virtual DOM before updating the real DOM — making updates faster by minimizing actual DOM operations.

R

What are React hooks? Name the most important ones.

Functions that let you use state and lifecycle in functional components. Key hooks: useState, useEffect, useContext, useRef, useMemo, useCallback, useReducer.

R

What is the difference between useEffect with different dependency arrays?

[] — runs once (mount). [dep1, dep2] — runs when dependencies change. No array — runs after every render. Return cleanup function to clear subscriptions.

R

What is prop drilling and how do you avoid it?

Passing props through many levels. Avoid with: React Context, Redux/Zustand state management, or component composition.

R

What is the difference between useMemo and useCallback?

useMemo: memoizes a computed value. useCallback: memoizes a function reference. Both prevent unnecessary re-renders when passed to child components.

Frontend Interview Tips

Build and deploy projects

Have 2-3 live projects on GitHub Pages or Vercel. Interviewers want to see, not just hear.

Know the browser console

Be comfortable with Network tab, Performance profiling, and Debugging JS in browser DevTools.

Understand accessibility basics

ARIA labels, semantic HTML, keyboard navigation — increasingly asked in frontend interviews.

Performance optimization

Know: lazy loading, code splitting, image optimization, reducing bundle size — asked at product companies.

Follow the Frontend Dev roadmap on TomoLink

Structured HTML → CSS → JS → React learning path with company-specific frontend questions.

Start Frontend Roadmap

Related Guides