Posts

Showing posts from March, 2026

VIVA Questions

 NODE.JS What is Node.js? Node.js is a runtime environment that allows JavaScript to run on the server side. Is Node.js single-threaded? Yes, but it uses an event loop for handling multiple requests asynchronously. What is npm? Node Package Manager used to install libraries and dependencies. What is a module in Node.js? A reusable block of code (file) that can be imported. Difference between require and import? require is CommonJS, import is ES6 module syntax. What is package.json? It contains project metadata and dependencies. What is event-driven programming? Execution based on events like clicks, requests, etc. What is the event loop? It handles asynchronous operations in Node.js. What is callback function? A function passed as argument and executed later. What is middleware? Functions that process requests before response. What is REPL? Read-Eval-Print Loop for executing JS code interactively. What is fs module? File system module for file op...

Experiment 16: MongoDB CRUD Operations Experiment 17: B MongoDB Queries

Write MongoDB queries to perform CRUD operations on document using insert(), find(), update(), remove() Write MongoDB queries to work with records using find(), limit(), sort(), createIndex(), aggregate()  use AIDS_B  command creates AIDS_B database. In AIDS_B database to create collection names "register"  db.register.insertOne({Name:'abc',RegdNo:10001,Year:4,Semester:1,branch:'AIDS'})   it is implicit way test> use AIDS_B switched to db AIDS_B AIDS_B> db.register.insertOne({Name:'abc',RegdNo:10001,Year:4,Semester:1,branch:'AIDS'}) {   acknowledged: true,   insertedId: ObjectId('690588f3b25c5cb31d63b112') } AIDS_B> db.register.insertOne({Name:'def',RegdNo:10002,Year:4,Semester:1,branch:'AIDS'}) {   acknowledged: true,   insertedId: ObjectId('6905891eb25c5cb31d63b113') } AIDS_B> db.register.insertOne({Name:'ghi',RegdNo:10003,Year:4,Semester:1,branch:'AIDS'}) {   acknowledged: true,   i...

Experiment 15: ReactJS Applications – To-do list and Quiz

 Design to-do list application App.js import React, { useState } from "react"; import "./App.css"; function App() {   const [task, setTask] = useState("");   const [tasks, setTasks] = useState([]);   // Add Task   const addTask = () => {     if (task.trim() === "") return;     const newTask = {       id: Date.now(),       text: task,       completed: false     };     setTasks([...tasks, newTask]);     setTask("");   };   // Delete Task   const deleteTask = (id) => {     setTasks(tasks.filter((t) => t.id !== id));   };   // Toggle Complete   const toggleComplete = (id) => {     setTasks(       tasks.map((t) =>         t.id === id ? { ...t, completed: !t.completed } : t       )     );   };   return (     <div className="conta...