Frontend School
FAANG PrepQuestionsPricingSuccess StoriesCommunitySupport
FAANG PrepQuestionsPricingSuccess StoriesCommunitySupport
Frontend School

AI Frontend Interview Simulator for FAANG and product companies.

Support: admin@frontendschool.in

Resources

FAANG Prep GuideInterview QuestionsSuccess Stories

Practice

React Interview QuestionsJavaScript Interview QuestionsMachine Coding RoundFrontend System Design

Product

ProblemsLearnCompaniesTopicsBuy CreditsReferral Program
CommunityPrivacyTermsRefund PolicySupport
  1. Home
  2. Frontend Interview Questions

Interview Questions

Frontend Interview Questions

Realistic question sets for JavaScript, React, and frontend system design. In the simulator, your answers are evaluated with AI scoring and converted into personalized prep plans.

Practice in the SimulatorBuy Credits

Pick the range closest to your experience

0–2 years3–5 years6+ years

Frontend interview questions for 0–2 years of experience

Recommended for you

At this level interviewers check fundamentals and whether you can explain them plainly. Expect JavaScript basics, core CSS, one framework, and a small UI to build.

What is the difference between var, let and const?

var is function-scoped and is hoisted with the value undefined. let and const are block-scoped and sit in the temporal dead zone until their declaration runs, so reading them early throws. const stops reassignment, not mutation: you can still push to a const array. Default to const and reach for let only when you must reassign.

JavaScript course →

What is a closure, and where do you use one?

A closure is a function that keeps access to the variables of the scope where it was created, even after that scope has returned. It is how you get private state, memoization, and wrappers like debounce or once. The classic bug is a var loop with setTimeout, where every callback sees the final value of the loop variable.

JavaScript course →

Explain the CSS box model and box-sizing: border-box.

Every element is a box made of content, padding, border and margin. With the default content-box, width covers only the content, so adding padding makes the element wider than you wrote. With border-box, width includes padding and border, which keeps layouts predictable. Most resets apply it to every element.

CSS layouts course →

When does a React component re-render?

When its own state changes, when its parent re-renders, or when a context value it reads changes. A re-render is not a DOM update: React compares the new output with the old and commits only the differences. Props being unchanged does not stop a child re-rendering unless it is wrapped in React.memo.

React course →

What is the key prop for in a list?

Keys let React match items between renders. Use a stable, unique id. An array index is fine for a static list, but if items can be reordered, inserted or removed, index keys attach component state to the wrong item.

React course →

How does async/await work, and how do you handle errors?

async/await is syntax over promises. await pauses that function, not the thread, and the rest of the program keeps running. Wrap awaited calls in try/catch, and remember that Promise.all rejects as soon as one promise rejects, while Promise.allSettled waits for all of them.

JavaScript course →

Frontend interview questions for 3–5 years of experience

Recommended for you

Here the questions move from definitions to judgment: why something breaks, how you would measure it, and how you would build a real component. Machine coding rounds expect clean, working code with edge cases handled.

Walk me through the JavaScript event loop.

The call stack runs synchronous code. When it is empty, the loop drains the whole microtask queue (promise callbacks, queueMicrotask), then takes one macrotask (setTimeout, I/O, UI events), and the browser may render between tasks. That is why a promise's then callback runs before setTimeout with a 0 delay.

JavaScript course →

useEffect vs useLayoutEffect, and the common useEffect bugs.

useEffect runs after the browser has painted. useLayoutEffect runs after DOM changes but before paint, which is the place to measure layout without a flicker. The usual bugs are missing dependencies (stale closures), no cleanup (leaks, or a slow earlier fetch overwriting a newer one), and using an effect to compute something you could derive during render.

React course →

How do you prevent unnecessary re-renders?

Measure first with the React Profiler. Then keep state close to where it is used, split components so a change touches less, and use React.memo for expensive pure children. useMemo and useCallback help only when they keep a reference stable for a memoized child or skip a genuinely expensive computation. Virtualize long lists.

React course →

What is the difference between debounce and throttle?

Debounce waits until calls stop for N milliseconds, which suits a search input. Throttle lets a call through at most once every N milliseconds, which suits scroll and resize handlers. Be ready to write debounce from scratch: it is a closure holding a timer id that you clear and reset on each call.

Machine coding practice →

How do you improve Core Web Vitals: LCP, INP and CLS?

For LCP, make the main image or heading arrive sooner: size and preload the hero image, render on the server, and use a CDN. For INP, break up long tasks, defer non-critical JavaScript and keep event handlers light. For CLS, reserve space for images, ads and embeds with width and height or aspect-ratio, and do not insert content above what the user is reading.

Web performance course →

Design a typeahead (autocomplete) component.

Debounce the input, cancel stale requests with AbortController or ignore out-of-order responses, and cache results by query. Support keyboard navigation with the combobox ARIA pattern, and handle loading, empty and error states. Highlight the matched text and close the list on Escape or outside click.

Machine coding practice →

Senior frontend interview questions (6+ years)

Recommended for you

Senior rounds test architecture, trade-offs and leadership. Interviewers want your reasoning out loud: what you would choose, what it costs, and how you would know it worked.

How would you manage state in a large application?

Separate server state from UI state. Use a data-fetching cache such as React Query or SWR for server data (deduping, revalidation, retries), keep UI state local by default, and lift it only when components truly share it. Put shareable state such as filters in the URL, and keep any global store small. One store for everything is the usual mistake.

Frontend system design →

Design a news feed with infinite scroll.

Use cursor-based pagination and an IntersectionObserver sentinel to load the next page. Virtualize the list so the DOM stays small, dedupe items when a refetch overlaps, show skeletons while loading, restore scroll position on back navigation, and offer a Load more button as an accessible fallback. Cover optimistic updates for likes and retry on failure.

Frontend system design →

How do you decide what to split and lazy-load?

Start with route-level splitting, then lazy-load heavy components that are not needed on first paint: editors, charts, modals. Preload on intent, for example on hover. Check the result with a bundle analyzer and watch for request waterfalls, since splitting can make loading slower if chunks load one after another.

Web performance course →

When are micro-frontends worth it?

When several teams must ship independently at a scale where a single deploy is the bottleneck. The costs are duplicated dependencies, inconsistent UX, runtime integration complexity and slower pages. Often a monorepo with clear module boundaries gives most of the benefit with far less overhead.

System design course →

How do you secure a single-page app?

Escape output by default (React does this for text; be careful with dangerouslySetInnerHTML and sanitize any HTML you must render), set a Content Security Policy, and keep session tokens in httpOnly, SameSite cookies instead of localStorage. If you use cookie auth, add CSRF protection. Audit third-party scripts and dependencies.

Frontend system design →

Tell me about a technical decision you led.

Use the STAR structure. At senior level the story should show that you framed the options, brought people along, weighed trade-offs, handled disagreement, and measured the result afterwards. Name what you would do differently.

Behavioral interview course →

Practice Real Interview Problems

Solve problems from our library in a live IDE with AI evaluation and rubric-based feedback.

How answer evaluation works

AI-powered scoring

Every answer is evaluated against a structured rubric with depth, clarity, and correctness scores.

Targeted prep modules

Weak answers automatically generate focused practice rounds for the exact skill gap.

Interview-realistic format

Questions are framed like real panels — not trivia. You're expected to reason out loud.

Go deeper by topic

  • React interview questions
  • JavaScript interview questions
  • Machine coding round
  • Frontend system design
  • FAANG frontend prep
  • Company-wise questions
  • Questions by topic

Frequently asked questions

What are the most common frontend interview questions?
The most common frontend interview questions cover JavaScript fundamentals (event loop, closures, async/await, prototypes), React (hooks, reconciliation, performance), CSS and layout (flexbox, grid, specificity), machine coding (build a UI component), frontend system design (autocomplete, infinite scroll, a video player) and behavioral questions.
Are these the exact questions asked in real interviews?
No. They are representative of the topics and patterns interviewers use at each level. Exact questions differ by company and change over time, so treat them as patterns to practice, not a list to memorise.
What is a machine coding round in a frontend interview?
A machine coding round is a live session where you build a working UI component or small app from scratch, for example an autocomplete, a Kanban board, a star rating or an infinite scroll list. It tests clean, maintainable code under time pressure. It is common at Indian product companies such as Flipkart, Swiggy, Razorpay and CRED.
How do I prepare for React interview questions?
Focus on hooks (useState, useEffect, useCallback, useMemo, useRef and custom hooks), how re-rendering and reconciliation work, performance (React.memo, lazy loading, code splitting), state management (Context, Redux, Zustand, a data-fetching cache) and component design. Practice by building components from scratch, then get feedback on your code.
What frontend interview questions are asked for 3+ years of experience?
Expect depth in React architecture, performance optimization, TypeScript and a first round of frontend system design, plus behavioral questions about owning features end to end. Machine coding rounds expect production-quality code with error handling and edge cases.
Do frontend interviews include DSA?
It depends on the company. Large product companies often include data structures and algorithms alongside UI work. Many startups and product teams focus on building UI and on JavaScript and React depth. Check the company page for what that company tends to ask.

Free course

Learn frontend interviews, topic by topic

Free courses on JavaScript, React, DSA, system design, CSS and more.

Start learning

Practice with real-time AI feedback

Go beyond reading questions. Get scored on your actual answers and build a structured prep plan from your specific gaps.

Practice in the SimulatorBuy Credits

Practice Real Interview Problems

Solve problems from our library in a live IDE with AI evaluation and rubric-based feedback.

hardDSA

Project Task Prioritization

GraphTopological SortPriority Queue
X (Twitter)
Solve this problem →
mediumMachine Coding

Interactive Star Rating Component

Star RatingUI ComponentsReact
Zoho
Solve this problem →
hardSystem Design

Frontend System Design: Real-time Flash Sale Reservation

BookingReservationFrontend System Design
General
Solve this problem →
easyTheory

Enhancing User Experience with Concurrent React and Suspense

ReactFrontendUser Experience
Intuit
Solve this problem →
mediumDSA

Clearance Sale: Maximize Items with 'Buy K-1 Get 1 Free' Offer

GreedySortingArrays
Amazon
Solve this problem →
mediumMachine Coding

Dynamic Project Task Management Table

ReactTypeScriptData Table
Livspace
Solve this problem →
hardSystem Design

Designing a High-Performance Client-Side A/B Testing Framework for Shiprocket

A/B TestingFrontend System DesignExperimentation
Shiprocket
Solve this problem →
mediumTheory

Designing Flexible and Type-Safe Components with TypeScript Generics

TypeScriptGenericsFrontend Architecture
X (Twitter)
Solve this problem →
easyDSA

Count Nodes in BST within Range

TreeBinary Search TreeDFS
upGrad
Solve this problem →
hardMachine Coding

Dynamic Multi-Select Dropdown with Search and Tagging

ReactTypeScriptFrontend
Postman
Solve this problem →
hardSystem Design

Pinterest Global Content Delivery & Internationalization System

internationalizationi18nFrontend System Design
Pinterest
Solve this problem →
mediumTheory

Designing Robust Form State Management for a Swiggy Partner Onboarding Flow

FrontendState ManagementForms
Swiggy
Solve this problem →
easyDSA

API Endpoint Reachability Check

GraphBFSDFS
Postman
Solve this problem →
hardMachine Coding

Building a Robust Notification System: The Intuit Toast Component

FrontendUIReact
Intuit
Solve this problem →
mediumSystem Design

Real-time Collaborative Drawing Canvas

Frontend System DesignWebSocketsReal-time
Razorpay
Solve this problem →
mediumTheory

Real-time Collaboration: Scaling WebSocket-based Presence Indicators

WebSocketsReal-timeSystem Design
Postman
Solve this problem →
easyDSA

Remove Duplicates from Sorted Linked List

Linked ListData Cleaning
Innovaccer
Solve this problem →
hardMachine Coding

Real-time Markdown Editor with Custom Blocks

Rich Text EditingFrontendReact
General
Solve this problem →
mediumSystem Design

Scalable Social Feed with Infinite Scroll

System DesignFrontendSocial Feed
BrowserStack
Solve this problem →
mediumTheory

L4: Achieving Team Binding on Critical Technical Decisions

BehavioralTeamworkConflict Resolution
Livspace
Solve this problem →
hardDSA

Maximum K-Shared Feature Group

Bit ManipulationDynamic ProgrammingAlgorithms
LinkedIn
Solve this problem →
hardMachine Coding

Infinite & Accessible Image Carousel

ReactFrontendUI
General
Solve this problem →
hardSystem Design

Designing a Universal, Performant, and Theming-Enabled Design System Library

FrontendSystem DesignDesign System
Thoughtworks
Solve this problem →
easyTheory

Optimizing Pinterest with Service Workers: Caching and Offline Experience

FrontendWeb PerformanceOffline First
Pinterest
Solve this problem →
View all problems →