Got it 👍 Since you already know basics (CRUD, JWT, DB, Passport), let’s focus on advanced Node.js practical examples you can practice before your exam. These are real-world backend challenges companies love to test.
🔥 Advanced Practical Examples
1. Role-Based Access Control (RBAC)
-
Task: Create a system with roles →
admin
,manager
,user
. -
Practice:
-
Only
admin
can delete users. -
manager
can view all users but not delete. -
user
can only view their own profile.
-
-
Concepts: Middleware, JWT payload roles, route authorization.
2. Refresh Tokens & Logout
-
Task: Implement access tokens + refresh tokens.
-
Practice:
-
Login returns both tokens.
-
Access token expires in 15 min.
-
Refresh token stored in DB → can request new access token.
-
Logout = invalidate refresh token.
-
-
Concepts: JWT lifecycle, token blacklisting, DB session management.
3. File Upload + Cloud Storage
-
Task: Upload image → store in AWS S3 (or local folder for practice).
-
Practice:
-
POST /upload
→ Upload profile picture. -
Validate file type (only
.jpg
,.png
). -
Save file URL in DB.
-
-
Concepts:
multer
, cloud SDKs, validation.
4. Pagination + Filtering + Search
-
Task: Build
/products
API. -
Practice:
-
GET /products?page=2&limit=10&category=books&search=node
-
Return paginated results with filters.
-
-
Concepts: Query params, Sequelize/Mongoose queries, API response structure.
5. Rate Limiting & Security
-
Task: Protect API against abuse.
-
Practice:
-
Allow max 100 requests per IP per 15 min.
-
Block IP if exceeded.
-
-
Concepts:
express-rate-limit
, middleware, security headers.
6. Background Jobs / Queues
-
Task: Send welcome email after user registers.
-
Practice:
-
Push task into Redis queue.
-
Worker sends email after delay.
-
-
Concepts:
bull
oragenda
, job queues, async processing.
7. Socket.IO Real-time Chat
-
Task: Create real-time chat API.
-
Practice:
-
user1
sends →user2
receives instantly. -
Store messages in DB.
-
Add “online/offline” status.
-
-
Concepts: WebSockets, events, broadcasting.
8. API Gateway + Microservices
-
Task: Split app into microservices.
-
Practice:
-
Service 1: Users
-
Service 2: Products
-
API Gateway routes requests
/users/*
→ User service,/products/*
→ Product service
-
-
Concepts: Reverse proxy, scaling, service separation.
9. GraphQL API
-
Task: Replace REST with GraphQL.
-
Practice:
-
Query user details with nested posts.
-
Mutation to create/update user.
-
-
Concepts:
apollo-server
, schema, resolvers.
10. Testing (Unit + Integration)
-
Task: Write tests for login API.
-
Practice:
-
Test success login → returns token.
-
Test wrong password → returns 400.
-
Test protected route → returns 401 without token.
-
-
Concepts:
jest
/mocha
, supertest, mocking DB.
🚀 Suggested Practice Path
-
✅ Implement RBAC + JWT refresh tokens
-
✅ Add file upload with S3/local
-
✅ Create products API with pagination + filtering
-
✅ Secure APIs with rate limiting & helmet
-
✅ Build chat app with Socket.IO
-
✅ Add queues for async jobs
-
✅ Try GraphQL for bonus points
-
✅ Write unit tests
👉 Would you like me to create a full advanced-level practice exam (like a real company might give, combining 3–4 of these challenges in a 3-hour task)?