Hiring guide

Front End Developer Interview Questions

February 27, 2026
28 min read

These Front End Developer interview questions will guide your interview process to help you find trusted candidates with the right skills you are looking for.

101 Front End Developer Interview Questions

  1. What is the difference between an id and a class in HTML/CSS?

  2. Can you explain the CSS box model?

  3. What is the Document Object Model (DOM)?

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

  5. What is the difference between null and undefined in JavaScript?

  6. Explain the 'this' keyword in JavaScript

  7. What is React JS and what is its main purpose?

  8. What are closures and how would you use them?

  9. What is the difference between == and === operators?

  10. What is the difference between cookies, sessionStorage, and localStorage?

  11. How do you add an event listener to an element?

  12. What is event delegation in JavaScript?

  13. What are promises and how do they work?

  14. Implement Array.prototype functions like map, reduce, or filter

  15. Implement debounce or throttle functions

  16. Implement Promise or Promise.all

  17. What is the Anonymous function in JavaScript?

  18. Explain the 'use strict' statement

  19. What is JSON.stringify() and how is it used?

  20. Explain Class and Prototypal inheritance in JavaScript

  21. What is the difference between em and rem units?

  22. How do you create a flexbox layout?

  23. Can you explain CSS specificity and how it works?

  24. How can you create a CSS grid layout?

  25. What is a Grid system in CSS?

  26. What are media queries and when would you use them?

  27. What are CSS image sprites and why are they used?

  28. What are CSS variables and when would you use them?

  29. What are the elements of the CSS Box Model?

  30. Explain various CSS position properties and their differences

  31. What are some SEO best practices when structuring an HTML document?

  32. What are HTML meta tags and why are they important?

  33. What is the difference between div and span elements?

  34. In an image tag, what is the benefit of the srcset attribute?

  35. Explain the data-* attribute in HTML and its usage

  36. How does the server handle pages with content in multiple languages?

  37. How does the browser render a website?

  38. What are three ways to decrease page load time?

  39. How do you optimize website assets for better loading times?

  40. What is lazy loading and how does it improve performance?

  41. Explain the critical rendering path and how to optimize it

  42. What is the difference between async and defer attributes in script tags?

  43. What is responsive web design and how do you implement it?

  44. What are common breakpoints for responsive design?

  45. What are ARIA attributes and why are they important?

  46. How do you ensure web accessibility compliance (WCAG)?

  47. What is the viewport meta tag and why is it important?

  48. How do you handle images in responsive design?

  49. What are React components and what are the different types?

  50. What is the Virtual DOM and how does it work?

  51. Explain React hooks and their purpose (useState, useEffect, etc.)

  52. What is prop drilling and how can you avoid it?

  53. What is the difference between controlled and uncontrolled components?

  54. Explain React's component lifecycle methods

  55. What is React Context API and when would you use it?

  56. How do you handle API calls in React?

  57. What is the difference between REST and GraphQL?

  58. Explain the different HTTP methods (GET, POST, PUT, DELETE, PATCH)

  59. What is CORS and why does it exist?

  60. How do you handle authentication in web applications?

  61. What is the difference between synchronous and asynchronous JavaScript?

  62. How do you handle errors in API calls?

  63. Explain the basic Git workflow and common commands

  64. What is the difference between git merge and git rebase?

  65. What build tools and package managers have you used?

  66. How do you debug JavaScript code?

  67. What is npm and what is package.json?

  68. What is Cross-Site Scripting (XSS) and how do you prevent it?

  69. What is CSRF and how can you protect against it?

  70. How do you securely store sensitive data in the browser?

  71. What is Content Security Policy (CSP)?

  72. What are some common web security vulnerabilities you should be aware of?

  73. What are the different types of testing in web development?

  74. What testing frameworks have you used?

  75. How do you test asynchronous code?

  76. What is Test-Driven Development (TDD)?

  77. How do you ensure cross-browser compatibility?

  78. How would you approach optimizing a slow-loading website?

  79. Describe how you would implement infinite scrolling

  80. How would you implement a search functionality with autocomplete?

  81. How would you handle form validation on the frontend?

  82. How would you implement dark mode in a web application?

  83. Explain how you would build a shopping cart feature

  84. How would you implement file upload functionality?

  85. How would you optimize images for web performance?

  86. Describe a challenging project you worked on and how you overcame obstacles

  87. How do you stay updated with the latest web development trends and technologies?

  88. How do you approach code reviews?

  89. How do you handle disagreements with team members about technical decisions?

  90. How do you prioritize tasks when working on multiple projects?

  91. Describe your experience working in an Agile/Scrum environment

  92. How do you ensure your code is maintainable and scalable?

  93. What's your approach to learning a new technology or framework?

  94. How do you handle tight deadlines and pressure?

  95. What motivates you as a web developer?

  96. Tell me about a time when you had to learn something quickly to complete a project

  97. Describe a time when you made a mistake in your code. How did you handle it?

  98. How do you handle feedback or criticism of your code?

  99. Tell me about a time when you had to explain a technical concept to a non-technical person

  100. Describe a situation where you had to refactor or improve existing code

  101. How do you handle situations where requirements change mid-project?

Download Free Front End Developer Interview Questions

Get expert-crafted questions designed specifically for front end developer roles. Our comprehensive PDF includes technical, behavioral, and ethics questions to help you identify top talent.

Technical Skills & Core Knowledge

What is the difference between an id and a class in HTML/CSS?

What to Listen For:

  • Clear explanation that id is unique to a single element while class can be applied to multiple elements
  • Understanding of CSS selector syntax (#id vs .class) and when to use each appropriately
  • Practical examples demonstrating proper use cases for ids versus classes in real-world scenarios

Can you explain the CSS box model?

What to Listen For:

  • Accurate description of all four layers: content, padding, border, and margin in correct order
  • Understanding of how each layer affects element sizing and spacing in page layout
  • Ability to explain how to control each layer independently for precise UI design

What is the Document Object Model (DOM)?

What to Listen For:

  • Clear explanation that DOM is an API representing HTML document structure as a tree of nodes
  • Understanding that each node corresponds to elements, attributes, or text in the document
  • Recognition of how DOM enables JavaScript manipulation of web page content and structure

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

What to Listen For:

  • Accurate explanation of inline elements taking only required width without starting new lines
  • Understanding that inline-block allows width/height settings while staying in line flow
  • Recognition that block elements start on new lines and can have customizable dimensions

What is the difference between null and undefined in JavaScript?

What to Listen For:

  • Clear distinction that undefined means a variable is declared but not assigned a value
  • Understanding that null is an intentional assignment by developers signaling "no value"
  • Recognition of when each value appears in typical JavaScript programming scenarios

Explain the 'this' keyword in JavaScript

What to Listen For:

  • Understanding that 'this' refers to the context in which a function is executed
  • Ability to explain how 'this' changes based on invocation patterns and binding methods
  • Knowledge of common pitfalls and solutions like arrow functions or explicit binding

What is React JS and what is its main purpose?

What to Listen For:

  • Recognition that React is an open-source JavaScript library for building user interfaces
  • Understanding of React's focus on single-page applications and view layer management
  • Mention of key benefits like reusability, scalability, and efficient data handling without page reloads

What are closures and how would you use them?

What to Listen For:

  • Clear explanation that closures allow inner functions to access outer function variables after execution
  • Practical use cases like creating private variables or maintaining state in functional programming
  • Understanding of lexical scope and how closures preserve the execution context

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

What to Listen For:

  • Clear explanation that == performs type coercion while === checks both value and type
  • Concrete examples showing different results between the two operators (e.g., 1=='1' vs 1==='1')
  • Best practice recommendation to use === for more predictable and safer comparisons

What is the difference between cookies, sessionStorage, and localStorage?

What to Listen For:

  • Understanding that cookies are sent with HTTP requests while storage APIs are client-side only
  • Recognition that sessionStorage persists only for the browser session while localStorage persists indefinitely
  • Knowledge of size limitations: cookies (~4KB) versus storage APIs (5-10MB) and appropriate use cases
JavaScript Programming & Implementation

How do you add an event listener to an element?

What to Listen For:

  • Correct method syntax using addEventListener with event type and handler function
  • Knowledge of first obtaining the DOM element using methods like getElementById or querySelector
  • Understanding of optional parameters like the capture phase boolean flag

What is event delegation in JavaScript?

What to Listen For:

  • Clear explanation of attaching event handlers to parent elements instead of individual children
  • Understanding of event bubbling and how events propagate up the DOM hierarchy
  • Recognition of performance benefits and use cases for dynamically added elements

What are promises and how do they work?

What to Listen For:

  • Accurate description of promises as objects representing eventual completion of asynchronous operations
  • Understanding of promise states: pending, fulfilled, and rejected
  • Knowledge of chaining with .then() and .catch() methods for handling success and failure

Implement Array.prototype functions like map, reduce, or filter

What to Listen For:

  • Correct implementation showing understanding of callback functions and array iteration
  • Proper handling of parameters including the callback, index, and original array
  • Clean, efficient code that demonstrates mastery of JavaScript fundamentals

Implement debounce or throttle functions

What to Listen For:

  • Correct use of closures and timers (setTimeout/setInterval) to control function execution
  • Clear understanding of the difference: debounce delays execution, throttle limits frequency
  • Recognition of real-world use cases like search inputs or scroll events for performance optimization

Implement Promise or Promise.all

What to Listen For:

  • Proper implementation of promise constructor with resolve and reject callbacks
  • Understanding of Promise.all behavior: waits for all promises or fails on first rejection
  • Clean error handling and edge case consideration for empty arrays or non-promise values

What is the Anonymous function in JavaScript?

What to Listen For:

  • Clear explanation that anonymous functions have no defined function name
  • Understanding of using assignment operators to store functions as objects in variables
  • Recognition of common use cases like callbacks, IIFEs, and event handlers

Explain the 'use strict' statement

What to Listen For:

  • Understanding that 'use strict' enables strict mode to catch common coding errors
  • Knowledge of restrictions like preventing undeclared variables and eliminating silent errors
  • Recognition of benefits for code quality, security, and preventing loose coupling issues

What is JSON.stringify() and how is it used?

What to Listen For:

  • Accurate explanation that stringify converts JavaScript objects into JSON strings
  • Understanding of use cases for sending data to web servers or storing data
  • Knowledge of optional parameters for replacer functions and formatting options

Explain Class and Prototypal inheritance in JavaScript

What to Listen For:

  • Clear understanding that JavaScript uses prototype-based inheritance, not classical class-based
  • Explanation of how ES6 classes are syntactic sugar over prototypal inheritance
  • Knowledge of prototype chain and how objects inherit properties from other objects
CSS Layout & Styling Techniques

What is the difference between em and rem units?

What to Listen For:

  • Clear explanation that em is relative to parent element font size while rem is relative to root
  • Practical examples demonstrating calculation differences between the two units
  • Understanding of when to use each unit for maintainable and scalable styling

How do you create a flexbox layout?

What to Listen For:

  • Correct syntax using display: flex on the container element
  • Understanding of flex properties for child elements like flex-grow, flex-shrink, and flex-basis
  • Knowledge of alignment properties like justify-content and align-items for layout control

Can you explain CSS specificity and how it works?

What to Listen For:

  • Clear hierarchy explanation: inline styles > ID selectors > class selectors > type selectors
  • Understanding of how specificity resolves conflicting CSS rules on the same element
  • Recognition of !important flag and its impact on specificity precedence

How can you create a CSS grid layout?

What to Listen For:

  • Proper use of display: grid on the container element to enable grid layout
  • Understanding of grid-template-rows and grid-template-columns to define structure
  • Knowledge of placing items using grid-column and grid-row properties for precise positioning

What is a Grid system in CSS?

What to Listen For:

  • Understanding that CSS Grid divides pages into grids for organizing HTML content
  • Recognition of how grids enable precise control over element positioning and layout
  • Knowledge of responsive design benefits and two-dimensional layout capabilities

What are media queries and when would you use them?

What to Listen For:

  • Clear explanation that media queries apply different styles based on device characteristics
  • Understanding of responsive design principles and adapting to various screen sizes
  • Knowledge of common breakpoints and syntax for targeting specific viewport dimensions

What are CSS image sprites and why are they used?

What to Listen For:

  • Understanding that sprites combine multiple images into a single file to reduce HTTP requests
  • Recognition of performance benefits including faster page loading times
  • Knowledge of using background-position to display specific portions of the sprite image

What are CSS variables and when would you use them?

What to Listen For:

  • Clear explanation that CSS variables store reusable values across stylesheets
  • Understanding of syntax using -- prefix and var() function for declaring and using variables
  • Recognition of use cases like centralizing theme colors or consistent spacing values

What are the elements of the CSS Box Model?

What to Listen For:

  • Complete listing of all four elements: content, padding, border, and margin
  • Accurate description of each element's purpose and position in the box structure
  • Understanding of how these elements affect total element dimensions and spacing

Explain various CSS position properties and their differences

What to Listen For:

  • Clear differentiation between static, relative, absolute, fixed, and sticky positioning
  • Understanding of how each position type affects element flow and document layout
  • Practical examples of when to use each positioning method in real-world scenarios
HTML Structure & Semantic Markup

What are some SEO best practices when structuring an HTML document?

What to Listen For:

  • Use of semantic HTML tags like header, nav, article, section, and proper heading hierarchy
  • Implementation of meta tags, alt attributes on images, and descriptive title elements
  • Understanding of mobile-friendly design, fast loading times, and internal linking strategies

What are HTML meta tags and why are they important?

What to Listen For:

  • Understanding that meta tags provide metadata about the HTML document in name/value pairs
  • Knowledge of common meta tags like description, viewport, charset, and keywords
  • Recognition that meta tags affect SEO, browser rendering, and social media sharing but aren't displayed

What is the difference between div and span elements?

What to Listen For:

  • Clear explanation that div is a block-level element while span is inline
  • Understanding that div creates structure and grouping while span styles inline content
  • Recognition of appropriate use cases for each element in semantic HTML structure

In an image tag, what is the benefit of the srcset attribute?

What to Listen For:

  • Understanding that srcset enables responsive images with multiple resolution options
  • Recognition that browsers can select appropriate image based on device capabilities and screen size
  • Knowledge of performance benefits and improved user experience across different devices

Explain the data-* attribute in HTML and its usage

What to Listen For:

  • Understanding that data-* attributes store custom data private to the page or application
  • Recognition that these attributes were previously used extensively but now have security concerns
  • Knowledge that users can modify data-* attributes via browser console, making them unsuitable for sensitive data

How does the server handle pages with content in multiple languages?

What to Listen For:

  • Understanding of Accept-Language header sent by browsers with HTTP requests
  • Knowledge that servers read this header to determine user's language preference
  • Recognition of lang attribute declaration in HTML tag for proper document language specification
Browser Rendering & Performance Optimization

How does the browser render a website?

What to Listen For:

  • Step-by-step explanation: parsing HTML, constructing DOM tree, parsing CSS, building CSSOM
  • Understanding of render tree construction, layout calculation, and painting process
  • Knowledge of compositing layers, JavaScript execution timing, and asynchronous resource loading

What are three ways to decrease page load time?

What to Listen For:

  • Image optimization techniques including proper scaling and compression before upload
  • Browser caching strategies to speed up loading for returning visitors
  • Content compression and optimization, plus stylesheet placement in document head

How do you optimize website assets for better loading times?

What to Listen For:

  • Image optimization through compression, modern formats (WebP), and responsive sizing techniques
  • Code minification and bundling for CSS, JavaScript, and HTML to reduce file sizes
  • Implementation of lazy loading, CDN usage, and asynchronous loading for non-critical resources

What is lazy loading and how does it improve performance?

What to Listen For:

  • Clear explanation that lazy loading defers loading of non-critical resources until needed
  • Understanding of implementation methods including native loading="lazy" attribute and JavaScript libraries
  • Recognition of benefits including faster initial page load, reduced bandwidth usage, and improved user experience

Explain the critical rendering path and how to optimize it

What to Listen For:

  • Understanding of the sequence: DOM construction, CSSOM construction, render tree, layout, and paint
  • Knowledge of optimization techniques like minimizing critical resources and reducing render-blocking CSS/JS
  • Recognition of async/defer attributes, inlining critical CSS, and prioritizing above-the-fold content

What is the difference between async and defer attributes in script tags?

What to Listen For:

  • Clear explanation that async downloads scripts in parallel but executes immediately when ready
  • Understanding that defer downloads in parallel but executes only after HTML parsing completes
  • Knowledge of when to use each: async for independent scripts, defer for scripts requiring DOM access
Responsive Design & Web Accessibility

What is responsive web design and how do you implement it?

What to Listen For:

  • Clear understanding that responsive design adapts layouts to different screen sizes and devices
  • Implementation knowledge including fluid grids, flexible images, and CSS media queries
  • Recognition of mobile-first approach and viewport meta tag configuration

What are common breakpoints for responsive design?

What to Listen For:

  • Knowledge of standard breakpoints: mobile (320-480px), tablet (768px), desktop (1024px+)
  • Understanding that breakpoints should be based on content needs rather than specific devices
  • Recognition of modern approaches including mobile-first design and flexible breakpoint strategies

What are ARIA attributes and why are they important?

What to Listen For:

  • Understanding that ARIA (Accessible Rich Internet Applications) improves accessibility for assistive technologies
  • Knowledge of common attributes like aria-label, aria-describedby, and role for semantic meaning
  • Recognition that ARIA should supplement, not replace, semantic HTML elements

How do you ensure web accessibility compliance (WCAG)?

What to Listen For:

  • Understanding of WCAG principles: Perceivable, Operable, Understandable, and Robust (POUR)
  • Implementation of semantic HTML, keyboard navigation, proper contrast ratios, and alt text
  • Knowledge of testing tools like screen readers, automated validators, and manual accessibility audits

What is the viewport meta tag and why is it important?

What to Listen For:

  • Clear explanation that viewport tag controls page dimensions and scaling on mobile devices
  • Correct syntax knowledge: <meta name="viewport" content="width=device-width, initial-scale=1">
  • Understanding that without it, mobile browsers render pages at desktop widths causing usability issues

How do you handle images in responsive design?

What to Listen For:

  • Use of max-width: 100% and height: auto for fluid image scaling
  • Implementation of srcset and sizes attributes for resolution-based image selection
  • Knowledge of picture element for art direction and different image crops per breakpoint
React & Modern JavaScript Frameworks

What are React components and what are the different types?

What to Listen For:

  • Understanding that components are reusable, independent pieces of UI with their own logic
  • Clear differentiation between functional components (modern, with hooks) and class components (legacy)
  • Recognition of component composition patterns and props for data passing

What is the Virtual DOM and how does it work?

What to Listen For:

  • Clear explanation that Virtual DOM is a lightweight JavaScript representation of the actual DOM
  • Understanding of reconciliation process: comparing virtual trees and calculating minimal DOM updates
  • Recognition of performance benefits by batching updates and reducing expensive DOM manipulations

Explain React hooks and their purpose (useState, useEffect, etc.)

What to Listen For:

  • Understanding that hooks enable state and lifecycle features in functional components
  • Clear explanation of useState for state management and useEffect for side effects
  • Knowledge of hook rules: only call at top level, only in functional components

What is prop drilling and how can you avoid it?

What to Listen For:

  • Clear explanation that prop drilling passes data through multiple component layers unnecessarily
  • Solutions including Context API, state management libraries (Redux, Zustand), or component composition
  • Understanding of when prop drilling is acceptable versus when alternative patterns are needed

What is the difference between controlled and uncontrolled components?

What to Listen For:

  • Understanding that controlled components have React managing form data through state
  • Recognition that uncontrolled components let the DOM handle form data with refs for access
  • Knowledge of when to use each: controlled for validation/formatting, uncontrolled for simple forms

Explain React's component lifecycle methods

What to Listen For:

  • Understanding of mounting, updating, and unmounting phases in class components
  • Knowledge that functional components use useEffect hook as lifecycle replacement
  • Recognition of common methods: componentDidMount, componentDidUpdate, componentWillUnmount

What is React Context API and when would you use it?

What to Listen For:

  • Clear explanation that Context provides way to pass data through component tree without props
  • Understanding of Provider and Consumer patterns for sharing global state
  • Recognition of use cases: themes, user authentication, language preferences, avoiding prop drilling

How do you handle API calls in React?

What to Listen For:

  • Use of useEffect hook with async functions or .then() chains for data fetching
  • Proper state management for loading, data, and error states
  • Knowledge of cleanup functions, dependency arrays, and modern solutions like React Query or SWR
API Integration & HTTP Concepts

What is the difference between REST and GraphQL?

What to Listen For:

  • Understanding that REST uses multiple endpoints while GraphQL uses a single endpoint
  • Recognition that GraphQL allows clients to request exactly the data needed, reducing over-fetching
  • Knowledge of trade-offs: REST simplicity versus GraphQL flexibility and complexity

Explain the different HTTP methods (GET, POST, PUT, DELETE, PATCH)

What to Listen For:

  • Clear explanation: GET retrieves data, POST creates, PUT replaces, PATCH updates partially, DELETE removes
  • Understanding of idempotency: GET, PUT, DELETE are idempotent; POST is not
  • Recognition of proper use cases and RESTful API design principles

What is CORS and why does it exist?

What to Listen For:

  • Understanding that CORS (Cross-Origin Resource Sharing) is a security mechanism controlling cross-domain requests
  • Recognition that browsers block cross-origin requests by default for security
  • Knowledge of server-side headers (Access-Control-Allow-Origin) required to enable CORS

How do you handle authentication in web applications?

What to Listen For:

  • Knowledge of authentication methods: JWT tokens, session cookies, OAuth, or token-based authentication
  • Understanding of secure storage practices: httpOnly cookies, secure flags, avoiding localStorage for sensitive data
  • Recognition of implementing protected routes and handling token refresh mechanisms

What is the difference between synchronous and asynchronous JavaScript?

What to Listen For:

  • Clear explanation that synchronous code executes line-by-line, blocking subsequent operations
  • Understanding that asynchronous code allows other operations while waiting for completion
  • Knowledge of async patterns: callbacks, promises, async/await for handling asynchronous operations

How do you handle errors in API calls?

What to Listen For:

  • Implementation of try-catch blocks for async/await or .catch() for promises
  • Proper error state management and user-friendly error messages
  • Knowledge of HTTP status codes, retry logic, and graceful degradation strategies
Version Control & Development Tools

Explain the basic Git workflow and common commands

What to Listen For:

  • Understanding of workflow: clone/init, add, commit, push, pull, and branch operations
  • Knowledge of essential commands: git status, git diff, git log for repository inspection
  • Recognition of best practices: meaningful commit messages, frequent commits, branching strategies

What is the difference between git merge and git rebase?

What to Listen For:

  • Clear explanation that merge creates a new commit combining branch histories
  • Understanding that rebase moves commits to new base, creating linear history
  • Knowledge of when to use each: merge for public branches, rebase for cleaning local history

What build tools and package managers have you used?

What to Listen For:

  • Experience with npm, yarn, or pnpm for package management and dependency installation
  • Knowledge of build tools like Webpack, Vite, Parcel, or Rollup for bundling
  • Understanding of task runners, transpilers (Babel), and development server configurations

How do you debug JavaScript code?

What to Listen For:

  • Use of browser developer tools, console methods (log, error, table, trace)
  • Knowledge of breakpoints, step-through debugging, and call stack inspection
  • Understanding of debugging techniques: isolating issues, reproducing bugs, using debugger statement

What is npm and what is package.json?

What to Listen For:

  • Understanding that npm is Node Package Manager for installing and managing JavaScript libraries
  • Recognition that package.json contains project metadata, dependencies, and script configurations
  • Knowledge of semantic versioning, dev dependencies versus production dependencies
Web Security & Best Practices

What is Cross-Site Scripting (XSS) and how do you prevent it?

What to Listen For:

  • Understanding that XSS injects malicious scripts into trusted websites through user input
  • Prevention methods: input sanitization, output encoding, Content Security Policy headers
  • Recognition of framework protections: React's automatic escaping, using textContent over innerHTML

What is CSRF and how can you protect against it?

What to Listen For:

  • Understanding that CSRF (Cross-Site Request Forgery) tricks users into executing unwanted actions
  • Protection methods: CSRF tokens, SameSite cookie attribute, checking Origin/Referer headers
  • Knowledge of double-submit cookies and framework-specific CSRF protections

How do you securely store sensitive data in the browser?

What to Listen For:

  • Understanding that localStorage and sessionStorage are NOT secure for sensitive data
  • Recommendation for httpOnly, secure cookies for authentication tokens
  • Recognition that truly sensitive data should remain server-side, not in browser storage

What is Content Security Policy (CSP)?

What to Listen For:

  • Understanding that CSP is a security header controlling which resources can be loaded
  • Recognition of protection against XSS, clickjacking, and other code injection attacks
  • Knowledge of directive types: script-src, style-src, img-src for granular control

What are some common web security vulnerabilities you should be aware of?

What to Listen For:

  • Knowledge of OWASP Top 10: XSS, SQL injection, broken authentication, sensitive data exposure
  • Understanding of CSRF, insecure deserialization, and using components with known vulnerabilities
  • Recognition of security best practices: regular updates, input validation, principle of least privilege
Testing & Quality Assurance

What are the different types of testing in web development?

What to Listen For:

  • Understanding of unit tests (individual functions), integration tests (component interactions)
  • Knowledge of end-to-end tests (full user workflows), and visual regression testing
  • Recognition of testing pyramid: many unit tests, fewer integration tests, minimal E2E tests

What testing frameworks have you used?

What to Listen For:

  • Experience with unit testing frameworks: Jest, Vitest, Mocha, or Jasmine
  • Knowledge of component testing libraries: React Testing Library, Enzyme
  • Familiarity with E2E tools: Cypress, Playwright, Selenium, or Puppeteer

How do you test asynchronous code?

What to Listen For:

  • Use of async/await in test functions or returning promises from tests
  • Knowledge of testing utilities: waitFor, act, flush promises for handling async updates
  • Understanding of mocking API calls and controlling asynchronous behavior in tests

What is Test-Driven Development (TDD)?

What to Listen For:

  • Understanding of TDD cycle: write failing test first, write minimal code to pass, then refactor
  • Recognition of benefits: better design, comprehensive test coverage, confidence in refactoring
  • Knowledge of when TDD is appropriate versus when it may slow down development

How do you ensure cross-browser compatibility?

What to Listen For:

  • Use of feature detection, polyfills, and transpilation tools like Babel for older browsers
  • Testing strategies: BrowserStack, cross-browser testing tools, progressive enhancement approach
  • Understanding of CSS vendor prefixes, autoprefixer, and graceful degradation techniques
Problem-Solving & Practical Scenarios

How would you approach optimizing a slow-loading website?

What to Listen For:

  • Systematic approach: measure first using Lighthouse, WebPageTest, or browser DevTools
  • Identification of bottlenecks: large images, render-blocking resources, excessive JavaScript
  • Implementation of solutions: code splitting, lazy loading, CDN usage, caching strategies

Describe how you would implement infinite scrolling

What to Listen For:

  • Use of Intersection Observer API or scroll event listeners to detect bottom of page
  • Implementation of pagination logic, loading states, and error handling for API calls
  • Consideration of performance: debouncing scroll events, managing memory with large lists

How would you implement a search functionality with autocomplete?

What to Listen For:

  • Debouncing input to reduce API calls and improve performance
  • Managing loading states, empty states, and displaying suggestions dynamically
  • Keyboard navigation support (arrow keys, enter, escape) and accessibility considerations

How would you handle form validation on the frontend?

What to Listen For:

  • Use of HTML5 validation attributes combined with JavaScript for custom validation logic
  • Real-time feedback with appropriate timing (onBlur, onChange) for better user experience
  • Recognition that client-side validation is UX enhancement, not security—server validation required

How would you implement dark mode in a web application?

What to Listen For:

  • Use of CSS variables for theme colors and prefers-color-scheme media query for system preference
  • Implementation of toggle functionality with localStorage/sessionStorage for persistence
  • Consideration of transition effects, avoiding flash of unstyled content (FOUC)

Explain how you would build a shopping cart feature

What to Listen For:

  • State management approach: Context API, Redux, or local state for cart items and quantities
  • Persistence strategy: localStorage for guest users, backend sync for authenticated users
  • Features consideration: add/remove items, quantity updates, price calculations, inventory validation

How would you implement file upload functionality?

What to Listen For:

  • Use of FormData API for file handling and multipart/form-data encoding
  • Implementation of progress indicators, file validation (size, type), and preview functionality
  • Consideration of drag-and-drop support, multiple file uploads, and error handling

How would you optimize images for web performance?

What to Listen For:

  • Proper format selection: WebP for photos, SVG for icons/logos, PNG for transparency needs
  • Implementation of responsive images with srcset, sizes attributes, and picture element
  • Compression strategies, lazy loading, and CDN usage for delivery optimization
Professional Experience & Soft Skills

Describe a challenging project you worked on and how you overcame obstacles

What to Listen For:

  • Clear project description with specific technical challenges and constraints faced
  • Problem-solving approach: research, experimentation, collaboration, or creative solutions
  • Reflection on lessons learned and how the experience improved their skills

How do you stay updated with the latest web development trends and technologies?

What to Listen For:

  • Active learning habits: following blogs, newsletters, podcasts, or YouTube channels
  • Practical engagement: side projects, open-source contributions, attending conferences or meetups
  • Community involvement: participating in forums, social media tech communities, or local dev groups

How do you approach code reviews?

What to Listen For:

  • Constructive feedback approach: specific, actionable comments focused on code quality and standards
  • Balance between catching bugs, suggesting improvements, and acknowledging good practices
  • Openness to receiving feedback and viewing reviews as collaborative learning opportunities

How do you handle disagreements with team members about technical decisions?

What to Listen For:

  • Professional communication: listening to perspectives, articulating reasoning with evidence
  • Focus on project goals and user needs rather than personal preferences
  • Willingness to compromise, prototype solutions, or defer to team consensus/leadership

How do you prioritize tasks when working on multiple projects?

What to Listen For:

  • Systematic approach: assessing urgency, impact, dependencies, and deadlines
  • Communication with stakeholders to clarify priorities and manage expectations
  • Time management techniques: breaking tasks into smaller chunks, using productivity tools

Describe your experience working in an Agile/Scrum environment

What to Listen For:

  • Understanding of Agile ceremonies: sprint planning, daily standups, retrospectives, reviews
  • Experience with user stories, story points, sprint goals, and iterative development
  • Recognition of Agile values: collaboration, adaptability, continuous improvement

How do you ensure your code is maintainable and scalable?

What to Listen For:

  • Clean code practices: meaningful naming, single responsibility principle, DRY principle
  • Documentation: comments for complex logic, README files, API documentation
  • Code organization: modular architecture, separation of concerns, consistent patterns

What's your approach to learning a new technology or framework?

What to Listen For:

  • Structured learning: official documentation, tutorials, video courses, or books
  • Hands-on practice: building small projects, following along with examples, experimentation
  • Understanding fundamentals before diving into advanced features or best practices

How do you handle tight deadlines and pressure?

What to Listen For:

  • Realistic assessment of what's achievable and communication about scope or timeline adjustments
  • Focus on MVP and essential features first, deferring nice-to-haves if necessary
  • Maintaining code quality despite pressure, avoiding technical debt that causes future problems

What motivates you as a web developer?

What to Listen For:

  • Genuine passion for creating user-friendly experiences or solving complex problems
  • Interest in continuous learning and staying current with evolving technologies
  • Satisfaction from seeing projects deployed and positively impacting users or businesses
Behavioral & Situational Questions

Tell me about a time when you had to learn something quickly to complete a project

What to Listen For:

  • Specific situation with context about why quick learning was necessary
  • Learning strategy employed and resources utilized effectively
  • Successful outcome and reflection on the learning experience

Describe a time when you made a mistake in your code. How did you handle it?

What to Listen For:

  • Honesty about the mistake without making excuses or blaming others
  • Quick identification, communication to stakeholders, and systematic debugging approach
  • Lessons learned and preventive measures implemented to avoid similar issues

How do you handle feedback or criticism of your code?

What to Listen For:

  • Open-minded attitude and viewing feedback as opportunity for growth
  • Asking clarifying questions to fully understand suggestions or concerns
  • Implementing valid feedback while respectfully discussing alternative approaches when appropriate

Tell me about a time when you had to explain a technical concept to a non-technical person

What to Listen For:

  • Ability to simplify complex concepts using analogies or everyday examples
  • Patience and checking for understanding rather than overwhelming with jargon
  • Success in achieving mutual understanding and productive outcomes

Describe a situation where you had to refactor or improve existing code

What to Listen For:

  • Identification of code smells or technical debt that needed addressing
  • Systematic approach: writing tests first, incremental changes, maintaining functionality
  • Measurable improvements in readability, performance, or maintainability

How do you handle situations where requirements change mid-project?

What to Listen For:

  • Flexibility and adaptability while assessing impact on timeline and deliverables
  • Communication with stakeholders about trade-offs and implications of changes
  • Adjusting plans pragmatically while maintaining code quality and project goals
Start Here
Get Front End Developer Job Description Template
Create a compelling front end developer job posting before you start interviewing

How X0PA AI Helps You Hire Front End Developer

Hiring Front End Developers shouldn't mean spending weeks screening resumes, conducting endless interviews, and still ending up with someone who leaves in 6 months.

X0PA AI uses predictive analytics across 6 key hiring stages, from job posting to assessment to find candidates who have the skills to succeed and the traits to stay.

Job Description Creation

Multi-Channel Sourcing

AI-Powered Screening

Candidate Assessment

Process Analytics

Agentic AI