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 operations.
  • What is buffer?
    Temporary memory for binary data.
  • What is stream?
    Data flow in chunks instead of loading full data.
  • Types of streams?
    Readable, Writable, Duplex, Transform.
  • What is asynchronous programming?
    Non-blocking execution of code.
  • What is synchronous programming?
    Blocking execution.
  • What is setTimeout()?
    Executes code after delay.
  • What is process object?
    Global object giving runtime info.
  • What is cluster module?
    Used to create multiple processes.
  • What is child process?
    Running separate process in Node.
  • What is API?
    Interface for communication between systems.
  • What is REST API?
    API using HTTP methods.
  • What is JSON?
    Data format for communication.
  • Advantages of Node.js?
    Fast, scalable, non-blocking.
  •  

  •  TYPE SCRIPT

  • What is TypeScript?
    A superset of JavaScript with static typing.
  • Why use TypeScript?
    For type safety and better error detection.
  • What is transpilation?
    Converting TypeScript to JavaScript.
  • What is type annotation?
    Declaring variable types.
  • Example of type?
    let x: number = 10;
  • What is interface?
    Defines structure of an object.
  • What is enum?
    Set of named constants.
  • What is tuple?
    Fixed-length array with types.
  • What is any type?
    Allows any type (not recommended).
  • What is void?
    Function returns nothing.
  • What is unknown?
    Safer alternative to any.
  • What is never?
    Function that never returns.
  • What is union type?
    Multiple types (string | number).
  • What is type inference?
    Automatic type detection.
  • What is class in TypeScript?
    Blueprint for objects.
  • What is access modifier?
    public, private, protected.
  • What is readonly?
    Prevents modification.
  • What is generics?
    Reusable components with types.
  • What is module?
    Code organization using export/import.
  • What is namespace?
    Logical grouping of code.
  • What is decorator?
    Special function to modify class behavior.
  • Difference between interface and type?
    Interface for objects, type for all types.
  • What is tsconfig.json?
    Configuration file.
  • What is strict mode?
    Enforces strict type checking.
  • Advantages?
    Better maintainability, fewer bugs.

  • EXPRESS.JS
  •  

  • What is Express.js?
    Web framework for Node.js.
  • Why use Express?
    Simplifies server creation.
  • What is app object?
    Instance of Express.
  • What is routing?
    Handling URL requests.
  • HTTP methods?
    GET, POST, PUT, DELETE.
  • What is middleware?
    Functions between request & response.
  • Types of middleware?
    Application, router, error-handling.
  • What is req object?
    Request data.
  • What is res object?
    Response to client.
  • What is next()?
    Pass control to next middleware.
  • What is REST API?
    API using HTTP.
  • What is express.Router?
    Mini route handler.
  • What is body-parser?
    Parses request body.
  • What is static middleware?
    Serves static files.
  • What is template engine?
    Dynamic HTML generation.
  • What is CORS?
    Cross-origin resource sharing.
  • What is error handling?
    Managing errors in app.
  • What is cookie?
    Small data stored in browser.
  • What is session?
    Server-side user data.
  • What is RESTful routing?
    Standard route naming.
  • What is JSON response?
    Sending data in JSON format.
  • What is status code?
    HTTP response code.
  • What is express.json()?
    Middleware for JSON parsing.
  • What is app.listen()?
    Starts server.
  • Advantages?
    Lightweight, flexible.

  • REACT.JS

  • What is React?
    JavaScript library for UI development.
  • Who developed React?
    Facebook
  • What is component?
    Reusable UI block.
  • Types of components?
    Functional and Class.
  • What is JSX?
    HTML-like syntax in JS.
  • What is state?
    Component data.
  • What are props?
    Inputs to components.
  • Difference state vs props?
    State is internal, props external.
  • What is virtual DOM?
    Lightweight DOM copy.
  • What is useState?
    Hook for state.
  • What is useEffect?
    Hook for side effects.
  • What is hook?
    Function for React features.
  • What is key in React?
    Unique identifier for elements.
  • What is event handling?
    Handling user actions.
  • What is conditional rendering?
    Rendering based on conditions.
  • What is list rendering?
    Rendering arrays.
  • What is controlled component?
    Form controlled by React.
  • What is uncontrolled component?
    Uses DOM directly.
  • What is context API?
    Global state management.
  • What is Redux?
    State management library.
  • What is React Router?
    Navigation library.
  • What is fragment?
    Group elements without extra DOM.
  • What is lifecycle?
    Component phases.
  • What is memo?
    Performance optimization.
  • Advantages?
    Fast, reusable, scalable.


  • MONGODB

  • What is MongoDB?
    NoSQL database storing data in JSON-like format.
  • What is document?
    Data record in MongoDB.
  • What is collection?
    Group of documents.
  • What is BSON?
    Binary JSON format.
  • What is _id?
    Unique identifier.
  • What is NoSQL?
    Non-relational database.
  • Difference SQL vs NoSQL?
    Tables vs documents.
  • What is schema-less?
    No fixed structure.
  • What is CRUD?
    Create, Read, Update, Delete.
  • Insert command?
    insertOne()
  • Find command?
    find()
  • Update command?
    updateOne()
  • Delete command?
    deleteOne()
  • What is index?
    Improves query speed.
  • What is aggregation?
    Data processing pipeline.
  • What is $match?
    Filter stage.
  • What is $group?
    Group data.
  • What is replication?
    Copying data across servers.
  • What is sharding?
    Splitting data across machines.
  • What is Atlas?
    Cloud MongoDB service.
  • What is embedded document?
    Nested document.
  • What is reference?
    Linking documents.
  • What is cursor?
    Pointer to result set.
  • What is projection?
    Selecting fields.
  • Advantages?
    Flexible, scalable, fast
  • Comments

    Popular posts from this blog

    Experiment 1: Node.js

    Experiment 10: ReactJS – Render HTML, JSX, Components – function & Class

    Experiment 6: ExpressJS – Routing, HTTP Methods, Middleware