Q1.
Create Login API using Express and JWT.
Answer:
Validate user credentials, compare hashed password using bcrypt, generate JWT token, and return it.
Difficulty: medium
Q2.
Create Protected Route using JWT Middleware.
Answer:
Read token from headers, verify JWT, and allow access only for authenticated users.
Difficulty: medium
Q3.
Implement CRUD Operations using MongoDB and Express.
Answer:
Create, Read, Update, and Delete documents using Mongoose models.
Difficulty: easy
Q4.
Build a Todo Application using React.
Answer:
Use useState, map(), and CRUD APIs to manage tasks.
Difficulty: easy
Q5.
Implement Search Filter in React.
Answer:
Use filter() and state management to search data dynamically.
Difficulty: easy
Q6.
Implement Pagination in React.
Answer:
Use slice() and page state to display paginated data.
Difficulty: medium
Q7.
Create File Upload API using Multer.
Answer:
Configure multer middleware and store uploaded files on the server.
Difficulty: medium
Q8.
Implement Role-Based Authentication (Admin/User/Vendor).
Answer:
Store roles in JWT and check permissions using middleware.
Difficulty: hard
Q9.
What is Node.js?
Difficulty: easy
Q10.
What is the difference between CommonJS and ES Modules?
Difficulty: medium
Q11.
What is the Event Loop in Node.js?
Difficulty: medium
Q12.
What are Streams in Node.js?
Difficulty: medium
Q13.
What is the purpose of package.json?
Difficulty: easy
Q14.
What is middleware in Express.js?
Difficulty: easy
Q15.
Create a Login API using Express and JWT.
Difficulty: medium
Q16.
How do you hash passwords in Node.js?
Difficulty: medium
Q17.
What is the difference between authentication and authorization?
Difficulty: easy
Q18.
How do you connect Node.js with MongoDB?
Difficulty: easy
Q19.
What is Mongoose?
Difficulty: easy
Q20.
Explain async/await in Node.js.
Difficulty: easy
Q21.
What is the difference between synchronous and asynchronous operations?
Difficulty: easy
Q22.
How do you handle errors in Express.js?
Difficulty: medium
Q23.
What is CORS and how do you enable it in Express?
Difficulty: medium
Q24.
What are environment variables and how are they managed?
Difficulty: easy
Q25.
How do you implement role-based access control (RBAC) in Node.js?
Difficulty: hard
Q26.
What is rate limiting and how can it be implemented in Express?
Difficulty: hard
Q27.
How do you upload files using Multer?
Difficulty: medium
Q28.
How do you optimize the performance of a Node.js application?
Difficulty: hard