Skip to content
InterviewTigerInterviewTiger

Frontend Developer Interview Questions and Answers (React, JavaScript)

JavaScript fundamentals, React, browser behaviour, performance and security: the topics frontend rounds keep coming back to.

Frontend developer questions (8)

  1. 01

    Explain the JavaScript event loop.

    mediumtechnicalProduct & startupsBig tech / MNC

    What the interviewer is checking: Core JavaScript understanding.

    A strong answer covers

    • JavaScript runs on one thread with a call stack.
    • Async work (timers, network) is handled by the browser, which queues callbacks.
    • Microtasks (promises) run before the next macrotask (setTimeout).
    • This is why a long synchronous loop freezes the page.
  2. 02

    A React page feels slow. How do you find and fix the cause?

    mediumtechnicalProduct & startups

    What the interviewer is checking: Practical performance debugging.

    A strong answer covers

    • Measure first: React Profiler, browser Performance tab, Lighthouse.
    • Common causes: unnecessary re-renders, large bundles, long lists, heavy images.
    • Fixes: memoisation where measured, code splitting, list virtualisation, image optimisation.
    • Measure again to confirm.
  3. 03

    How do you make a web page accessible?

    mediumtechnicalBig tech / MNC

    What the interviewer is checking: Awareness that products must work for everyone.

    A strong answer covers

    • Semantic HTML: buttons, labels, headings in order.
    • Keyboard access and visible focus.
    • Enough colour contrast and text alternatives for images.
    • ARIA only where native HTML cannot do it.
    • Test with a screen reader and an automated checker.
  4. 04

    How do you decide where to keep state in a React app?

    mediumtechnicalProduct & startups

    What the interviewer is checking: Architecture judgement.

    A strong answer covers

    • Keep state as close as possible to where it is used.
    • Lift it up when siblings need it.
    • Server data belongs in a data-fetching cache (React Query, SWR), not global state.
    • Global stores only for truly app-wide state such as the signed-in user or theme.
  5. 05

    What is XSS and how do you prevent it?

    hardtechnicalBanks & fintech

    What the interviewer is checking: Security basics for the browser.

    A strong answer covers

    • XSS: an attacker's script runs in your page, often via unescaped user input.
    • Frameworks like React escape text by default; avoid dangerouslySetInnerHTML or sanitise first.
    • Use a Content Security Policy.
    • Keep tokens out of places scripts can read (HttpOnly cookies).
  6. 06

    Flexbox or Grid: when do you use which?

    easytechnicalIT services

    What the interviewer is checking: Everyday CSS layout skill.

    A strong answer covers

    • Flexbox: one-dimensional layouts, a row or a column of items.
    • Grid: two-dimensional layouts with rows and columns together.
    • They combine well: Grid for the page, Flexbox inside components.
  7. 07

    What is the difference between server-side rendering and client-side rendering?

    mediumtechnicalProduct & startupsBig tech / MNC

    What the interviewer is checking: Understanding of rendering trade-offs for speed and SEO.

    A strong answer covers

    • Client-side: the browser downloads JavaScript and builds the page; fast after the first load but slower first paint.
    • Server-side: the server sends ready HTML; faster first paint and better for SEO.
    • Static generation builds pages ahead of time; hydration makes server HTML interactive.
    • Frameworks like Next.js mix these per page.
  8. 08

    What happens when you type a URL into the browser and press Enter?

    mediumtechnicalBig tech / MNCProduct & startups

    What the interviewer is checking: Broad web fundamentals.

    A strong answer covers

    • DNS lookup turns the domain into an IP address.
    • TCP and TLS connection, then the HTTP request.
    • Server responds; the browser parses HTML, builds the DOM and CSSOM, runs JavaScript.
    • Layout, paint and composite put pixels on screen; caching can skip steps.

Also asked in every frontend developer interview