Mentoring Junior Node Devs
Junior developers on Node.js teams hit the same walls: async control flow, connection pool metrics, and where errors actually surface. Structured mentoring turns those walls into career growth.
Recipe
Quick-reference recipe card - copy-paste ready.
Week 1-2: Read codebase - trace one HTTP request + one queue job
Week 3-4: Fix bug with tests (pair on async errors)
Week 5-6: Add endpoint with Zod validation + integration test
Week 7-8: Ship small feature behind feature flag
Week 9+: On-call shadow; own module with reviewWeekly 30-min 1:1 agenda:
1. What was confusing this week?
2. Review one PR they wrote (teach, don't takeover)
3. One skill focus (e.g. read Grafana pool panel)
4. Blockers to escalateWhen to reach for this:
- New hire on API squad
- Intern converting to full-time
- Mid engineer pivoting from frontend to Node path
Working Example
Exercise: Trace Async Failure
// src/orders/get-order.ts - give junior broken version
export async function getOrder(id: string) {
const row = await db.order.findUnique({ where: { id } });
if (!row) return null;
enrichWithCustomer(row); // BUG: missing await
return row;
}
async function enrichWithCustomer(order: { customerId: string; customer?: unknown }) {
order.customer = await db.customer.findUnique({ where: { id: order.customerId } });
}Mentor prompts:
- Run test - why is
customersometimes undefined? - Add ESLint
no-floating-promises- what fires? - Fix with
await enrichWithCustomer(row) - Add test asserting
customerpopulated
Exercise: Read Pool Metrics
Grafana panel homework:
- pg_pool_total_count
- pg_pool_idle_count
- pg_pool_waiting_count
Questions:
- waiting_count > 0 for 5 min means what?
- Should we raise max or fix slow queries first?- Juniors learn Postgres before blaming Node event loop
- Link Connection Pool Tuning
Deep Dive
Node-Specific Junior Pitfalls
| Pitfall | Symptom | Teaching fix |
|---|---|---|
| Callback mental model | Random undefined | Draw async/await timeline on whiteboard |
console.log debugging | No prod visibility | Structured req.log with requestId |
| Giant route handlers | Untestable PRs | Extract service function day one |
Ignoring package.json engines | "Works on my machine" | .nvmrc + CI version check |
Copy-paste Stack Overflow pg | Connection leaks | try/finally template in squad wiki |
Pairing Calendar
| Event | Duration | Goal |
|---|---|---|
| First PR | 2h pair | Land one merged PR same week |
| First migration | 1h pair | Expand-only change |
| Incident shadow | 1 incident | Scribe role, read timeline |
| Load test observe | 30m | See pool under k6 |
Feedback Framework
SBI: Situation - Behavior - Impact
"SBI: In yesterday's PR, the query used string concat (behavior),
which would fail security review and risks SQL injection (impact).
Let's fix with $1 params together."- Praise specific growth: "You caught the missing await in review"
Reading List (Ordered)
- Node.js Basics
- Express Basics or Fastify Basics
- Testing Basics
- Request Correlation IDs
- Queues Basics
Gotchas
- Sink-or-swim on-call - Anxiety without context. Fix: Shadow two rotations before solo page.
- Only bug fixes - No growth narrative. Fix: Graduated feature ownership plan.
- Mentor always takes over PR - Junior learns dependency. Fix: Comment; junior pushes fix.
- Skipping pool fundamentals - ORM hides too much. Fix: One week raw
pgor Prisma metrics exercise. - No written goals - Promotion surprises. Fix: Shared doc with quarterly skills checklist.
Alternatives
| Alternative | Use When | Don't Use When |
|---|---|---|
| Formal apprenticeship | Large hire cohort | Solo junior on squad |
| Self-paced course | Budget limited | Need production codebase context |
| Rotate to another squad | Broad exposure | Core API understaffed |
FAQs
How long until junior is productive?
2-3 months for small PRs solo; 6 months for feature ownership with light review.
Frontend dev switching to Node?
Use Frontend Node Path; emphasize async and streams.
Should juniors write ADRs?
Contribute context section; tech lead authors decision. Good learning at month 4+.
Related
- Tech Lead Basics on Node - TL responsibilities
- Code Review Standards - what good PRs look like
- Onboarding Basics - day-one setup
- Skills Matrix - skill tracking
- Pairing on API PRs - pairing norms
Stack versions: This page was written for Node.js 24.18.0 (Active LTS), npm 10+, TypeScript 5.6+, Express 5, Fastify 5, and NestJS 11.