- The web platform first: semantic HTML, modern CSS layout, and JavaScript to the depth of closures, the event loop and prototypes.
- Then one framework deeply: React with TypeScript is the largest market in India; know rendering, hooks and state management trade-offs.
- What separates mid-level engineers: browser internals, Core Web Vitals, accessibility and testing.
- Frontend system design (component architecture, data flow, caching, performance) becomes a standard round from around SDE-2.
- Interviews mix: JavaScript fundamentals, machine coding, DSA, and design. Prepare all four.
Frontend engineering is often misread as "making things look nice". In practice, a frontend engineer at a product company owns what the user experiences: how fast the page becomes usable on a ₹10,000 Android phone over a patchy 4G connection, whether a screen reader user can complete checkout, whether the UI stays consistent when three API calls return in an unexpected order. That is real engineering, and frontend interviews at good companies test it.
This roadmap covers the frontend path in six stages, from the platform fundamentals to frontend system design, with code you should be able to write and the interview topics each stage unlocks. If you are new to web development in general, start with the broader web development roadmap, which covers backend basics as well.
What Frontend Engineers Actually Do
- Build features in a component framework, from design mockups to production.
- Manage client state and server data: caching, optimistic updates, error and loading states.
- Own performance: bundle size, rendering cost, images, Core Web Vitals.
- Ensure accessibility and internationalization (important in India's multilingual market).
- Maintain design systems and shared component libraries.
- Collaborate on API contracts with backend engineers.
- Debug issues that only happen on a particular browser, device or network.
Stage 1: The Web Platform (HTML and CSS)
Frameworks change every few years; the platform does not. Engineers with strong HTML and CSS are noticeably faster and produce fewer accessibility bugs.
HTML
- Semantic elements and document structure; landmarks (
header,nav,main,footer). - Forms: input types, labels, validation attributes, accessible error messages.
- When to use
buttonvsa(actions vs navigation), and why a clickabledivis a bug. - Meta tags, responsive images (
srcset,sizes), lazy loading.
CSS
- The cascade, specificity, inheritance, and the box model.
- Flexbox and Grid in depth, including
minmax,auto-fitand alignment. - Positioning, stacking contexts and why
z-index: 9999sometimes does nothing. - Responsive design, container queries, custom properties (CSS variables), theming and dark mode.
- Transitions and animations that only animate
transformandopacityfor smoothness. - One approach to scaling CSS: CSS Modules, a utility framework like Tailwind, or CSS-in-JS. Know the trade-offs.
Interview check: centre an element in five ways, explain specificity of #nav .item a, build a responsive card grid without media queries. See HTML and CSS interview questions.
Stage 2: JavaScript Depth
Frontend interviews in India lean very heavily on JavaScript fundamentals. Expect output-prediction questions, polyfill implementations and async puzzles.
| Topic | You should be able to... |
|---|---|
| Scope and closures | Explain the classic var-in-a-loop with setTimeout bug and fix it two ways |
this | Predict this for method calls, detached functions, arrow functions, call/apply/bind |
| Prototypes | Explain the prototype chain and implement inheritance without class |
| Event loop | Order the output of mixed sync code, promises, setTimeout and queueMicrotask |
| Promises | Implement Promise.all, Promise.race, retry with backoff |
| Functional utilities | Write debounce, throttle, memoize, curry, deep clone, flatten |
| DOM and events | Use event delegation, explain bubbling vs capturing, preventDefault vs stopPropagation |
| Modules | Explain ES modules vs CommonJS, tree shaking |
function promiseAll(items) {
return new Promise((resolve, reject) => {
const results = new Array(items.length);
let remaining = items.length;
if (remaining === 0) return resolve(results);
items.forEach((item, i) => {
Promise.resolve(item) // accept plain values as well as promises
.then((value) => {
results[i] = value; // keep input order, not completion order
remaining -= 1;
if (remaining === 0) resolve(results);
})
.catch(reject); // first rejection wins
});
});
}
Three details interviewers check in this question: results preserve input order even when promises settle out of order, an empty input resolves immediately, and non-promise values are handled through Promise.resolve. Then they often ask for Promise.allSettled as a follow-up.
TypeScript
Most new professional frontend codebases use TypeScript. Learn types and interfaces, unions and narrowing, generics, utility types (Partial, Pick, Record), and typing React props and hooks. See TypeScript interview questions.
Stage 3: React and State Management
React has the largest frontend job market in India. Angular remains common in enterprises and services companies, and Vue at some startups. Whichever you pick, go deep enough to explain how it works, not just how to use it.
React concepts to master
- Rendering model: what triggers a re-render, reconciliation, why keys matter in lists.
- Hooks in depth:
useStatebatching,useEffectdependencies and cleanup,useReffor mutable values,useMemo/useCallbackand when they actually help. - Custom hooks for reusable logic.
- Controlled vs uncontrolled components, forms at scale.
- Context and its re-render cost; state libraries (Redux Toolkit, Zustand) and server-state libraries (TanStack Query, SWR).
- Error boundaries, Suspense, code splitting with
React.lazy. - Server rendering concepts via Next.js: SSR, SSG, ISR, hydration, React Server Components. See Next.js interview questions.
import { useEffect, useState } from 'react';
type Suggestion = { id: string; label: string };
export function useSuggestions(query: string, delayMs = 250) {
const [data, setData] = useState<Suggestion[]>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
if (query.trim() === '') { setData([]); setLoading(false); return; }
const controller = new AbortController();
const timer = setTimeout(async () => {
setLoading(true);
setError(null);
try {
const res = await fetch(`/api/suggest?q=${encodeURIComponent(query)}`,
{ signal: controller.signal });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
setData(await res.json());
} catch (e) {
if ((e as Error).name !== 'AbortError') setError((e as Error).message);
} finally {
if (!controller.signal.aborted) setLoading(false);
}
}, delayMs);
// Runs when query changes or the component unmounts:
// cancels the pending debounce AND any in-flight request.
return () => { clearTimeout(timer); controller.abort(); };
}, [query, delayMs]);
return { data, loading, error };
}
This hook is a compact demonstration of several things frontend interviewers probe: debouncing inside an effect, cleanup functions, and the stale response race condition. Without the abort, typing "ra" then "raz" could show results for "ra" if that request happens to return last. Aborting the previous request on every query change guarantees only the latest query's response is applied.
Stage 4: Browser Internals and Performance
This is the stage that turns a framework user into a frontend engineer. In India, performance is not academic: a large share of users are on mid-range Android devices and variable mobile networks.
How the browser renders
- The critical rendering path, render-blocking CSS and parser-blocking scripts (
defervsasync). - Reflow (layout) vs repaint vs compositing; layout thrashing from interleaved reads and writes.
- The main thread: why long tasks (over 50 ms) make the page feel frozen.
- Caching: HTTP cache headers, service workers, CDNs.
Core Web Vitals
Interaction to Next Paint (INP) replaced First Input Delay as a Core Web Vital in March 2024. See Google's web.dev Core Web Vitals documentation for current definitions.
| Problem | Common causes | Fixes |
|---|---|---|
| Slow LCP | Large hero image, render-blocking resources, slow server response, client-only rendering | Optimized and correctly sized images, preload the LCP resource, SSR/SSG, CDN |
| Poor INP | Long JavaScript tasks, heavy re-renders, large third-party scripts | Code splitting, breaking up long tasks, memoization where measured, deferring third parties, virtualizing long lists |
| High CLS | Images and ads without dimensions, late-loading fonts, injected banners | Explicit width/height or aspect-ratio, reserved space, font-display strategies |
| Large bundles | Unused dependencies, no code splitting, heavy date or chart libraries | Bundle analysis, route-level splitting, lighter alternatives, tree shaking |
Learn to measure before optimizing: Lighthouse for lab data, the Chrome DevTools Performance panel for traces, and real-user monitoring for field data. An interviewer will be far more impressed by "LCP went from 4.1 s to 2.2 s on a throttled mid-range device after preloading the hero image and moving to SSG" than by a list of optimization techniques.
Stage 5: Accessibility, Testing and Security
Accessibility (a11y)
- Keyboard navigation and visible focus; focus management in modals and route changes.
- Semantic HTML first, ARIA only when needed (and correctly).
- Colour contrast, text alternatives, form labels and error announcements.
- Testing with a screen reader (NVDA on Windows, VoiceOver on Mac/iOS, TalkBack on Android) and automated checkers like axe.
- The WCAG guidelines at a working level.
Testing
- Unit and component tests with Vitest or Jest and Testing Library (test behaviour, not implementation).
- End-to-end tests with Playwright or Cypress for critical flows like login and checkout.
- Visual regression testing for design systems.
Frontend security
- XSS and why
dangerouslySetInnerHTMLandinnerHTMLwith user input are dangerous; Content Security Policy. - CSRF, cookie flags (
HttpOnly,Secure,SameSite), where to store tokens and the trade-offs. - CORS: what it protects and what it does not.
Internationalization
For Indian products, supporting Hindi and regional languages is common. Learn i18n libraries, locale-aware number and date formatting (Intl.NumberFormat('en-IN') formats 1234567 as 12,34,567), and layout that handles longer strings.
Stage 6: Frontend System Design
Frontend system design rounds ask you to design the client side of a product. Common prompts: news feed, autocomplete/typeahead, chat application, image carousel or gallery, e-commerce product listing with filters, Google Docs-style editor, video player, notifications panel, or a design system.
A structure that works in the round
- Requirements. Functional (what the user does) and non-functional: devices, network conditions, offline support, accessibility, SEO, i18n, scale of data on screen.
- Component architecture. Break the UI into components; identify which are reusable and which own state.
- Data model and state. What lives in server cache, global client state, local component state, and the URL. Normalize entities when they appear in multiple places.
- API interface. Endpoints or GraphQL queries the client needs, pagination style (cursor for feeds), real-time channel (WebSocket or SSE; see WebSockets vs SSE vs long polling).
- Rendering strategy. CSR, SSR, SSG or a hybrid, and why.
- Performance. Virtualized lists, image strategy, code splitting, prefetching, caching and optimistic updates.
- Accessibility, security, i18n, observability. Error tracking and real-user monitoring.
Worked mini-example: an infinite news feed
| Decision | Choice and reason |
|---|---|
| Pagination | Cursor-based (?after=<postId>) so new posts at the top do not cause duplicates or skipped items |
| Loading trigger | IntersectionObserver on a sentinel element near the bottom, prefetching the next page early |
| Rendering | List virtualization once the feed exceeds a few hundred items to keep DOM size and memory bounded |
| State | Normalized post and user entities in a server-state cache; likes as optimistic updates with rollback on failure |
| New posts | "N new posts" pill fed by SSE or polling, instead of shifting content under the user's thumb (protects CLS) |
| Media | Responsive images, lazy loading below the fold, fixed aspect-ratio placeholders |
| Accessibility | Feed semantics, keyboard navigation between posts, announced loading states |
Many backend-focused system design problems have a frontend counterpart. Reading the backend design for the same product, such as search autocomplete or news feed, helps you design a sensible API contract in the frontend round.
A Stage-by-Stage Timeline and Projects
At around 12 to 15 hours a week, this is a realistic plan. People who already program will move faster through the first two stages; nobody should rush Stage 2.
| Stage | Duration | Project that proves it |
|---|---|---|
| 1. Platform | 3 to 5 weeks | Pixel-accurate, responsive, keyboard-navigable recreation of a real product page, no CSS framework |
| 2. JavaScript | 6 to 8 weeks | A utilities library with tests: debounce, throttle, deep clone, Promise.all, an event emitter |
| 3. React | 6 to 8 weeks | A TypeScript app with routing, server-state caching, forms and optimistic updates |
| 4. Performance | 4 weeks | Take your Stage 3 app and document measured LCP, INP and bundle-size improvements |
| 5. Quality | 3 to 4 weeks | Full keyboard and screen-reader pass, component and end-to-end tests, CSP headers |
| 6. Design | Ongoing | Written design docs for 4 to 5 classic frontend system design prompts |
Run DSA practice alongside from Stage 3 onwards if you are targeting product companies. Our web development roadmap covers enough backend to build the APIs your frontend projects need, and the backend roadmap is useful later for full-stack or API-design conversations.
Frontend Interview Topics by Round
Processes differ by company; confirm with your recruiter. Typical rounds at Indian product companies:
JavaScript fundamentals
Output prediction, closures, this, event loop, polyfills (bind, Promise.all, Array.prototype.reduce), debounce and throttle.
Machine coding
Build autocomplete, nested comments, file explorer, tabs, star rating, kanban board or a progress bar queue in 60 to 120 minutes. See our machine coding guide.
DSA
Usually easy-to-medium problems; arrays, strings, hashing, trees (the DOM is a tree), recursion. See DSA roadmap.
Framework deep dive
React rendering, hooks, state management choices, performance profiling. See React and JS questions.
Frontend system design
Design a feed, chat, editor or component library with the structure above.
Hiring manager
Ownership, collaboration with design and backend, a performance or accessibility win you drove.
What machine coding evaluators look for
- A working core flow first, then edge cases (empty states, errors, loading).
- Sensible component boundaries and state placement.
- Keyboard support and basic accessibility.
- Readable code: naming, small functions, no giant component.
- Being able to explain what you would add with more time.
Expectations by Level
| Level | Expected depth |
|---|---|
| Fresher / SDE-1 | Solid HTML/CSS/JS fundamentals, one framework, can build features with guidance, DSA basics |
| SDE-2 | Owns features end to end, performance and accessibility awareness, testing, can reason through frontend system design for a feature |
| SDE-3 / Senior | Designs frontend architecture across teams, design systems, performance budgets, monitoring, mentoring, influences API design |
| Staff | Platform-level decisions: build tooling, micro-frontends or monorepo strategy, cross-org performance and quality initiatives |
Mistakes to Avoid on the Frontend Path
- Learning React before JavaScript. Most confusing React bugs are JavaScript closure or reference-equality bugs in disguise.
- Treating CSS as an afterthought. Weak CSS shows immediately in machine coding rounds.
- Ignoring the network and device reality. Test on throttled networks and low-end devices, not only on a fast laptop.
- Using
useMemoanduseCallbackeverywhere. Memoization has costs; profile first. - Skipping accessibility. It is increasingly asked in interviews and is part of doing the job properly.
- Chasing every new framework. Concepts transfer; depth in one framework plus strong platform fundamentals beats shallow knowledge of five.
- Neglecting DSA. Product company frontend loops usually include it.
Frequently Asked Questions
Crack Frontend Interviews at Product Companies
Prepflix prepares frontend engineers for JavaScript deep dives, machine coding, DSA and frontend system design rounds.
Explore the Prepflix Course →