Top Node.js Interview Questions & Answers #nodejs #reactjs #javascript #wipro
#nodejs #interviewpreparation #backenddeveloper #javascript #codinginterview #techjobs #nodejsinterview #programming #softwareengineer #webdevelopment #learncoding #developers #interviewquestions #2026jobs #placements NODE.JS / BACKEND Q&A 1. What happens if autoConnect is set to false in Socket.IO? Answer: If autoConnect is set to false, the connection will not start automatically. You must manually call manager.open(). 2. What does Nodemon do if no script is provided? Answer: Nodemon looks for package.json and executes the file specified in the main property. 3. How do you connect to Node.js debugger started with --inspect? Answer: Use the webSocketDebuggerUrl to establish a direct connection. 4. How do you create an SSH tunnel for remote debugging? Answer: ssh -L 8331:localhost:8339 [email protected] 5. How to optimize Node.js server for I/O-heavy operations? Answer: Use non-blocking asynchronous operations. 6. Which method starts a Node.js HTTP server? Answer: server.listen() DOCKER Q&A 7. Which instruction exposes a port in Dockerfile? Answer: EXPOSE 8080 8. Which flag maps host port to container port? Answer: -p flag Example: docker run -p 8080:3000 app JAVASCRIPT / LODASH Q&A 9. What placeholder is used in Lodash curry? Answer: _.curry.placeholder TYPESCRIPT Q&A 10. What are user-defined types in TypeScript? Answer: Interface, Class, Enum, Tuple, Array, Function 11. What happens if you access a private property outside a class? Answer: Compile-time error: Property is private and only accessible within the class. 12. How to initialize properties in a constructor? Answer: constructor(c: string, d: string, a: number) { this.client = c; this.details = d; this.amount = a; } JWT / SECURITY Q&A 13. How do you generate a JWT? Answer: jwt.sign(payload, secret) 14. How do you verify a JWT? Answer: jwt.verify(token, secret) 15. How to extract JWT from Authorization header? Answer: const token = req.headers.authorization?.split(' ')[1]; APTITUDE 16. Two shirts sold at 1200 each, one at 20% profit and one at 20% loss. Find net loss. Answer: Net loss = 4%
Download
0 formatsNo download links available.