Full Stack Development – Important Questions and Answers


1. What is Virtual DOM in React?

Virtual DOM is a lightweight copy of the real DOM used by React to improve performance.

How it works:

  • React creates a virtual DOM in memory
  • Compares it with previous version (diffing)
  • Updates only changed parts in real DOM

Advantage:

  • Faster updates
  • Efficient rendering
  • Improved performance

2. Explain Props in React with example.

Props (Properties) are used to pass data from parent to child components.

Example:

function Welcome(props) {
return <h1>Hello {props.name}</h1>;
}

<Welcome name="Kavita" />

Features:

  • Read-only
  • Used for communication between components

3. What is State in React and how is it different from Props?

State is used to manage dynamic data within a component.

Example:

import { useState } from "react";

function Counter() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;
}

Difference:

PropsState
Passed from parentManaged inside component
ImmutableMutable
Read-onlyCan be updated

4. What are Node.js modules?

Modules are reusable blocks of code in Node.js.

Types:

  • Built-in modules (fs, http)
  • Custom modules

Example:

const fs = require('fs');

Advantage:

  • Code reusability
  • Better organization

5. Explain synchronous and asynchronous file operations in Node.js.

Synchronous:

  • Executes line by line
  • Blocks execution
const data = fs.readFileSync('file.txt', 'utf8');

Asynchronous:

  • Non-blocking
  • Faster execution
fs.readFile('file.txt', 'utf8', (err, data) => {
console.log(data);
});

6. How do props and state work together in React?

Props pass data, while state manages dynamic changes.

Example:

function Child(props) {
return <h1>{props.value}</h1>;
}

function Parent() {
const [data, setData] = useState("Hello");
return <Child value={data} />;
}

7. Create a simple React component using props and state.

import { useState } from "react";

function App() {
  const [name, setName] = useState("Student");

  return (
    <div>
      <h1>Hello {name}</h1>
      <button onClick={() => setName("Juhi")}>
        Change Name
      </button>
    </div>
  );
}

8. Explain working of Virtual DOM and compare with Real DOM.

Virtual DOM:

  • Stored in memory
  • Faster updates

Real DOM:

  • Directly manipulates UI
  • Slower performance

Comparison:

FeatureVirtual DOMReal DOM
SpeedFastSlow
UpdatesPartialFull
EfficiencyHighLow

9. What is Redux in React?

Redux is a state management library.

Components:

  • Store
  • Actions
  • Reducers

Flow:

Action → Reducer → Store → UI


10. Explain Redux flow with example.

const reducer = (state = 0, action) => {
if (action.type === "INCREMENT") {
return state + 1;
}
return state;
};

Flow:

  1. Dispatch action
  2. Reducer updates state
  3. Store holds updated state

11. What is React Router?

React Router is used for navigation between components.

Example:

import { BrowserRouter, Routes, Route } from "react-router-dom";

<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
</Routes>
</BrowserRouter>

12. How do Redux and Router work together in an application?

  • Redux manages global state
  • Router handles navigation

Example:

User logs in → Redux stores user → Router redirects to dashboard


13. What are REST API design principles?

REST APIs follow standard rules for communication.

Principles:

  • Stateless
  • Resource-based
  • Uses HTTP methods

14. Explain URI design in REST API.

URI represents a resource.

Example:

/api/students
/api/students/1

Rules:

  • Use nouns
  • Keep it simple

15. Explain HTTP methods in REST API.

MethodPurpose
GETRetrieve data
POSTCreate data
PUTUpdate data
DELETERemove data

16. What is representation in REST API?

Representation is the format of data exchanged.

Formats:

  • JSON
  • XML

Example:

{
"name": "Amit"
}

17. Create a simple Node.js web server.

const http = require('http');

const server = http.createServer((req, res) => {
res.write("Hello World");
res.end();
});

server.listen(3000);

18. How does Node.js handle HTTP requests?

  • Uses event-driven architecture
  • Handles multiple requests asynchronously

19. Demonstrate file handling in Node.js.

Write File:

fs.writeFile('test.txt', 'Hello', () => {});

Read File:

fs.readFile('test.txt', 'utf8', (err, data) => {
console.log(data);
});

20. What is Angular architecture?

Angular is a frontend framework based on components.

Main parts:

  • Components
  • Modules
  • Services

21. Explain Angular components.

Components control UI.

Example:

@Component({
selector: 'app-root',
template: '<h1>Hello</h1>'
})

22. What is data binding in Angular?

Data binding connects UI and logic.

Types:

  • One-way
  • Two-way

Example:

<input [(ngModel)]="name">

23. Explain form validation in Angular.

Validation ensures correct user input.

Example:

<input required minlength="3">

Features:

  • Built-in validators
  • Custom validation

Further Reading

Introduction to Django Framework and its Features

n8n vs Zapier: Which Automation Tool is Better in 2026?

Django Practice Exercise

Examples of Array Functions in PHP

Basic Programs in PHP

Registration Form Using PDO in PHP

Inserting Information from Multiple CheckBox Selection in a Database Table in PHP

programmingempire

princites.com

Leave a Reply

Your email address will not be published. Required fields are marked *