Web Developer Intern Interview Preparation - Hetavi Modi
1. Technical Questions (Web Development) - Frontend
Q: How does the virtual DOM work in React?
A: The virtual DOM is a lightweight in-memory representation of the real DOM. When the state changes, React updates
the virtual DOM, compares it with the previous version (diffing), and only applies the changed parts to the actual DOM,
improving performance.
Q: Difference between class and functional components?
A: Class components use ES6 classes and have lifecycle methods; functional components are simpler, use hooks like
useState and useEffect, and are more concise and efficient for modern development.
Q: How do you manage component state in React?
A: I use useState for local state and useContext or Redux when global state sharing is needed.
Q: How would you make a website responsive?
A: Using CSS media queries, flexible layouts (like Flexbox or Grid), percentage widths, and frameworks like Bootstrap.
Q: Difference between id and class in CSS?
A: id is unique and used for one element; class can be used for multiple elements. Use id for unique styles and class for
reusable styles.
1. Technical Questions (Web Development) - Backend
Q: How does Express.js handle routing?
A: Express uses the app.get(), app.post(), etc., methods to define routes. Each route takes a path and a callback
function.
Q: How do you connect MongoDB with Node.js?
A: Using Mongoose or the MongoDB native driver. Example:
mongoose.connect("mongodb://localhost:27017/dbname", { useNewUrlParser: true });
Q: What are middlewares in Express.js?
A: Functions that execute during the request-response cycle. They can modify request/response objects or end the
cycle (e.g., for authentication, logging, error handling).
Q: How would you secure sensitive routes?
A: Use JWT tokens, middleware checks, input validation, and HTTPS.
Q: HTTP status codes?
200 OK - Success
201 Created - Resource created
400 - Bad request
401 - Unauthorized
Web Developer Intern Interview Preparation - Hetavi Modi
403 - Forbidden
404 - Not Found
500 - Internal Server Error