0% found this document useful (0 votes)
8 views15 pages

Full-Stack Developer Interview Questions - ReactJS, JavaScript, Node - JS, MERN, HTML, CSS

The document contains a comprehensive list of interview questions for Full-Stack Developers focusing on ReactJS, JavaScript, Node.js, and related technologies. It covers various topics including React concepts, JavaScript fundamentals, state management, performance optimization, and testing strategies. The questions are designed to assess a candidate's knowledge and practical skills in building and maintaining web applications.

Uploaded by

raj117557
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views15 pages

Full-Stack Developer Interview Questions - ReactJS, JavaScript, Node - JS, MERN, HTML, CSS

The document contains a comprehensive list of interview questions for Full-Stack Developers focusing on ReactJS, JavaScript, Node.js, and related technologies. It covers various topics including React concepts, JavaScript fundamentals, state management, performance optimization, and testing strategies. The questions are designed to assess a candidate's knowledge and practical skills in building and maintaining web applications.

Uploaded by

raj117557
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Full-Stack Developer Interview Questions: ReactJS,

JavaScript, Node.js, MERN, HTML, CSS


ReactJS Interview Questions
1. What is React and how does it differ from other JavaScript frameworks?
2. Explain the concept of JSX and how it is transformed into JavaScript.
3. What are the main features and benefits of using React?
4. How does the Virtual DOM work in React and how does it improve performance?
5. Explain the difference between state and props in React.
6. How do you update state in React, and why should state not be mutated directly?
7. What are the differences between class components and functional components?
8. When would you use a functional component over a class component?
9. What is an event handler in React? How do you attach event handlers to components?
10. How do you pass data from a parent component to a child component in React?
11. What is a key in React and why is it important when rendering lists?
12. How do you conditionally render components in React?
13. Explain how lists and keys work in React.
14. What are fragments in React and how are they used?
15. What is the purpose of the default props and how are they different from state ?
16. Explain the concept of a Higher-Order Component (HOC) and provide an example use case.
17. What are React Hooks and why were they introduced?
18. Compare and contrast useState , useEffect , and useContext hooks.
19. How would you create a custom React hook? Provide an example scenario.
20. Explain how you would implement error boundaries in React components.
21. What are controlled and uncontrolled components in React? Provide examples of each.
22. Describe how you would implement form handling and validation in React.
23. How do React portals work and when would you use them?
24. What is the Context API in React, and when should you use context instead of props?
25. How would you optimize a React component to prevent unnecessary re-renders?
26. What is the difference between componentDidMount and useEffect in React?
27. Describe how to use the useEffect hook to fetch data when a component mounts.
28. Explain the purpose of the useMemo hook and when to use it.
29. What is the useCallback hook and why is it useful in React?
30. How do you prevent a functional component from re-rendering when its props haven't changed?
31. Explain the lifecycle methods of a React class component (mounting, updating, unmounting).
32. How can you replicate componentDidUpdate or componentWillUnmount behavior in functional
components?
33. Describe how setState batching works in React and in what scenarios it occurs.
34. What is the significance of the dependency array in the useEffect hook?
35. Explain the concept of closures in React hooks with an example involving useEffect .
36. How do you handle side effects such as subscriptions or timers in React?

1
37. Why should you avoid setting state inside the render method of a React component?
38. How does React’s Strict Mode affect the behavior of your components during development?
39. What are memoized components in React and how do you create one?
40. Explain how you can force a component to re-render in React if needed.
41. Describe the diffing algorithm React uses to reconcile the Virtual DOM with the real DOM.
42. How does React determine which DOM elements need to be re-rendered after a state change?
43. Why should keys be unique among siblings in React lists? What problems can occur if keys are not
unique?
44. What happens behind the scenes in React when you update state on a component?
45. How would you explain React Fiber architecture and its benefits?
46. What are some techniques to optimize performance in a React application?
47. Explain the concepts of code-splitting and lazy loading in React.
48. How does React’s use of keys and memoization help with performance?
49. Discuss common causes of performance bottlenecks in React and how to identify them.
50. How would you optimize the rendering of a large list in React?
51. What is the difference between React’s virtualization (e.g., react-window ) and normal list
rendering?
52. How can PureComponent help optimize class components and what should you be careful about
when using it?
53. What are the pros and cons of using Redux vs the Context API for state management?
54. How do you connect a React component to a Redux store and dispatch actions?
55. Explain the flow of data in a Redux architecture (actions, reducers, store).
56. What is middleware in Redux, and how would you implement one?
57. Describe how to perform asynchronous actions in Redux (mention redux-thunk or redux-
saga ).
58. What is React Query (or Apollo) and how is it used for server state management?
59. Explain the concept of immutable state and why it matters in React and Redux.
60. How do you handle state updates in deeply nested objects without mutating state?
61. Describe how you would structure state in a large React application to avoid prop drilling.
62. What are some strategies for managing form state in React at scale (e.g., using Formik or React
Hook Form)?
63. What is server-side rendering (SSR) in the context of React, and what are its advantages and
disadvantages?
64. How does Next.js support SSR and static site generation for React apps?
65. How would you handle data fetching in a Next.js page for both server and client?
66. Explain the concept of hydration in SSR and what issues might arise.
67. What are the differences between Next.js and Create React App for building React applications?
68. How does React Router work, and how do you implement dynamic routing?
69. What is the difference between BrowserRouter and HashRouter in React Router?
70. Explain how you can do code-splitting on routes in a React application.
71. What are some ways to apply CSS styles to React components?
72. How does CSS-in-JS (e.g., styled-components) compare to traditional CSS for React?
73. How would you implement theming in a React application (e.g., light/dark mode)?
74. How would you test a React component? What tools and methods would you use?
75. Explain the difference between unit tests, integration tests, and end-to-end tests in the context of
React.
76. How do you simulate events and state changes in React component tests?

2
77. What is the container-presentational component pattern in React and when is it used?
78. Explain the concept of higher-order components vs render props vs hooks. When might you prefer
one over the others?
79. How do you handle errors in React, both synchronous and asynchronous?
80. How does React Error Boundary work, and what are its limitations?
81. Design a scalable component architecture for a large React application (folder structure, state
management).
82. How would you structure a React application that needs multi-language (i18n) support?
83. Describe how you would implement authentication in a React app, including token storage and
refresh logic.
84. Explain how you would optimize a React application for SEO.
85. How can you implement serverless functions (e.g., AWS Lambda) in a React app, and what are
common use cases?
86. How would you integrate a real-time data feature (e.g., chat or live notifications) in a React app?
87. What strategies would you use to manage application-wide loading and error states in React?
88. Describe how to handle file uploads in a React front-end application.
89. How would you approach migrating a legacy JavaScript app to React?
90. What considerations are there when making a React application accessible and user-friendly?
91. What are common security vulnerabilities in React applications (e.g., XSS) and how do you mitigate
them?
92. In React, what issues can arise from using array indexes as keys for list items?
93. Explain potential pitfalls with the useEffect hook (e.g., missing dependencies, infinite loops).
94. Why might direct DOM manipulation outside of React (e.g., using jQuery) be problematic?
95. How would you detect and fix a memory leak in a React application?
96. What is React.lazy and how does it work with Suspense for code-splitting?
97. How do you implement route-based code splitting in a React application?
98. What potential problems can arise when using React.memo , and how can they be mitigated?
99. How would you use the React Profiler to diagnose performance issues in an application?
100. What are some notable new features or improvements introduced in the latest version of React (e.g.,
React 18+)?

JavaScript Interview Questions


1. What are the different data types in JavaScript and how do you check for an array?
2. Explain the difference between == and === in JavaScript with examples.
3. How do let , const , and var differ in terms of scope and hoisting?
4. What are truthy and falsy values in JavaScript? Give examples of common falsy values.
5. Explain how JavaScript handles floating-point arithmetic precision (e.g., the 0.1 + 0.2 issue).
6. What is the difference between null and undefined in JavaScript?
7. How do you convert between strings and numbers in JavaScript?
8. Explain the purpose of the typeof operator and when it might give unexpected results (e.g.,
typeof NaN ).
9. What are the differences between array methods like map , filter , and forEach ?
10. How does the this keyword behave in different contexts (global, function, arrow functions)?
11. Explain first-class functions in JavaScript and how they enable functional programming concepts.
12. How do arrow functions differ from regular functions in terms of syntax and behavior (such as
this and arguments )?

3
13. What is a higher-order function in JavaScript? Provide an example.
14. What are closures in JavaScript, and how might you use them?
15. Explain what an IIFE (Immediately Invoked Function Expression) is and why it's useful.
16. How do call , apply , and bind methods work on JavaScript functions?
17. What is a callback function, and how do callbacks relate to asynchronous JavaScript?
18. What are generator functions and how do they work?
19. Explain how function constructors and the new keyword work in JavaScript.
20. What is function hoisting and how does it differ from variable hoisting?
21. How does JavaScript handle variable scope inside loops and functions (especially with var vs
let )?
22. What is closure scope? Provide an example of a closure capturing a local variable.
23. Explain the concept of the global execution context and how multiple execution contexts work with
the call stack.
24. What is the temporal dead zone in JavaScript, and how does it relate to let and const ?
25. Describe block scope vs function scope in JavaScript with var , let , and const .
26. Explain how prototypal inheritance works in JavaScript.
27. What is the difference between an object’s own properties vs inherited properties from its prototype?
28. How do you create a JavaScript class and how does it differ from a constructor function?
29. What are ES6 classes, and do they bring true class-based inheritance to JavaScript?
30. How does the __proto__ chain work, and what is the purpose of Object.create() ?
31. How do you select and manipulate DOM elements using vanilla JavaScript?
32. What is event delegation in JavaScript and why is it useful?
33. Explain the difference between event capturing and event bubbling in the DOM.
34. How do you prevent default behavior and stop propagation of events in JavaScript?
35. What is the purpose of the DOMContentLoaded event?
36. How can you create, append, and remove elements in the DOM with JavaScript?
37. Describe how querySelector and getElementById differ, and when you’d use each.
38. How can you optimize DOM manipulation to improve performance?
39. Explain how browser repaint and reflow work, and how to minimize layout thrashing.
40. What security considerations should you take into account when manipulating the DOM (e.g.,
avoiding innerHTML issues)?
41. How do you use the Fetch API to make HTTP requests in JavaScript?
42. Explain how to use localStorage and sessionStorage in the browser, and their use cases.
43. How do promises work, and how can you handle multiple promises (like Promise.all and
Promise.race )?
44. What are web workers and how do they help with performance in web applications?
45. Explain how the Intersection Observer API works and give a use case.
46. What are callbacks, promises, and async/await? How do they relate to each other?
47. How does the async/await syntax simplify working with asynchronous code?
48. What is promise chaining, and how does error handling differ in promise chains vs async/await?
49. Explain the concept of a microtask and macrotask in the JavaScript event loop.
50. What are common issues with callback hell and how do you avoid them?
51. How do setTimeout and setInterval work under the hood in the event loop?
52. Explain how fetch (or any promise-based function) does not block the JavaScript main thread.
53. What is the order of execution for asynchronous tasks ( setTimeout , Promise callbacks, I/O) in the
event loop?
54. How do you cancel a Promise or an asynchronous operation in JavaScript?

4
55. Explain how debouncing and throttling work for event handlers or API calls.
56. What are JavaScript modules and how do you import and export functionality between files?
57. Explain destructuring assignment for objects and arrays.
58. What are rest ( ...rest ) and spread ( ...spread ) operators and how are they used in JavaScript?
59. How would you explain arrow functions, and how do they handle this differently than normal
functions?
60. What are template literals in JavaScript and how can you use tagged templates?
61. How do you use default parameters in functions, and what are their benefits?
62. Explain how Map and Set data structures work in JavaScript and when to use them.
63. What are generator functions ( function* ) and how does the yield keyword work?
64. What are ES6 classes and how do they compare to constructor functions?
65. Explain what Symbol and Symbol.iterator are and give an example use case.
66. How does JavaScript garbage collection work and how can you write memory-efficient code?
67. What are some common causes of memory leaks in JavaScript applications, and how do you avoid
them?
68. How can closures lead to higher memory usage and what can you do to prevent leaks?
69. How do the mechanisms of call stack and heap memory allocation work in JavaScript?
70. What is a WeakMap or WeakSet and how do they relate to memory management?
71. How can you optimize loops and heavy computations for performance in JavaScript?
72. How would you measure and improve the performance of a piece of JavaScript code (e.g., using
Chrome DevTools)?
73. What is the Module pattern in JavaScript, and why is it useful?
74. Explain the Revealing Module Pattern.
75. How does the Immediately Invoked Function Expression (IIFE) pattern work, and why use it?
76. What is the Prototype Pattern and how is it implemented in JavaScript?
77. How do you debug JavaScript code and what tools can you use to assist debugging?
78. What is the difference between unit testing and end-to-end testing in JavaScript?
79. How would you write a unit test for a function using a framework like Jest or Mocha?
80. How can linters (like ESLint) help in catching bugs in JavaScript code?
81. What will be the output of [] + [] and why?
82. Explain odd behaviors of typeof NaN and how to correctly check for NaN .
83. What will be the result of comparing objects in JavaScript (e.g., {a:1} == {a:1} )?
84. Describe how you would implement a debounce function in JavaScript and when to use it.
85. How do you manage state in a complex front-end application (mention Redux or similar)?
86. Explain how you would structure code for a JavaScript project to keep it maintainable.
87. Describe how you would handle data fetching and caching on the client side.
88. How can you optimize loading of JavaScript resources on a webpage?
89. What considerations are there for internationalization (i18n) in a JavaScript application?
90. How would you implement error monitoring and logging in a JavaScript web app?
91. What is the purpose of a bundler (like Webpack) in a JavaScript project?
92. How do transpilers like Babel work, and why might you need them?
93. Explain the difference between npm and yarn, and what package-lock.json or yarn.lock is
for.
94. What are proxies in JavaScript, and how can they intercept object operations?
95. How do async iterators work, and what are use cases for them?
96. Explain the nullish coalescing operator ( ?? ) and optional chaining ( ?. ) with examples.
97. What are Typed Arrays in JavaScript and where are they used?

5
98. How do BigInt and Symbol differ from regular primitive types in JavaScript?
99. What is Cross-Site Scripting (XSS) and how can you prevent it in a JavaScript application?
100. How does Content Security Policy (CSP) help secure JavaScript applications from certain attacks?

Node.js Interview Questions


1. What is Node.js and how does it differ from a traditional web server environment?
2. Explain Node.js’s single-threaded architecture and how it handles concurrency.
3. What is the event loop in Node.js and how does it work with callbacks?
4. Explain the role of the V8 engine in Node.js.
5. What are global objects in Node.js (e.g., global , process , __dirname , __filename ) and
how are they used?
6. Describe the Node.js module system (CommonJS), and how you export and import modules.
7. How do you handle package management in Node.js, and what is npm?
8. Explain how Node.js handles asynchronous I/O operations.
9. What is the difference between synchronous and asynchronous APIs in Node.js?
10. How would you handle uncaught exceptions in a Node.js application?
11. What is the difference between require() and import in Node.js?
12. How does Node.js resolve module paths and what is node_modules ?
13. Explain the purpose of package.json and the significance of the "main" field.
14. What are native Node.js modules and how do you use them (e.g., fs , path )?
15. How does the Node.js event loop differ from the browser event loop?
16. What is libuv and what role does it play in Node.js?
17. Explain process.nextTick() and setImmediate() , and how they interact with the event loop
phases.
18. How do callbacks, promises, and async/await work in Node.js?
19. What is an EventEmitter in Node.js and provide an example of its usage.
20. Describe a scenario of callback hell and how you would avoid it.
21. How does Node.js handle CPU-intensive tasks given its single-threaded nature?
22. What are cluster or worker_threads in Node.js, and when would you use them?
23. Explain streams in Node.js (readable, writable, duplex) and when to use them.
24. How do uncaught exceptions differ in asynchronous callbacks vs Promise-based code?
25. How do you create a basic HTTP server in Node.js?
26. Explain handling HTTP requests and responses using Node’s http module.
27. How can you implement routing without using Express in Node?
28. What is the role of the package body-parser (or built-in express.json ) in handling HTTP
request bodies?
29. How do you handle file uploads in a Node.js server?
30. How would you handle CORS in a Node.js application?
31. Explain how keep-alive connections affect Node.js server performance.
32. Describe how you would implement API versioning in a Node.js REST API.
33. How can you scale a Node.js server to handle a large number of simultaneous connections?
34. What is HTTP/2, and how can you enable it in a Node.js server?
35. How do you read and write files asynchronously in Node.js?
36. Explain file streams vs reading an entire file in memory in Node.js.
37. How do you handle file paths and directories in Node.js?

6
38. What are some common pitfalls when working with the file system in Node.js (permissions, blocking,
etc.)?
39. Explain how to watch for file changes in Node.js ( fs.watch , fs.watchFile ).
40. What are the different types of streams in Node.js (Readable, Writable, Duplex, Transform)?
41. How do you handle backpressure with Node.js streams?
42. Give an example of piping streams together (e.g., reading a file and sending it over HTTP).
43. What is the purpose of stream events like 'data' , 'end' , and 'error' ?
44. How do you create a custom Transform stream in Node.js?
45. What is Express.js and how does it simplify Node.js server creation?
46. How do you set up middleware in Express, and what are common middleware types?
47. Explain route parameters, query parameters, and the difference in Express.
48. How can you handle errors in Express (error-handling middleware)?
49. How do you set up template engines with Express (e.g., Pug/EJS)?
50. How do you use Express.Router to create modular routes?
51. Explain how to serve static files with Express.
52. How do you implement user authentication in Express (sessions, JWT, OAuth)?
53. What is CORS and how do you enable/configure it in an Express app?
54. How would you implement rate limiting in an Express.js application?
55. How do you connect to a MongoDB/MySQL database from Node.js?
56. How do you perform CRUD operations in Node.js with a database (briefly explain using a library/
ORM like Mongoose or Sequelize)?
57. What is an ORM (e.g., Sequelize or TypeORM) and what are the pros and cons of using one in
Node.js?
58. What are common security vulnerabilities in Node.js applications (e.g., SQL injection, XSS, CSRF) and
how do you mitigate them?
59. How would you implement input validation and sanitization in a Node.js application?
60. Explain how to store and manage environment variables securely in Node.js.
61. How do you secure sensitive data (like API keys or database credentials) in a Node.js project?
62. What is Helmet, and how does it help improve the security of an Express app?
63. How do you containerize a Node.js application (e.g., using Docker)?
64. What is PM2 and how can it help in managing a Node.js process?
65. Explain how to set up logging in a Node.js application for production (use tools like Winston or
Bunyan).
66. How do you perform zero-downtime deployments of a Node.js app?
67. How do you write unit tests for Node.js modules (mention frameworks like Mocha, Jest)?
68. Explain how to mock dependencies when unit testing a Node.js function.
69. How do you debug a Node.js application (using console, Node Inspector, or VS Code)?
70. What is the difference between unit tests and integration tests in Node.js?
71. How do you use async/await in tests when testing async functions in Node.js?
72. How do you handle uncaught exceptions and unhandled promise rejections in Node.js testing?
73. How do you profile a Node.js application to find performance bottlenecks?
74. What is clustering in Node.js, and how does it help with scalability?
75. How would you scale Node.js horizontally in a cloud environment (e.g., using load balancers,
multiple instances)?
76. What are some best practices to reduce memory leaks in a long-running Node.js application?
77. How does Node.js handle CPU-bound tasks and how can you offload heavy computations?
78. What is the impact of synchronous code on Node.js performance and how to avoid it?

7
79. Explain how caching (e.g., using Redis) can improve the performance of a Node.js service.
80. Explain the MVC or MV* pattern in the context of a Node.js web application.
81. What is middleware layering and how is it similar to or different from the pipeline pattern?
82. How would you structure a Node.js project with multiple routes, controllers, and services for
maintainability?
83. Explain the event-driven architecture and how it can be implemented with Node.js (mention
EventEmitter or message queues).
84. What are microservices, and how would you use Node.js to build a microservices architecture?
85. Design an API authentication flow in Node.js (e.g., user login with JWT, token refresh).
86. How would you implement a WebSocket or real-time notification service in Node.js?
87. Describe how you would handle file uploads and storage (e.g., to S3) in a Node.js application.
88. How would you implement pagination and sorting of large datasets in a Node.js API?
89. Describe how to handle large file streaming (e.g., video streaming) in Node.js.
90. How can you implement transaction support if using a database that supports it?
91. What considerations would you make for internationalization (i18n) in a Node.js backend?
92. How do you implement rate limiting and IP throttling in a Node.js API?
93. What is the best way to log and monitor a Node.js microservices architecture in production?
94. How would you ensure the resiliency of a Node.js service (handling crashes and restarts)?
95. How do you use ES6 import / export syntax in Node.js (and what configuration might be
needed)?
96. What is the difference between using .mjs files and setting "type": "module" in
package.json ?
97. What happens if you forget to use await with an asynchronous function in Node.js?
98. Why might require() behave differently when caching modules, and what issues can it cause?
99. What is process.env.NODE_ENV , and how is it typically used in Node.js apps?
100. Explain how the cluster.fork() method works in Node.js.

MERN Stack Interview Questions


1. Explain how MongoDB stores data and how it differs from relational databases.
2. How do you design a schema in MongoDB for a given data model?
3. Explain the differences between embedded documents and references in MongoDB.
4. How do you perform basic CRUD operations in MongoDB?
5. What are indexes in MongoDB, and how do they improve query performance?
6. How do you handle relationships (one-to-one, one-to-many, many-to-many) in MongoDB?
7. Explain the MongoDB aggregation framework and give an example of a pipeline stage.
8. What are MongoDB transactions and when would you use them?
9. How does MongoDB handle replication and sharding?
10. What are some considerations for scaling a MongoDB database?
11. What is Mongoose and why is it used in Node.js projects with MongoDB?
12. How do you define a schema and a model using Mongoose?
13. Explain how middleware (pre and post hooks) works in Mongoose.
14. How do you perform population (join-like behavior) in Mongoose?
15. How do you handle validation and default values in Mongoose schemas?
16. How would you structure routes and controllers in an Express app for a RESTful API?
17. Explain how to handle middleware for authentication (e.g., JWT) in Express.
18. How do you implement pagination and filtering in an Express API?

8
19. What are the pros and cons of using middleware libraries like body-parser vs built-in parsers?
20. How can you integrate an Express API with the React front end (e.g., enabling CORS)?
21. Describe error-handling patterns in an Express API (e.g., try/catch vs error middleware).
22. How do you implement input validation in Express (e.g., using Joi or express-validator)?
23. What is the difference between RESTful APIs and GraphQL, and what are use cases for each?
24. How would you design a GraphQL schema for a MERN stack application?
25. When using GraphQL with MongoDB, what are common pitfalls and how do you handle them?
26. How would you implement user authentication in a MERN application using JWT?
27. How do you handle storing JWT tokens securely on the client side?
28. What is the difference between session-based authentication and token-based authentication?
29. Explain how password hashing works (using bcrypt) in a Node/Express backend.
30. How do you implement role-based access control in a MERN stack app?
31. How do you fetch data from the Node/Express backend in a React application?
32. Explain how you would handle CORS when connecting React front end to a Node API.
33. How can you manage environment-specific configurations for client and server (development vs
production)?
34. Describe how you would deploy a MERN stack application end-to-end (hosting for front end and back
end).
35. How do you share code (utilities, validation schemas) between the front end and backend in a MERN
project?
36. Explain how server-side rendering (SSR) might be implemented in a MERN stack app (e.g., using
Next.js with Node backend).
37. How would you handle form state and submission in React when data is saved to a MongoDB
database?
38. Describe how to implement real-time updates (e.g., using Socket.io) in a MERN app.
39. How do you manage session or token renewal (refresh tokens) in a MERN stack application?
40. Explain how to integrate third-party services (e.g., payment processing, email) into a MERN stack
app.
41. How would you set up logging across the MERN stack for debugging and monitoring?
42. Describe how you would version APIs in a MERN application.
43. How would you containerize a MERN stack application with Docker?
44. Explain how to set up continuous integration and deployment for a MERN app (mention platforms
like GitHub Actions, Jenkins).
45. What should be included in a .gitignore file for a MERN project?
46. How do you configure environment variables for a MERN application in different environments?
47. How would you set up a build pipeline for the React front end and Node back end?
48. How do you design a normalized vs denormalized data model in MongoDB? Provide examples.
49. Explain considerations when modeling hierarchical or tree data structures in MongoDB.
50. How would you handle many-to-many relationships in a NoSQL database like MongoDB?
51. Explain the process of migrating a database schema or updating data in a MERN app.
52. How do you efficiently query deeply nested MongoDB documents?
53. Describe the pros and cons of embedding documents versus referencing in MongoDB for
relationships.
54. How can you implement indexing strategy in MongoDB for a given query pattern?
55. Explain how you would handle geospatial queries in MongoDB if needed.
56. What techniques can you use to improve performance of a MERN stack application (both front end
and back end)?

9
57. How do you optimize MongoDB queries (explain indexing and avoiding large document scans)?
58. How do you use caching (e.g., Redis or in-memory caches) in a MERN app to speed up responses?
59. Explain how to optimize bundle size and load time of a React application.
60. How would you profile and debug performance issues in a Node server or React front end?
61. Design a blogging platform using the MERN stack: what would the major components and data
models look like?
62. How would you implement a search feature (with text search or filters) in a MERN application?
63. Describe how to implement file uploads (images, documents) in a MERN stack app, including storage
(local vs cloud).
64. How would you implement a comment or chat feature that allows real-time updates?
65. How do you handle offline use or data synchronization in a MERN stack application (PWA concepts)?
66. Describe how to integrate social login (Google, Facebook) into a MERN app.
67. How would you implement notifications (email or push) in a MERN application?
68. Explain how you would handle multi-step forms or wizards in React with data saved to backend.
69. Design an analytics dashboard with charts in React that fetch data from Node/Mongo.
70. How would you implement a marketplace or e-commerce flow in a MERN app (product listing, cart,
orders)?
71. Describe handling concurrency issues in a MERN stack (e.g., race conditions on updating inventory).
72. Explain strategies for database backup and recovery for a MongoDB used by the app.
73. How do you handle migrations and versioning of API endpoints over time?
74. What logging and monitoring tools would you integrate for a production MERN stack app?
75. How would you implement multi-tenant architecture in a MERN stack (serving multiple clients with
one codebase)?
76. Describe how to implement role-based dashboards or features (admin vs user views) in MERN.
77. How would you ensure high availability and fault tolerance for a MERN application in production?
78. What are common security threats in a MERN stack (e.g., injection, XSS, CSRF) and how do you
protect against them?
79. How do you securely store and verify user passwords in the MERN stack?
80. Explain how to protect your APIs with authentication and authorization in MERN.
81. How do you prevent NoSQL injection in MongoDB queries?
82. What is CORS, and how do you configure it securely for your React front end and Express back end?
83. How do you secure session cookies or tokens in a browser environment for authentication?
84. Explain how to implement HTTPS/SSL for a MERN application.
85. How would you use Helmet or similar middleware for security in your Express server?
86. How would you design a scalable notification service using the MERN stack?
87. Design an architecture for a multi-regional deployment of a MERN application (CDN, database
replication).
88. How would you set up continuous data synchronization between multiple database instances?
89. Explain how you would incorporate a search engine (like Elasticsearch) into a MERN stack
application.
90. How would you design the architecture for handling push notifications to mobile/web clients from
your MERN backend?
91. Describe designing a decoupled microservices architecture with a React front end and multiple Node
services.
92. How do you ensure your MERN stack services can recover from partial failures (circuit breaker,
retries)?
93. What considerations are there when designing real-time features (WebSockets vs polling) for a MERN
app?

10
94. What makes a React application a Progressive Web App (PWA) and how do you implement PWA
features?
95. How would you implement offline caching strategies (service workers) in a MERN stack?
96. How would you write end-to-end tests for a MERN application (mention tools like Cypress)?
97. What is the role of tools like Postman or Swagger when developing a MERN stack API?
98. How can TypeScript or code linting improve your MERN stack development process?
99. How do environment-specific configurations (like dev/test/prod) work across a MERN app?
100. How would you implement feature toggles or flags in a MERN stack for rolling out features?

HTML Interview Questions


1. What is the purpose of the <!DOCTYPE html> declaration in an HTML document?
2. How do you include HTML comments and are they rendered by the browser?
3. What are the essential elements of an HTML document ( <html> , <head> , <body> )?
4. Explain the difference between block-level and inline elements with examples.
5. How do semantic tags (like <article> , <section> , <header> , <footer> ) improve a
document?
6. What is the difference between an id attribute and a class attribute in HTML?
7. How do you link a CSS file and a JavaScript file in HTML?
8. Explain the purpose of the <meta charset> and <meta viewport> tags.
9. What is the significance of the lang attribute in the <html> tag?
10. How do you include images and provide responsive images (using srcset and sizes )?
11. What is the role of the <head> section in an HTML document?
12. How do you specify a character encoding for an HTML page?
13. What are some common elements found in the head (e.g., <title> , <meta> , <link> ,
<script> )?
14. How do you create a favicon for a website?
15. Explain how semantic HTML elements improve accessibility and SEO.
16. When would you use <section> vs <div> vs <article> ?
17. Explain the use of <figure> and <figcaption> elements.
18. What is the HTML5 <nav> element used for?
19. How do you emphasize text in HTML (e.g., <em> , <strong> , <b> , <i> ) and what is the
semantic difference?
20. Explain the roles of <span> and <div> elements.
21. How do HTML entities work (e.g., &amp; , &lt; , &gt; ) and why are they needed?
22. What are global attributes in HTML? Give examples (e.g., id , class , data-* ).
23. How do you use the data-* attribute and what is a use case for custom data attributes?
24. What does the HTML attribute loading do when used on <img> or <iframe> ?
25. Explain how the alt attribute works on images and why it's important.
26. What is the purpose of the placeholder attribute in input elements?
27. How do you create an ordered list, unordered list, and a definition list in HTML?
28. Explain how tables work in HTML ( <table> , <tr> , <td> , <th> , <thead> , <tbody> ,
<tfoot> ).
29. How do you make a table accessible (e.g., using scope on <th> )?
30. What is the purpose of the <caption> element in a table?
31. How can you make a list of items into a horizontal navigation menu using only HTML?
32. What are the different types of form input elements in HTML5 (e.g., text, email, date, range)?

11
33. How do you group related form controls (hint: <fieldset> and <legend> )?
34. Explain how the <label> element works and why it's important for form accessibility.
35. What is client-side form validation in HTML and which attributes facilitate it (e.g., required ,
pattern )?
36. How do you disable a form input or a button in HTML?
37. What are <select> and <option> elements and how do you use them?
38. Explain the purpose of <textarea> and how it differs from <input type="text"> .
39. How do you create a radio button group and ensure only one option is selectable?
40. How can you allow multiple selections in a list in HTML (e.g., <select multiple> )?
41. How do you handle file uploads in HTML forms (what enctype is needed and which input type)?
42. Explain how HTML5 introduced new form input types (date, email, number, range) and their benefits.
43. What is the purpose of the action and method attributes on a <form> element?
44. How can you make a form element send a GET request and display parameters in the URL?
45. What are form attributes like autocomplete , novalidate , and how do they affect behavior?
46. How do you create a button that submits a form and one that resets a form?
47. Explain how to create an accessible and mobile-friendly form layout.
48. How do you embed a video or audio in an HTML page?
49. What are the differences between <video> and <iframe> for embedding media?
50. How do you provide multiple sources for a video or audio (e.g., different formats)?
51. Explain the purpose of <picture> and <source> elements for responsive images.
52. What is the role of the <canvas> element in HTML5?
53. What are the purpose of <header> , <footer> , <nav> , <main> , <aside> elements?
54. How would you define a navigation section in HTML?
55. Explain how to structure a webpage with a header, navigation, main content, and footer.
56. What is the <aside> element used for?
57. Why is <main> important in HTML5?
58. What is ARIA and how do ARIA roles help with accessibility?
59. Why should every image have an alt attribute?
60. How do you make a form accessible to screen readers?
61. What HTML attributes or elements improve keyboard navigation?
62. Explain the importance of semantic HTML in accessible design.
63. What are some new semantic elements introduced in HTML5?
64. What is local storage and session storage in HTML5, and how do you access them?
65. Explain how Web Workers are related to HTML5 and when to use them.
66. What are HTML templates ( <template> ) and how are they used?
67. What is the HTML5 <details> and <summary> element used for?
68. How do you include special characters or symbols (like ©, ™) in HTML?
69. What is the difference between numeric character references and named entities in HTML?
70. What is the purpose of meta tags like description , keywords , and viewport ?
71. How do you use the <title> tag effectively for SEO?
72. What are Open Graph meta tags and how do they relate to social media sharing?
73. How do canonical links ( <link rel="canonical"> ) help with SEO?
74. Why is it important to use proper heading levels ( <h1> – <h6> ) in HTML?
75. How does the defer and async attribute on <script> tags affect page loading?
76. How can you preload or prefetch resources in HTML?
77. Why is it important to put CSS <link> tags in <head> and scripts at the bottom of the body?
78. How would you structure the HTML for a simple responsive grid layout using only HTML and CSS?

12
79. Describe best practices for organizing your HTML files and assets in a project.
80. How do you ensure cross-browser compatibility for HTML/CSS features?
81. How would you create a modal dialog in pure HTML/CSS (and possibly a bit of JS for toggling)?
82. What considerations are there for supporting older browsers with HTML (HTML5shiv, etc.)?
83. How do you include favicons and touch icons for different platforms (mobile, desktop)?
84. How would you create an HTML email template that works across different email clients?
85. What is the purpose of the <noscript> tag and when should you use it?
86. How do you optimize the delivery of HTML content for slow networks?
87. How would you implement a sticky header or footer in HTML/CSS?
88. What role do HTTP headers like Content-Type play in serving HTML?
89. What happens if you nest a <p> tag inside another <p> tag?
90. Can you have multiple <h1> tags on a single page, and is it valid HTML5?
91. What issues might arise from missing a closing tag (e.g., </li> )?
92. Explain how browsers handle unknown HTML tags.
93. What is the effect of using <iframe sandbox> and how does it improve security?
94. How do you include SVG images in HTML, and what's the difference between <img src="..."> vs
inline <svg> ?
95. What is the difference between setting CSS on an element vs using inline style in HTML?
96. How can you include external resources (fonts, icons) in HTML?
97. Explain Content Security Policy (CSP) meta tag usage in an HTML page.
98. How do you specify the language and character encoding to ensure correct display of non-English
text?
99. What is the purpose of the <base> tag in HTML?
100. How do you use the <link rel="preconnect"> tag and why is it useful?

CSS Interview Questions


1. What are the different types of CSS selectors (element, class, id, attribute, pseudo) and how do they
work?
2. Explain the CSS cascade and inheritance: how does the browser determine which styles apply?
3. What is the difference between class selectors and id selectors in CSS in terms of specificity?
4. How do combinator selectors (descendant, child > , adjacent sibling + , general sibling ~ ) work in
CSS?
5. Explain how to use attribute selectors in CSS (e.g., a[href] , input[type="text"] ).
6. What is a pseudo-class and a pseudo-element in CSS? Give examples (e.g., :hover , ::before ).
7. What does the CSS rule * { box-sizing: border-box; } do?
8. How do external, internal, and inline styles differ, and what are the advantages of each?
9. How would you include CSS from an external file vs inline style attribute vs <style> tag?
10. What are shorthand properties in CSS (e.g., margin , padding , font )?
11. Explain the CSS content property and where you might use it.
12. How do CSS variables (custom properties) work and how do you define and use one?
13. What happens if you specify the same CSS property more than once in a rule?
14. How do you apply multiple classes to the same HTML element?
15. Explain the use of !important in CSS and why it should be avoided.
16. Describe the CSS box model and its components (content, padding, border, margin).
17. How do width and height behave differently when box-sizing is set to border-box vs
content-box ?

13
18. How can margin collapsing occur between elements?
19. How do padding and margin differ in terms of their effect on element size and spacing?
20. What is the difference between element margin, border, and padding in terms of layout?
21. Explain the different CSS position values: static , relative , absolute , fixed , and
sticky .
22. What is the effect of setting an element to position: relative versus position: absolute ?
23. How does the z-index property work with positioned elements?
24. How do floats work in CSS, and what common layout patterns use floats?
25. How do you clear floats and why might you need to do it?
26. Explain how a sticky positioned element behaves in the flow of a page.
27. What is the default position of an element with no positioning specified?
28. Describe the concept of stacking context in CSS.
29. How would you center a block-level element horizontally and vertically using CSS?
30. When would you use fixed positioning and what are its limitations?
31. What is Flexbox and what problems does it solve?
32. Explain the main axis and cross axis in a flex container.
33. How do justify-content and align-items differ in flexbox?
34. What does the flex property represent (flex-grow, flex-shrink, flex-basis)?
35. How do you make a flexbox container and how do you make its children flexible?
36. What is CSS Grid and how does it differ from Flexbox?
37. How do you define a grid container and specify row/column sizes?
38. Explain the use of grid-template-areas for naming layout sections.
39. How do you place an item in a specific grid cell using grid-row and grid-column ?
40. How does auto-fill or auto-fit work in CSS Grid?
41. What is the difference between minmax() and fr units in CSS Grid?
42. How do you make a responsive layout using CSS Grid?
43. How do media queries work and give an example of a typical responsive breakpoint query.
44. What are viewport meta tags and why are they important for responsive design?
45. Explain the difference between adaptive design and responsive design.
46. How do you use relative units ( em , rem , % ) to make layouts flexible?
47. How do you make images responsive with CSS?
48. What are CSS frameworks (Bootstrap, Tailwind) and how do they assist in responsive design?
49. How would you hide or show elements on certain screen sizes using CSS?
50. Explain the concept of mobile-first CSS and why it’s recommended.
51. How do you include web fonts (e.g., from Google Fonts) in CSS?
52. What is the difference between em and rem units for font sizes?
53. How do you use text-align , line-height , and letter-spacing in CSS?
54. Explain how you would use @font-face to load a custom font.
55. What are CSS typography properties like font-weight , font-style , and font-family ?
56. How do you specify colors in CSS (hex, rgb , rgba , hsl , named colors)?
57. How do you create a gradient background in CSS?
58. Explain how opacity and transparent colors work in CSS.
59. What are some common pseudo-classes and pseudo-elements and how are they used
( :hover , :active , ::before )?
60. How would you use ::before and ::after for decorative content?
61. What is the difference between :nth-child(n) and :nth-of-type(n) ?
62. How do you style visited links differently from unvisited links?

14
63. What do the CSS selectors :root and :target represent?
64. How is CSS specificity calculated?
65. What is an example of a rule that has high specificity (inline vs ID vs class vs element)?
66. How does the !important flag affect specificity?
67. How do you rotate, scale, or skew an element using CSS transforms?
68. Explain how transitions work in CSS and provide an example of a hover effect using transition.
69. How do you define a keyframe animation and apply it to an element?
70. What properties can be animated in CSS, and how do you optimize animations for performance?
71. How would you use the transform-origin property in CSS animations?
72. What are CSS preprocessors (like SASS or LESS) and what features do they provide?
73. How do SASS mixins and variables improve code maintainability?
74. How do you compile a SASS or LESS file into CSS?
75. What are CSS custom properties (variables) and how do you use them in pure CSS?
76. How do CSS variables differ from SASS variables?
77. What tools or techniques can you use to debug CSS layout issues?
78. How do browser DevTools help you inspect and modify CSS on the fly?
79. What is a CSS reset or normalize.css and why might you use one?
80. How does minification of CSS help performance?
81. What is critical CSS and how do you inline it for performance?
82. How do you reduce repaint and reflow for smoother animations?
83. Describe how you would structure a CSS project to avoid conflicts (e.g., naming conventions like
BEM).
84. How do CSS frameworks (like Bootstrap, Tailwind) and CSS-in-JS (styled-components) compare in
practice?
85. How would you implement a dark mode theme toggle using CSS?
86. Explain how to handle browser compatibility (prefixes, fallbacks) in CSS.
87. How do you make a sticky footer using CSS?
88. What are CSS media queries for print, and how would you style a page for printing?
89. How would you style an HTML form to be user-friendly and accessible?
90. How do you create a grid of cards (responsive card layout) in CSS?
91. What are some best practices for CSS performance on high-resolution displays?
92. How do you debug a “flicker” or “jump” caused by CSS transitions?
93. How would you implement an accessible dropdown menu using only CSS?
94. How can you vertically center content using different CSS techniques?
95. How do you create a CSS-only tooltip or modal (using pseudo-classes)?
96. How can you improve CSS maintainability in a large application?
97. What are container queries in CSS and how might they be used?
98. Explain CSS Subgrid and how it's used.
99. How do the CSS units vw , vh , vmin , vmax work?
100. What is the difference between box-shadow and text-shadow ?

15

You might also like