Node.js / Memory Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

34 Node.js / Memory interview questions from Amazon, Razorpay, TCS, Infosys, General, Stripe and more. Real questions from Technical, System Design, and HR rounds.

34 questions
Companies: Amazon, Razorpay, TCS, Infosys…

All Node.js / Memory Questions

Amazon Hard Screening round 4-7 years

Explain the Node.js event loop phases in order. A setTimeout(fn, 0) and setImmediate(fn) are both queued. Which runs first and why? What if they're inside an I/O callback?

↑ 81 upvotes · 49 engineers asked this · SDE2
TCS Medium Scenario round 2-5 years

Your Node.js API uses async/await throughout. A developer reports that errors thrown in async route handlers are causing the process to crash with 'UnhandledPromiseRejectionWarning'. What's the architectural fix?

↑ 80 upvotes · 48 engineers asked this · SDE2
General Hard System Design round 5-8 years

You're building a WebSocket server in Node.js that needs to broadcast messages to 50,000 concurrent connections. A naive broadcast loops through all 50,000 and calls socket.send(). What's wrong with this and how do you fix it?

↑ 79 upvotes · 47 engineers asked this · SDE2
Amazon Hard Technical round 3-6 years

A Node.js service crashes every night at 2 AM with 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory'. There's a cron job that runs at 1:55 AM. Explain the likely cause and your fix.

↑ 78 upvotes · 46 engineers asked this · SDE2
Razorpay Hard System Design round 5-9 years

Design a rate limiter in Node.js that allows 100 requests per user per minute. It must work across multiple Node.js instances without a central Redis lock causing a bottleneck.

↑ 77 upvotes · 45 engineers asked this · Staff
Infosys Medium Technical round 2-4 years

Your Node.js app has a middleware that adds request logging. In production, every slow request shows the same log message appearing 3 times. Why might this happen?

↑ 76 upvotes · 44 engineers asked this · SDE2
TCS Hard Scenario round 3-6 years

You need to process 100,000 CSV rows in Node.js without blocking the event loop and without running out of memory. The file is 2GB. How do you implement this?

↑ 75 upvotes · 43 engineers asked this · SDE2
TCS Hard Technical round 3-6 years

Your Express.js API endpoint returns data in 80ms locally but 800ms in production. Both use the same database. What are the likely causes and how do you systematically investigate?

↑ 74 upvotes · 42 engineers asked this · SDE2
Amazon Hard Scenario round 3-7 years

Explain graceful shutdown in a Node.js service. What happens to in-flight requests when you kill the process without it?

↑ 74 upvotes · 32 engineers asked this · SDE2
Razorpay Hard Scenario round 4-7 years

A Node.js microservice processes background jobs from a Redis queue. Under load, jobs fail and retry endlessly, creating a death loop that blocks the queue. How do you implement a proper retry strategy with dead letter handling?

↑ 73 upvotes · 41 engineers asked this · SDE2
General Hard Scenario round 3-6 years

Your Node.js app needs to tail a large log file (100GB, growing) and stream new lines to connected clients via WebSocket. How do you implement this efficiently?

↑ 73 upvotes · 31 engineers asked this · SDE2
Amazon Hard Technical round 3-6 years

Your Node.js API has memory usage growing from 100MB to 800MB over 24 hours with stable traffic. How do you find the leak?

↑ 73 upvotes · 51 engineers asked this · SDE2
Amazon Hard Scenario round 4-8 years

Your Node.js API handles 500 requests/second in staging. In production at 2000 req/sec, memory climbs to 8GB and the process crashes after 20 minutes. How do you diagnose and fix this?

↑ 72 upvotes · 40 engineers asked this · SDE2
Amazon Hard Screening round 5-9 years

What is the N-API and why is it important for Node.js native addons? When would you write a native addon?

↑ 72 upvotes · 30 engineers asked this · Staff
TCS Hard Technical round 3-6 years

Your Node.js app uses the 'cluster' module with 8 workers. A user's session is stored in memory. Requests from the same user hit different workers randomly. What breaks and how do you fix it?

↑ 71 upvotes · 29 engineers asked this · SDE2
Amazon Hard System Design round 4-8 years

Design a Node.js service that must process exactly one event per user per day (deduplication). Events arrive out of order and can have duplicates. You have Redis available.

↑ 70 upvotes · 28 engineers asked this · SDE2
TCS Medium Technical round 2-5 years

Your Express API has a middleware that measures response time. You notice async route handlers are reporting incorrect times (too short). Why?

↑ 69 upvotes · 27 engineers asked this · SDE2
Amazon Hard Screening round 4-7 years

Explain the difference between process.nextTick() and Promise.then() in the event loop. Which executes first?

↑ 68 upvotes · 26 engineers asked this · SDE2
General Hard System Design round 3-7 years

You're building a Node.js API that needs to process uploaded images: resize to 3 formats, upload to S3, and update database. How do you design this for high throughput?

↑ 67 upvotes · 25 engineers asked this · SDE2
Amazon Hard Scenario round 3-7 years

Your Node.js service uses Express and you want to implement request tracing across microservices. Each log line should show the same trace ID for the same request, even across async operations.

↑ 66 upvotes · 24 engineers asked this · SDE2
Amazon Hard Screening round 3-6 years

Explain how Node.js handles CPU-intensive tasks without worker threads. What happens to the event loop and all pending HTTP requests while a heavy computation runs?

↑ 65 upvotes · 23 engineers asked this · SDE2
Amazon Medium Technical round 2-5 years

Implement a JavaScript function that throttles another function: no matter how many times it's called, it executes at most once per N milliseconds.

↑ 42 upvotes · 30 engineers asked this · SDE2
Amazon Hard Technical round 4-7 years

Write a function to deep clone a JavaScript object without using JSON.parse/JSON.stringify. Handle: Date, RegExp, undefined, circular references.

↑ 34 upvotes · 22 engineers asked this · SDE2
TCS Medium Scenario round 2-5 years

Your Express app serves API and static files. Under load, static file serving consumes most of CPU. How do you fix this?

↑ 33 upvotes · 51 engineers asked this · SDE2
Amazon Hard Screening round 3-6 years

Explain how Node.js DNS resolution can unexpectedly block your service.

↑ 32 upvotes · 50 engineers asked this · SDE2
Amazon Hard Screening round 4-7 years

What are Worker Threads in Node.js and how do they differ from child_process.fork()?

↑ 31 upvotes · 49 engineers asked this · SDE2
Stripe Medium Technical round 3-6 yearsNode.jsSystem DesignKafka

Design a webhook delivery system that must guarantee at-least-once delivery to customer endpoints, with retries and backoff, without letting one slow customer endpoint block delivery to others.

↑ 31 upvotes · 14 engineers asked this · Senior SDE
General Hard System Design round 3-7 years

Design a Node.js service that handles file uploads up to 500MB. Multiple instances run in containers. Where should uploaded files go?

↑ 30 upvotes · 48 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

What is Node.js's unhandledRejection event? How does it behave differently in Node 15+ vs earlier versions?

↑ 29 upvotes · 47 engineers asked this · SDE2
TCS Hard Technical round 2-5 years

A developer has written res.send(eval(req.body.expression)) in your Express app. What are all the problems?

↑ 28 upvotes · 46 engineers asked this · SDE2
General Hard Scenario round 3-6 years

Your Node.js service sends 10K emails per hour. Email provider rate-limits at 100/second. How do you implement this without losing emails?

↑ 27 upvotes · 45 engineers asked this · SDE2
General Hard Technical round 2-5 years

Your Node.js API loses precision on large numbers (e.g., 9007199254740993 becomes 9007199254740992). What's happening?

↑ 26 upvotes · 44 engineers asked this · SDE2
TCS Medium Screening round 2-5 years

What is the difference between require() and ES module import in Node.js? What problems arise when mixing them?

↑ 25 upvotes · 43 engineers asked this · SDE2
Razorpay Hard Scenario round 4-8 years

Your service processes payments. During load testing at 5x normal traffic, you notice 0.01% of transactions are charged twice. At scale that's 1000 users per day. How do you find and fix this?

↑ 21 upvotes · 9 engineers asked this · SDE2

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Same topic at specific companies

Amazon Node.js / Memory Razorpay Node.js / Memory TCS Node.js / Memory Infosys Node.js / Memory General Node.js / Memory Stripe Node.js / Memory

Related topics

DSA / Arrays System Design DSA / Trees DSA / Graphs Behavioral Testing Domain DevOps API Testing DSA / Hashmaps GCP / Real-time Data Java / Pub-Sub React / Performance SQL / Query Optimization Python / Async AWS / Lambda Kafka / Consumer Microservices / Saga Pattern TypeScript / Type System MongoDB / Indexing Security / SQL Injection Performance / Latency Tail Redis / Cache Stampede Elasticsearch / Cluster Health GraphQL / Security Data Engineering / Exactly Once Snowflake / Architecture PySpark / Core Concepts Airflow / Scheduling Web / WebAssembly Debugging / Production JavaScript / V8 Engine

Frequently asked questions

Explain the Node.js event loop phases in order. A setTimeout(fn, 0) and setImmediate(fn) are both queued. Which runs first and why? What if they're inside an I/O callback?
Explain the Node.js event loop phases in order. A setTimeout(fn, 0) and setImmediate(fn) are both queued. Which runs first and why? What if they're inside an I/O callback?
Your Node.js API uses async/await throughout. A developer reports that errors thrown in async route handlers are causing the process to crash with 'UnhandledPromiseRejectionWarning'. What's the architectural fix?
Your Node.js API uses async/await throughout. A developer reports that errors thrown in async route handlers are causing the process to crash with 'UnhandledPromiseRejectionWarning'. What's the architectural fix?
You're building a WebSocket server in Node.js that needs to broadcast messages to 50,000 concurrent connections. A naive broadcast loops through all 50,000 and calls socket.send(). What's wrong with this and how do you fix it?
You're building a WebSocket server in Node.js that needs to broadcast messages to 50,000 concurrent connections. A naive broadcast loops through all 50,000 and calls socket.send(). What's wrong with this and how do you fix it?
A Node.js service crashes every night at 2 AM with 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory'. There's a cron job that runs at 1:55 AM. Explain the likely cause and your fix.
A Node.js service crashes every night at 2 AM with 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory'. There's a cron job that runs at 1:55 AM. Explain the likely cause and your fix.
Design a rate limiter in Node.js that allows 100 requests per user per minute. It must work across multiple Node.js instances without a central Redis lock causing a bottleneck.
Design a rate limiter in Node.js that allows 100 requests per user per minute. It must work across multiple Node.js instances without a central Redis lock causing a bottleneck.