mern stack interview questions for freshers
MERN Stack Interview Ki Taiyari — 30 Din Ka Roadmap (Fresher)
MERN Stack Interview Questions For Freshers — 30 Din Ka Roadmap
Bhai, scene ye hota hai: YouTube pe 12-ghante ki MERN playlist dekh li, do projects clone kar liye, resume pe "MERN Stack Developer" likh diya. Phir interview aata hai aur pehla sawaal — "Express me middleware kya hai?" — aur dimaag khaali. Concept dekha tha, par bola kabhi nahi tha.
Ye post wahi gap bharti hai. Neeche 30 din ka week-wise plan hai — kaunse hafte me kya, aur har topic ke wo MERN stack interview questions for freshers jo India me sach me poochte hain. Har week ke end me tumhe MERN interview prep hub pe bhej diya jayega, jahan poore question banks aur practice hai.
Ek honest disclaimer pehle: 30 din me tum interview face karne layak ban sakte ho. 30 din me tum senior nahi ban jaoge, aur koi roadmap job guarantee nahi kar sakta. Jo log "30 days me package" bechte hain, unse door raho.
Pehle Ye Decide Karo — Service-Based Ya Product-Based
Dono ka interview alag hota hai, aur taiyari bhi.
| Service-based (TCS, Infosys, Wipro, Cognizant) | Product-based / startup | |
|---|---|---|
| Focus | Definitions, SQL, DBMS/OS basics, aptitude | DSA + project depth + "kaise banaya" |
| Coding | Simple logic questions | Live problem solving |
| MERN role | Aksar training ke baad assign | Directly MERN role |
| SQL | Almost guaranteed round | Kabhi-kabhi |
Agar campus placement target hai to SQL aur definitions ko halka mat lena. Agar startup target hai to project depth pe jaan lagao. Roadmap dono cover karta hai, bas emphasis tum apne hisaab se badal lena.
Roz ka target: 2-3 ghante. Ek ghanta padhna, ek ghanta code likhna, aadha ghanta bol ke revise karna. Wo aakhri wala step hi asli interview practice hai — mann me padhne se zubaan nahi khulti.
Week 1 — JavaScript Foundations (+ HTML/CSS Ka Ek Pass)
MERN ka M-E-R-N chaar cheezein lagti hain, par neeche sirf ek cheez hai — JavaScript. Fresher rounds me sabse zyada reject yahin hota hai, kyunki log React seekh lete hain aur JS skip kar dete hain.
Din 1-2 — Core: var/let/const, hoisting, data types, == vs ===, scope. Yahi se "output kya aayega" wale questions banate hain.
Din 3-4 — Closures aur this: Closure matlab function apne bahar wale scope ke variables ko yaad rakhta hai, function khatam hone ke baad bhi. Counter function ka example ratta mat maaro — likh ke chalao. this ka rule simple hai: normal function me this call-site se decide hota hai, arrow function me this bahar wale scope se uthta hai.
Din 5-6 — Async: Callback → Promise → async/await ka evolution, aur event loop. Ye wala answer clear hona chahiye: JavaScript single-threaded hai, call stack ek hi kaam karta hai, par async kaam Web APIs/libuv ko jaata hai aur callback wapas queue me aata hai. Microtask queue (promises) macrotask queue (setTimeout) se pehle chalti hai — isliye Promise.then setTimeout(fn, 0) se pehle print hota hai.
Din 7 — HTML/CSS quick pass: Semantic tags, box model, flexbox, position values, media query. Deep dive ki zarurat nahi — MERN interview me ye 5-10 minute ka warm-up section hota hai.
Week 1 ke typical questions:
- Closure kya hai, ek real use case batao
var,let,constme farq- Event loop kaise kaam karta hai? Microtask vs macrotask
map,filter,reduceka farq — aurforEachkyun alag hai- Promise ke states kaunse hain,
Promise.allvsPromise.race - Arrow function aur normal function me
thiska behaviour
Ye poora cluster question bank ke saath yahan hai → JavaScript chapter.
Week 2 — React (+ Redux Basics)
Ab UI layer. React me interviewer teen cheezein dekhta hai: tum state kahan rakhte ho, re-render kab hota hai samajhte ho ya nahi, aur list rendering sahi karte ho ya nahi.
Din 8-10 — Components, props, state: Functional components, props one-way flow, useState, aur state immutably update karna (setItems([...items, x]), seedha push nahi).
Din 11-12 — useEffect aur lists/keys: Dependency array ka matlab — khaali array matlab sirf mount pe, dependencies wala matlab wo badle to phir chale. Aur keys: key stable aur unique honi chahiye. Array index key tab tak theek hai jab list na reorder ho na beech se delete ho — warna React galat item ko reuse kar leta hai. Ye classic interview trap hai.
Din 13 — Forms aur conditional rendering: Controlled input matlab value React state se aati hai aur onChange state update karta hai. Ek validation wala form khud likho.
Din 14 — Redux basics: Fresher se Redux ki deep expertise expect nahi hoti, par store, action, reducer, aur useSelector/useDispatch ka basic flow aana chahiye. Ye bhi pata ho ki Redux Toolkit aaj ka standard tareeka hai aur createSlice boilerplate kam kar deta hai. Aur ye bhi bolna aana chahiye ki chhoti app me Redux ki zarurat hi nahi.
Week 2 ke typical questions: state vs props, virtual DOM aur reconciliation, useState vs useEffect, key kyun chahiye, controlled vs uncontrolled input, prop drilling kya hai aur Context kaise help karta hai.
Poora React question bank + practice → React chapter.
Week 3 — Node + Express + MongoDB (Ye Hafta Sabse Bhaari Hai)
Yahin par zyaadatar freshers patli galee se nikal jaate hain — "backend thoda kam hai" bol dete hain. Mat karna. Backend hi tumhe baaki candidates se alag karta hai.
Node (Din 15-16)
Node ek JavaScript runtime hai jo V8 engine ko browser ke bahar chalata hai. Fresher level pe itna clear hona chahiye: Node single-threaded event loop pe chalta hai, non-blocking I/O karta hai, require (CommonJS) vs import (ESM) ka farq, package.json me dependencies vs devDependencies, aur process.env se secrets aate hain — hardcode nahi karte.
Common questions: Node kya hai aur browser JS se kaise alag hai, blocking vs non-blocking, EventEmitter kya hai, npm vs npx. Detail me → Node chapter.
Express (Din 17-19) — Isko Serious Le
Express fresher interview ka sabse predictable section hai. Yahan number badhane ka sabse aasan mauka hai kyunki questions ghoom-phir ke wahi rehte hain.
1. Middleware — the whole game. Middleware ek function hai (req, res, next) signature ke saath jo request-se-response cycle ke beech chalta hai. Wo req/res modify kar sakta hai, response end kar sakta hai, ya next() call karke control aage de sakta hai. Airport ki security line samjho — passenger (request) har checkpoint se guzar ke hi gate (route handler) tak pahunchta hai.
Ek middleware ko ya to response end karna hai ya next() call karna hai — warna request hang ho jayegi. Ye ek line interview me bahut acha impression banati hai.
2. Order matter karta hai. Middleware bilkul usi order me chalta hai jisme register hua. Agar app.get('/data', handler) ko app.use(express.json()) se pehle likh diya, to handler ke andar req.body undefined milega — parser abhi chala hi nahi tha. Recipe me batter mix karne se pehle cake bake nahi kar sakte.
3. Types. Application-level (app.use), router-level (express.Router()), built-in (express.json, express.urlencoded, express.static), error-handling (4-arg), aur third-party (cors, morgan, helmet).
4. req.params vs req.query. Route param path ka hissa hai aur ek specific resource identify karta hai — /users/:id pe /users/42 maarne se req.params.id milta hai. Query string ? ke baad aati hai aur filter/pagination ke liye hoti hai — /search?q=react&page=2 se req.query.q aur req.query.page. Gotcha jo har interview me poocha jaata hai: dono ki values hamesha string hoti hain. req.query.page "2" hai, 2 nahi. Number(req.query.page) || 1 karo, warna "2" + 1 = "21" mil jayega.
5. Error middleware. Ye ek special middleware hai chaar arguments ke saath — (err, req, res, next). Express ise argument count se pehchanta hai, isliye chaaron likhna zaroori hai, aur ise sabse last me register karna hota hai. Error bhejne ke liye next(err) call karo — argument ke saath next matlab baaki normal middleware skip aur seedha error handler. Bonus point: Express 4 me async handler ka throw automatically catch nahi hota (request hang ho jaati hai) — try/catch karke next(err) khud bhejna padta hai; Express 5 rejected promise ko khud error handler tak forward kar deta hai.
6. REST design + status codes. URL me noun rakho, verb nahi — /users, /todos; /getUser galat hai. Action HTTP method se aata hai: GET read, POST create, PUT poora replace, PATCH partial update, DELETE remove. Plural naam, nested resources /users/:id/posts, aur version prefix /api/v1. Status codes: 200 OK, 201 created, 204 no content (delete ke baad), 400 bad request, 401 unauthorized, 403 forbidden, 404 not found, 500 server error.
7. JWT auth. Poora flow bolna aana chahiye: POST /login pe user dhoondho → bcrypt.compare se password check → valid ho to jwt.sign({ userId }, SECRET, { expiresIn: '1h' }) → token client ko. Client aage har request pe Authorization: Bearer <token> bhejta hai. Protected route pe auth middleware header padhta hai, .split(' ')[1] se token nikalta hai, jwt.verify karta hai, success pe req.user set karke next(), fail pe 401.
Do cheezein extra bolo aur interviewer khush ho jayega: (a) JWT signed hota hai, encrypted nahi — payload Base64URL me hai jise koi bhi decode kar sakta hai, isliye password ya sensitive data payload me kabhi mat daalo; (b) login fail pe email galat ho ya password, same 401 message do, taaki attacker ko pata na chale kaunsa email exist karta hai.
401 vs 403 bhi rat lo: 401 matlab "pata hi nahi tum kaun ho, login karo", 403 matlab "pata hai tum kaun ho, par permission nahi hai".
Ye saare Express questions model answers ke saath yahan practise karo → Express chapter.
MongoDB (Din 20-21)
Schema design sabse zyada poocha jaata hai, aur yahi wo jagah hai jahan fresher ka jawab kacha hota hai. Rule ek line ka hai: data jo saath padha jaata hai, saath store karo.
- Embed karo jab child data parent ke saath hi padha jaata ho aur bounded ho — order ke line-items, user ka address. Ek read, koi join nahi.
- Reference karo (sirf ObjectId store karke, baad me
$lookupya Mongoose.populate()se join) jab data bada, shared ya unbounded ho — post ka author, post ke comments. - Classic anti-pattern: post ke andar comments ka array embed karna. Comments kabhi rukte nahi, document phoolta jaata hai aur 16MB document limit tak pahunch sakta hai.
Baaki cover karo: CRUD (insertOne, find, updateOne, deleteOne), query operators ($gt, $in, $regex), sort/limit/skip se pagination, indexes kyun chahiye, aur aggregation pipeline ke basic stages — $match, $group, $sort, $project. Mongoose side pe: schema/model kya hai, validation, aur populate kaise reference resolve karta hai.
Practice queries yahan hain → MongoDB chapter.
Week 4 — SQL, Ek Defendable Project, Mock Interview, Resume
Din 22-24 — SQL
Haan, MERN me MongoDB hai — par Indian service-based interview me SQL round alag se aata hai. Cover karo: SELECT/WHERE, ORDER BY/LIMIT, aggregate functions (COUNT, SUM, AVG), GROUP BY + HAVING, INNER vs LEFT JOIN, subqueries, primary/foreign key constraints, aur normalization (1NF/2NF/3NF ek line me).
Do questions almost guaranteed hain: "WHERE aur HAVING me farq?" (WHERE grouping se pehle rows filter karta hai, HAVING grouping ke baad groups filter karta hai) aur "INNER JOIN vs LEFT JOIN?" (INNER sirf matching rows, LEFT left table ki saari rows + match na hone pe NULL). Query likh ke practise karo → SQL chapter.
Din 25-27 — Ek Project Jo Tum Defend Kar Sako
Das adhoore projects se ek poora project behtar hai. Ek MERN CRUD app banao jisme auth ho — signup/login, bcrypt hashed passwords, JWT, protected routes, ek resource ka full CRUD, aur MongoDB me sahi schema. Deploy karo, live link resume me daalo.
Phir in sawaalon ka jawab likh ke rakho, kyunki yahi poochte hain:
- Is feature ke liye ye schema kyun chuna, embed kiya ya reference?
- Auth kaise kaam karta hai, token kahan store hota hai?
- Ek bug jo phasa tha — kaise debug kiya?
- Aaj dobara banate to kya alag karte?
Aakhri sawaal ka acha jawab fresher ko instantly senior-jaisa dikhata hai.
Din 28-29 — Mock Interview
Ab tak sab likha hua tha. Ab bolna hai. Camera on karke khud ko record karo, ya AI mock interview pe voice round do aur feedback lo. Pehli baar sunoge to shock lagega — "umm" bahut hai, jawab bahut lamba hai, ya answer sahi hai par confidence nahi. Yahi cheez asli interview se pehle theek karni hai.
Target: har core question ka 30-45 second ka jawab. Definition ek line, phir ek example, phir chup. Lamba bolna knowledge nahi, nervousness dikhata hai.
Din 30 — Resume
Aakhri din code nahi, packaging. Resume ek page, projects sabse upar (fresher ke liye education se bhi upar), har project ke saath tech stack aur live link. Skills wahi likho jo pooche jaane pe bol sako — resume pe "Redux" likha aur useSelector nahi bata paye to poora interview neeche chala jaata hai.
Aur bhejne se pehle ATS score check kar lo — bahut sare fresher resumes recruiter tak pahunchte hi nahi kyunki formatting parse hi nahi hoti.
Realistic Rakho
30 din baad tumhe kya milega: JavaScript ka core clear, React comfortable, Express ka poora fresher-level flow, MongoDB schema sense, SQL basics, ek deployed project, aur bolne ki practice. Kya nahi milega: DSA mastery, system design, ya production experience. Wo aage ke mahine hain.
Aur agar 30 din me sab cover nahi hua — koi baat nahi. Adhoora Week 3 poora karna, aage bhaag ke sab surface-level chhodne se behtar hai. Interviewer depth pakad leta hai.
Aage Kya Karo
Har week ka poora question bank, notes aur practice ek jagah rakha hai — MERN interview prep se Week 1 shuru karo, aur roz ek chapter khatam karke us par bol ke revise karo.
Kal se nahi — aaj se. Din 1 abhi start hota hai.
FAQ
Kya 30 din me MERN stack interview crack ho jayega?
Honest jawab — depend karta hai tum kahan se shuru kar rahe ho. Agar JavaScript aur React thoda-bahut aata hai aur ek chhota project bana chuke ho, to 30 din focused revision me tum fresher-level interview face karne layak ho jaoge. Bilkul zero se ho to 30 din me sirf JavaScript aur React tak pahunch paoge, aur backend adhoora rahega. Koi bhi roadmap job guarantee nahi karta — ye sirf taiyari ka structure hai.
Fresher MERN interview me sabse zyada kya poocha jaata hai?
Char cluster har jagah repeat hote hain — JavaScript ke closures/promises/event loop, React ke state-props-hooks-keys, Express ka middleware aur REST design, aur MongoDB ka schema design (embed vs reference). Iske baad interviewer tumhare project pe ghumaata hai, isliye project ka har decision explain karne layak hona chahiye.
MERN stack ke saath SQL bhi zaroori hai kya?
Service-based companies (TCS, Infosys, Wipro, Capgemini type) me haan — wahan SQL round aksar alag hota hai aur JOIN, GROUP BY, subquery poochte hain. Product startups me MongoDB pe focus zyada hota hai. Isliye Week 4 me SQL rakha gaya hai — basic SELECT, WHERE, JOIN, GROUP BY aur normalization itna to aana hi chahiye.
Kitne projects chahiye MERN fresher resume me?
Do ache projects das adhoore projects se behtar hain. Ek full CRUD app jisme auth ho (login, JWT, protected routes) aur ek chhota focused app — bas. Sharat ek hi hai: dono deploy hone chahiye aur tum har file ka purpose bina dekhe bata sako. Tutorial clone jo tum explain nahi kar sakte, wo resume pe risk hai, asset nahi.
Express me sabse common fresher question kaunsa hai?
Middleware — 'middleware kya hai aur (req, res, next) me next() ka kaam kya hai'. Iske baad order kyun matter karta hai, req.params vs req.query ka farq, error-handling middleware ka 4-argument signature, aur JWT auth ka poora login-to-protected-route flow. Ye paanch cheezein aa gayi to Express ka fresher round nikal jaata hai.
Interview me Hinglish me answer de sakte hain?
Haan, zyaadatar Indian interviewers ko koi problem nahi hoti. Par technical terms English me hi bolo — middleware, event loop, aggregation pipeline, re-render. Best formula: definition ki ek line English me, aur samjhaana apni bhasha me. Confidence se bolna, ratta maar ke bolne se zyada count karta hai.