𝗖𝗼𝗺𝗽𝗮𝗻𝘆: Square Yards
𝗥𝗼𝗹𝗲: MERN Stack Developer
𝗘𝘅𝗽𝗲𝗿𝗶𝗲𝗻𝗰𝗲: 6 Years
𝗦𝘁𝗮𝗰𝗸: React.js + Node.js + Express.js + MongoDB
𝗛𝗶𝗿𝗶𝗻𝗴: Naukri Job Posting
Salary: 25LPA+
Logical Questions
A bat and a ball cost ₹110 together. The bat costs ₹100 more than the ball. How much does the ball cost?
Answer : ₹5 (bat ₹105)
You have ₹100. You spend ₹70, then get ₹50 back, then spend ₹60. How much money do you have?
Answer: 20
React Js
Create a counter
Requirements
Increment
Decrement
Reset
Show the last 5 counter values
Copy Color to an Empty Box
Build a React component that displays 4 boxes:
3 colored boxes (e.g., Red, Green, Blue)
1 empty white box
Requirements
Clicking on one of the colored boxes should copy its color.
This is the first click.
The selected color should be stored in state, but the white box should remain unchanged.
Clicking on the white box should paste the copied color into it.
This is the second click.
The white box should change to the copied color.
The interaction should require exactly two clicks:
First click → Select (copy) a color.
Second click → Apply (paste) the copied color to the white box.
Create a Stopwatch
Requirements
Start
Pause
Reset
Sort Users
You are given the following array of users:
const users = [
{ id: 1, name: "John", age: 30 },
{ id: 2, name: "Mike", age: 20 },
{ id: 3, name: "Alex", age: 25 },
{ id: 4, name: "Sarah", age: 28 },
{ id: 5, name: "Emma", age: 22 }
];
Requirements
Build a React component that displays the list of users in a table
Provide the following functionality:
Sort by Name (A–Z)
When the "Sort by Name" button is clicked, users should be sorted alphabetically by their name.
Sort by Age (Ascending)
When the "Sort by Age" button is clicked, users should be sorted from youngest to oldest.
The UI should update immediately after sorting.
Q: How do you decide what should be local state and what should be global state?
Q: How would you prevent duplicate API requests?
Node.js
How does Node.js handle multiple concurrent requests if it runs on a single thread?
Expected topics
Event Loop
Non-blocking I/O
libuv
Worker threads
OS thread pool
When would Node.js become slow?
CPU intensive work
Infinite loops
Huge JSON parsing
Synchronous filesystem calls
Large regex
Print numbers 1 to 5 with 1-second delay between each
async function printNumbers() {
for (let i = 1; i <= 5; i++) {
await new Promise(resolve => setTimeout(resolve, 1000));
console.log(i);
}
}
printNumbers();
Create a simple Express middleware to log request time
function requestLogger(req, res, next) {const start = Date.now();
res.on("finish", () => {
console.log(${req.method} ${req.url} - ${Date.now() - start}ms);
});
next();
}
Count word frequency in a string
How would you design a high-throughput notification service (Email, SMS, WhatsApp)?
How would you optimize an API handling 10,000 requests per second?
A MongoDB collection has 100 million documents. Queries have become slow. What would you do?
How do you ensure messages are not processed twice in Kafka?
Design a rate limiter for an API.
Design a file upload service supporting files up to 10 GB.
Database architecture to show customer chat history like ChatGpt shows.

