Skip to content

Interview questions

Frontend engineer interview questions

Common questions for Frontend engineer roles. Read, copy and practise.

Free with every account.

Practice questions from open collections and written with AI. Not reported from interviews.

Technical

Coding

  1. Write an immediately invoked function expression (IIFE)

  2. Write a JavaScript function to debounce another function, explaining its use case in frontend applications.

  3. Given a list of items, write a JavaScript function to filter and display items containing a specific substring without using built-in filter methods.

  4. Explain how event delegation works in JavaScript and demonstrate it with a code example for a dynamic list.

  5. Write a JavaScript function that debounces input events to optimize performance when typing in a search box.

  6. Implement a function in JavaScript to deep clone a nested object, avoiding circular reference issues.

  7. Given an array of DOM elements, write JavaScript code to toggle a CSS class on each element when clicked.

  8. Write a function that implements a simple infinite scroll mechanism to load more content as the user scrolls down.

System design

  1. How would you design a frontend architecture focused on progressive loading for complex web applications?

  2. How would you design a scalable frontend architecture for a complex single-page application used by millions of users?

Other technical questions

  1. When building a new web site or maintaining one, can you explain some techniques you have used to increase performance?

  2. Can you describe some SEO best practices or techniques you have used lately?

  3. Can you explain any common techniques or recent issues solved in regards to front-end security?

  4. What actions have you personally taken on recent projects to increase maintainability of your code?

  5. Which version control systems are you familiar with?

  6. Can you describe your workflow when you create a web page?

  7. If you have 5 different stylesheets, how would you best integrate them into the site?

  8. Can you describe the difference between progressive enhancement and graceful degradation?

Show 283 more other technical questions
  1. How would you optimize a website's assets/resources?

  2. How many resources will a browser download from a given domain at a time?

  3. Name 3 ways to decrease page load (perceived or actual load time).

  4. Describe how you would create a simple slideshow page.

  5. Explain the importance of standards and standards bodies.

  6. Explain what ARIA and screenreaders are, and how to make a website accessible.

  7. Explain some of the pros and cons for CSS animations versus JavaScript animations.

  8. What does CORS stand for and what issue does it address?

  9. What skills are needed to be a good front-end developer?

  10. Can you explain what happens when you enter a URL into the browser?

  11. Describe the difference between SSR and CSR. Discuss the pros and cons.

  12. What does a doctype do?

  13. How do you serve a page with content in multiple languages?

  14. What kind of things must you be wary of when designing or developing for multilingual sites?

  15. What are data- attributes good for?

  16. Consider HTML5 as an open web platform. What are the building blocks of HTML5?

  17. Describe the difference between a cookie, sessionStorage and localStorage.

  18. What is progressive rendering?

  19. Why you would use a srcset attribute in an image tag? Explain the process the browser uses when evaluating the content of this attribute.

  20. Have you used different HTML templating languages before?

  21. What is the difference between canvas and svg?

  22. What are empty elements in HTML?

  23. What is CSS selector specificity and how does it work?

  24. Describe Floats and how they work.

  25. Describe z-index and how stacking context is formed.

  26. Describe BFC (Block Formatting Context) and how it works.

  27. What are the various clearing techniques and which is appropriate for what context?

  28. How would you approach fixing browser-specific styling issues?

  29. How do you serve your pages for feature-constrained browsers?

  30. What are the different ways to visually hide content (and make it available only for screen readers)?

  31. Have you ever used a grid system, and if so, what do you prefer?

  32. Have you used or implemented media queries or mobile specific layouts/CSS?

  33. Are you familiar with styling SVG?

  34. Can you give an example of an @media property other than screen?

  35. What are some of the "gotchas" for writing efficient CSS?

  36. What are the advantages/disadvantages of using CSS preprocessors?

  37. How would you implement a web design comp that uses non-standard fonts?

  38. Explain how a browser determines what elements match a CSS selector.

  39. Describe pseudo-elements and discuss what they are used for.

  40. Explain your understanding of the box model and how you would tell the browser in CSS to render your layout in different box models.

  41. What is the CSS display property and can you give a few examples of its use?

  42. What is the difference between inline and inline-block?

  43. What is the difference between the "nth-of-type()" and "nth-child()" selectors?

  44. What is the difference between a relative, fixed, absolute and statically positioned element?

  45. Have you used CSS Grid?

  46. Can you explain the difference between coding a web site to be responsive versus using a mobile-first strategy?

  47. How is clearfix css property useful?

  48. Can you explain the difference between px, em and rem as they relate to font sizing?

  49. What is the difference between fixed, fluid and responsive layouts?

  50. Explain event delegation.

  51. Explain how this works in JavaScript.

  52. Explain how prototypal inheritance works.

  53. What is the difference between a variable that is: null, undefined or undeclared?

  54. What is a closure, and how/why would you use one?

  55. What language constructions do you use for iterating over object properties and array items?

  56. Can you describe the main difference between the Array.forEach() loop and Array.map() methods and why you would pick one versus the other?

  57. What is a typical use case for anonymous functions?

  58. What is the difference between host objects and native objects?

  59. Explain the difference between: function Person(){}, var person = Person(), and var person = new Person().

  60. Explain the differences on the usage of foo between function foo() {} and var foo = function() {}.

  61. What is the difference between feature detection, feature inference, and using the UA string?

  62. Describe event bubbling.

  63. Describe event capturing.

  64. What is the difference between an "attribute" and a "property"?

  65. What are the pros and cons of extending built-in JavaScript objects?

  66. Explain the same-origin policy with regards to JavaScript.

  67. Why is it called a Ternary operator, what does the word "Ternary" indicate?

  68. What are some of the advantages/disadvantages of writing JavaScript code in a language that compiles to JavaScript?

  69. What tools and techniques do you use debugging JavaScript code?

  70. Explain the difference between mutable and immutable objects.

  71. Explain the difference between synchronous and asynchronous functions.

  72. What is event loop?

  73. What are the differences between variables created using let, var or const?

  74. What are the differences between ES6 class and ES5 function constructors?

  75. What advantage is there for using the arrow syntax for a method in a constructor?

  76. What is the definition of a higher-order function?

  77. Can you give an example for destructuring an object or an array?

  78. Can you give an example of generating a string with ES6 Template Literals?

  79. Can you give an example of a curry function and why this syntax offers an advantage?

  80. What are the benefits of using spread syntax and how is it different from rest syntax?

  81. How can you share code between files?

  82. Why you might want to create static class members?

  83. What is the difference between while and do-while loops in JavaScript?

  84. What is the difference between event.target and event.currentTarget?

  85. What is the difference between event.preventDefault() and event.stopPropagation()?

  86. What will be returned by each of these?

  87. What are some advantages/disadvantages to testing your code?

  88. What tools would you use to test your code's functionality?

  89. What is the difference between a unit test and a functional/integration test?

  90. What is the purpose of a code style linting tool?

  91. What are some of the testing best practices?

  92. What tools would you use to find a performance bug in your code?

  93. What are some ways you may improve your website's scrolling performance?

  94. Explain the difference between layout, painting and compositing.

  95. Traditionally, why has it been better to serve site assets from multiple domains?

  96. Do your best to describe the process from the time you type in a website's URL to it finishing loading on your screen.

  97. What are the differences between Long-Polling, Websockets and Server-Sent Events?

  98. Explain the following request and response headers

  99. What are HTTP methods? List all HTTP methods that you know, and explain them.

  100. What is domain pre-fetching and how does it help with performance?

  101. What is a CDN and what is the benefit of using one?

  102. What is React?

  103. What are the major features of React?

  104. What is JSX?

  105. What is the difference between an Element and a Component?

  106. How to create components in React?

  107. When to use a Class Component over a Function Component?

  108. What are Pure Components?

  109. What is the difference between state and props?

  110. What is the difference between HTML and React event handling?

  111. What are synthetic events in React?

  112. What are inline conditional expressions?

  113. What is "key" prop and what is the benefit of using it in arrays of elements?

  114. What is Virtual DOM?

  115. How Virtual DOM works?

  116. What is the difference between Shadow DOM and Virtual DOM?

  117. What is the main goal of React Fiber?

  118. What are controlled components?

  119. What is the difference between createElement and cloneElement?

  120. What is Lifting State Up in React?

  121. What are Higher-Order Components?

  122. What is children prop?

  123. How to write comments in React?

  124. What is reconciliation?

  125. Does the lazy function support named exports?

  126. Why React uses className over class attribute?

  127. What are fragments?

  128. Why fragments are better than container divs?

  129. What are stateless components?

  130. What are stateful components?

  131. How to apply validation on props in React?

  132. What are the recommended ways for static type checking?

  133. What is the use of react-dom package?

  134. What is ReactDOMServer?

  135. How to use innerHTML in React?

  136. How events are different in React?

  137. What is the impact of indexes as keys?

  138. How do you conditionally render components?

  139. Why we need to be careful when spreading props on DOM elements?

  140. How do you memoize a component?

  141. How you implement Server Side Rendering or SSR?

  142. How to enable production mode in React?

  143. Do Hooks replace render props and higher order components?

  144. What are the Pointer Events supported in React?

  145. Why should component names start with capital letter?

  146. Are custom DOM attributes supported in React v16?

  147. How to loop inside JSX?

  148. How do you access props in attribute quotes?

  149. What is React proptype array with shape?

  150. What is the difference between React and ReactDOM?

  151. Why ReactDOM is separated from React?

  152. How to use React label element?

  153. How to combine multiple inline style objects?

  154. How to re-render the view when the browser is resized?

  155. How to pretty print JSON with React?

  156. Why can't you update props in React?

  157. How to focus an input element on page load?

  158. How can we find the version of React at runtime in the browser?

  159. How to add Google Analytics for React Router?

  160. How do you apply vendor prefixes to inline styles in React?

  161. How to import and export components using React and ES6?

  162. How do you use TypeScript to enforce types in function parameters and return values?

  163. Explain the difference between interfaces and type aliases in TypeScript and when to use each.

  164. Can you describe how TypeScript’s type inference works and give an example?

  165. How do you handle null and undefined in TypeScript to avoid runtime errors?

  166. How does TypeScript’s structural typing differ from nominal typing?

  167. Explain how to extend existing types or interfaces in TypeScript and provide a use case.

  168. How can you leverage TypeScript’s union and intersection types to create flexible type definitions?

  169. Describe the role of enums in TypeScript and give an example of when to use string enums over numeric enums.

  170. How do you configure TypeScript’s tsconfig.json to improve code quality and developer experience?

  171. What strategies do you use to migrate a JavaScript codebase to TypeScript incrementally?

  172. Can you explain the difference between var, let, and const in JavaScript and when to use each one?

  173. How do closures work in JavaScript, and can you provide an example use case where closures are particularly useful?

  174. What is event delegation in JavaScript and why is it useful in frontend development?

  175. Describe the concept of hoisting in JavaScript and how it affects variable and function declarations.

  176. How do you handle asynchronous operations in JavaScript; can you compare callbacks, promises, and async/await?

  177. What is the difference between == and === operators in JavaScript, and why might you prefer one over the other?

  178. Can you explain prototypal inheritance in JavaScript and how it differs from classical inheritance models?

  179. How does the JavaScript event loop work, and what role does the call stack and task queue play in it?

  180. What is the purpose of 'use strict' in JavaScript, and what are some changes it enforces when enabled?

  181. Explain the difference between function declarations and function expressions in JavaScript and any implications for hoisting.

  182. Can you explain the browser rendering pipeline from HTML to pixels on the screen?

  183. How does the browser construct the DOM and what are the key stages involved?

  184. What is the difference between the DOMContentLoaded event and the load event in the browser?

  185. How do event capturing and event bubbling differ in the DOM event model?

  186. What happens in the browser when you set a CSS property that triggers a layout or repaint?

  187. How can you optimize web page performance related to rendering and DOM updates?

  188. Describe the impact of synchronous JavaScript execution on the browser's rendering process.

  189. What are Shadow DOMs and how do they affect event propagation and styling?

  190. How does the browser handle reflows and repaints, and what causes them?

  191. How would you programmatically add an event listener to multiple elements without creating memory leaks?

  192. Explain how passive event listeners work and when you should use them to improve performance.

  193. What strategies can you use to defer or lazy-load offscreen DOM elements to improve initial rendering?

  194. Can you explain the difference between a functional component and a class component in React?

  195. Describe how the useEffect hook works and how you can control its execution with dependencies.

  196. How do you lift state up in React and why is it important for component communication?

  197. What are React hooks rules and what happens if you break them, for example by calling hooks conditionally?

  198. Can you demonstrate how to create a custom hook to share logic between components?

  199. Explain the reconciliation process in React and how keys aid in rendering lists efficiently.

  200. How would you optimize a React component that frequently re-renders due to state updates?

  201. What is the difference between controlled and uncontrolled components in React forms?

  202. How do React Context and useReducer hook work together to manage complex state?

  203. Can you describe the role of useMemo and useCallback hooks and provide scenarios where they prevent performance issues?

  204. In React, how do you handle asynchronous state updates to ensure consistency and avoid bugs?

  205. How do you measure and analyze the performance of a web page on initial load?

  206. What strategies do you use to reduce render-blocking resources in a frontend application?

  207. Can you explain how lazy loading works and when it's beneficial for web performance?

  208. Describe how you would optimize the critical rendering path to improve page load speed.

  209. What are common causes of long Time to First Byte (TTFB), and how can a frontend engineer mitigate their impact?

  210. Explain the role and performance benefits of using a Content Delivery Network (CDN) in web applications.

  211. How do you audit and optimize the size of frontend assets like JavaScript, CSS, and images?

  212. What impact do HTTP/2 and HTTP/3 protocols have on web performance and resource loading?

  213. Describe how you would handle font loading to avoid invisible text during page load.

  214. What techniques do you use to minimize main thread blocking and improve web app responsiveness?

  215. How would you create a two-column layout using CSS Grid that adjusts to a single column on smaller screens?

  216. Explain how the CSS box model influences layout decisions in responsive web design.

  217. Describe how media queries work and provide an example of a media query that targets devices with a max width of 768px.

  218. How do you ensure images and other media scale correctly across different screen sizes using only CSS?

  219. What is the purpose of the 'viewport' meta tag in responsive design and what could go wrong if it's missing?

  220. Can you explain the difference between relative units like em, rem, and percentage in CSS and how they affect layout scalability?

  221. How would you implement a sticky footer that remains at the bottom of the viewport or page content, whichever is taller?

  222. What strategies do you use to handle browser compatibility issues when implementing complex CSS layouts?

  223. How can CSS variables (custom properties) improve maintainability in responsive design systems?

  224. Describe how you would approach debugging a layout that breaks when the viewport width decreases below a certain point.

  225. Explain the pros and cons of using frameworks like Bootstrap for CSS layout in a project focused on responsive design.

  226. How do you ensure keyboard accessibility for interactive elements in a React application?

  227. What ARIA roles would you use to improve the accessibility of a custom dropdown menu and why?

  228. Can you explain the difference between semantic HTML elements and using ARIA attributes for accessibility?

  229. Describe your approach to testing web accessibility during development and before release.

  230. How would you handle color contrast issues in a design system to comply with WCAG guidelines?

  231. What are the main accessibility challenges when implementing dynamic content updates like live regions?

  232. Explain how screen readers interpret the DOM and how this affects how you write HTML and JavaScript.

  233. What tools do you rely on to audit frontend accessibility and what limitations have you encountered with them?

  234. How would you design a complex form to be fully accessible for keyboard and screen reader users?

  235. What steps do you take to ensure your frontend code supports localization and accessibility simultaneously?

  236. How do you approach testing React components to ensure they render correctly under different states?

  237. Can you explain the differences between unit, integration, and end-to-end testing in frontend development?

  238. How would you test asynchronous data fetching in a frontend application to handle loading and error states properly?

  239. Describe how you would mock external APIs in your frontend tests to avoid flaky or slow test runs.

  240. Given a UI component that fails intermittently in your test suite, how would you diagnose and resolve the flakiness?

  241. How do you integrate frontend tests into a continuous integration pipeline and ensure they provide value without slowing deployments?

  242. Can you design a testing strategy for a complex single-page application to balance coverage and test maintenance effort?

  243. How do you handle testing for accessibility features in your frontend applications?

  244. Describe how you would implement caching strategies in a frontend app to improve performance and reduce load times.

  245. What approach do you take to ensure your frontend design is responsive and performs well across multiple devices and network conditions?

  246. How would you design a component library that supports theming and easy customization across different projects?

  247. Explain how you would structure communication between frontend and backend services in a large application to optimize responsiveness and maintainability.

  248. How do you design the state management system in a complex frontend application to handle real-time updates efficiently?

  249. Describe your strategy to handle error logging and monitoring in a production frontend system.

  250. Explain how you would design a frontend system that gracefully handles feature flagging for A/B testing.

  251. How would you architect a frontend solution to ensure accessibility compliance without sacrificing performance?

  252. What are the trade-offs you consider when choosing between server-side rendering and client-side rendering in a frontend system design?

  253. How would you design a modular build system that optimizes bundle size and load times for a large-scale frontend application?

  254. Describe your approach to designing a system that supports offline functionality and data synchronization in a frontend app.

  255. How would you implement a responsive navigation menu using only HTML, CSS, and vanilla JavaScript?

  256. How would you create a custom accessible modal dialog component using JavaScript and ARIA attributes?

  257. Describe how you would optimize rendering performance for a large data table with thousands of rows in the browser.

  258. How can you handle state management in a frontend app without using external libraries?

  259. Explain the concept of closures in JavaScript and provide an example where it can be used in UI event handling.

  260. How would you debug a React component that renders correctly but does not trigger expected state updates?

  261. How do Content Security Policies (CSP) protect a web application from XSS attacks?

  262. Can you explain the difference between HTTP-only cookies and regular cookies in terms of browser security?

  263. What are common methods to prevent Cross-Site Request Forgery (CSRF) in frontend applications?

  264. How does the Same-Origin Policy in browsers restrict interactions between different websites?

  265. Describe how Subresource Integrity (SRI) works and why it is important for loading third-party scripts.

  266. Explain how you would securely store sensitive data in the browser, considering vulnerabilities like XSS.

  267. How can you use CORS headers effectively to control access to resources from a frontend application?

  268. What potential security issues arise from using dangerouslySetInnerHTML or similar APIs in React?

  269. How do you ensure secure communication between a frontend SPA and backend APIs, especially regarding tokens?

  270. Describe how browser features like sandbox attribute on iframes help enhance security in web apps.

  271. What role do service workers play in security, and what precautions must you take when implementing them?

  272. Can you explain the differences between CommonJS and ES modules and when you would use each in a frontend project?

  273. How does tree shaking work in modern JavaScript bundlers, and why is it important for frontend performance?

  274. Describe the role of a bundler like Webpack or Rollup in a frontend build process and how it handles dependencies.

  275. What are code splitting and lazy loading in the context of bundling, and how do they improve user experience?

  276. How would you configure a build pipeline to optimize both development speed and production bundle size?

  277. Explain how source maps work and why they are useful during debugging of bundled frontend code.

  278. What are the advantages and disadvantages of using a module federation approach in a frontend architecture?

  279. How does Hot Module Replacement (HMR) work and what are the common challenges when integrating it with a frontend build tool?

  280. Can you describe the differences between running scripts via npm scripts, Gulp, and using tools like Webpack CLI?

  281. What strategies would you use to manage environment variables securely in a frontend build process?

  282. How do bundlers handle assets like images and fonts, and what configuration might you apply to optimize them?

  283. What impact does the module resolution algorithm have on build time and module loading in a project with many dependencies?

Behavioral

Motivation

  1. What excites or interests you about coding?

Other behavioral questions

  1. What did you learn yesterday/this week?

  2. If you jumped on a project and they used tabs and you used spaces, what would you do?

  3. If you could master one technology this year, what would it be?

  4. How did you handle a disagreement with your boss or your collaborator?

  5. What resources do you use to learn about the latest in front end development and design?

  6. What role do you see yourself in?

  7. How do you educate designers and product managers about accessibility considerations without overwhelming them?

  8. Can you describe a time when you discovered an accessibility issue late in a project and how you addressed it?

Show 1 more other behavioral question
  1. How do you balance writing tests with tight project deadlines and stakeholder demands for fast feature delivery?

All interview questions

How this data is collected

By company

Shaped by a company.

More Frontend engineer questions, shaped by what each of these companies publicly builds.

Next

When the interview comes.

  • Transcribe

    Live transcription of a call, readable on any phone as it happens.

    Learn more
  • Interview copilot

    Suggested answers during your interview, from your resume and the role.

    Learn more