LabTestQuestionaries
LabTestQuestionaries
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Theory Long Questions
MVC Architecture
What does MVC stand for in software architecture?
What is the role of the Model in MVC?
What is the responsibility of the View in MVC?
What does the Controller do in MVC?
What is a key benefit of using MVC architecture?
Explain the MVC architecture and how it separates concerns in a web application.
Describe how MVC can be implemented in a Node.js and Express application with examples.
How does React fit into the MVC architecture, and what challenges arise when combining it with traditional MVC?
Compare and contrast MVC architecture with the architecture of a typical React application.
Discuss how MVC architecture can be adapted to a MERN stack application, including the roles of MongoDB, Express, React, a
React Architecture
What is the component-based architecture in React?
What is the role of the virtual DOM in React’s architecture?
What is a unidirectional data flow in React?
What is the purpose of the Reconciliation process in React?
What are Higher-Order Components (HOCs) in React?
Explain how React’s component-based architecture improves code reusability and maintainability.
Describe the lifecycle of a React component and how it integrates with the virtual DOM.
How does React’s architecture handle state management, and what are the differences between local state and global state (
Discuss the role of hooks in modern React architecture and how they replace class-based components.
Explain how React’s rendering process works, from JSX to the actual DOM, including diffing and updating.
Mongo DB Questions
Collections:
Users Collection:
Fields: _id, name, age, city, status, createdAt
Sample data might include documents like { name: "Alice", age: 28, city: "New York", status: "active", createdAt: ISODate() }.
Orders Collection:
Fields: _id, userId, product, price, quantity, orderDate
Sample data might include documents like { userId: ObjectId("user_id"), product: "Laptop", price: 999, quantity: 1, orderDate
Solve the followoing Questions on above Collections
Find all users from "New York" who are older than 30 using $gt and $eq.
Query orders with a price greater than 500 and sort by orderDate descending using $gt.
Find users whose status is either "active" or "inactive" using $in.
Get orders where the product name contains "phone" (case-insensitive) using $regex.
Aggregate to count the number of orders per user and sort by count descending.
Use aggregate to calculate the total revenue (price * quantity) per user from the Orders collection.
Perform a $lookup to join Users with their Orders and return user name with order details.
Find orders where quantity is between 1 and 5 using $gte and $lte.
Aggregate Orders with $match to filter by price > 1000, then $group to sum quantities by product.
Use $lookup to join Users and Orders, then $unwind the orders array to list each order with user details.
Coding Questions
Fetch and display a list of users from a public API
Create a component to show random dog images from an API
Make a weather component that fetches current temperature by city
Build a component to display a random quote from an API
Build a news headline fetcher from a public news API
Write a program to create an express server.
Write a program to connect to mongodb and print "db connected" after successful connection.
Create a functional component that displays a welcome message with a name prop
Write a component with a useState hook to toggle between light and dark mode
Create a simple counter component using useState
Make a component that fetches and displays a random joke from an API using useEffect
Write a form component with controlled input using useState
Create a component that renders a list from an array using map
Make a simple todo list component with add functionality
Write a component that shows current time updated every second using useEffect
Create a button component that accepts custom text and onClick handler as props
Make a component that conditionally renders content based on a boolean prop
2 marks Questions
What is MongoDB?
What is a collection in MongoDB?
What is a document in MongoDB?
What is an aggregation in MongoDB?
What is a query operator in MongoDB?
What is Express.js?
What is middleware in Express.js?
What is a route in Express.js?
What is the request object in Express.js?
What is the response object in Express.js?
What is React?
What is a component in React?
What is JSX in React?
What is a hook in React?
What is the virtual DOM in React?
What is Node.js?
What is an event loop in Node.js?
What is npm in the context of Node.js?
What is a module in Node.js?
What is asynchronous programming in Node.js?
How do I connect to MongoDB in a Node.js application?
What’s the difference between find() and findOne() in MongoDB?
How do I create an index in MongoDB?
What is an aggregation pipeline in MongoDB?
How can I update multiple documents in MongoDB?
How do I set up a basic Express server?
What are middleware functions in Express?
How do I handle POST requests in Express?
How can I serve static files using Express?
What’s the purpose of app.use() in Express?
How do I create a functional component in React?
What is the use of the useState hook?
How does useEffect work in React?
How can I pass data between React components?
What’s the difference between props and state?
How do I create a simple HTTP server in Node.js?
What is the role of package.json in a Node.js project?
How do I install dependencies using npm?
What’s the difference between require and import in Node.js?
How can I handle asynchronous operations in Node.js?
ngoDB, Express, React, and Node.js.