Full Stack Developer Interview Questions & Answers
Frontend (React / AngularJS / Bootstrap)
Q: What are props and state in React?
A: Props are read-only data passed from parent to child components. State is data managed within the component that
can change over time.
Q: What is `useEffect` in React?
A: `useEffect` is a hook that lets you perform side effects (like API calls, subscriptions). It runs after rendering and can
re-run based on dependencies.
Q: How does React handle conditional rendering?
A: Using JavaScript expressions inside JSX, like ternary operators: `{isLoggedIn ? <Dashboard /> : <Login />}`
Q: How do you make a layout responsive in Bootstrap 5?
A: By using Bootstrap's grid system (e.g., `col-md-6`), flex utilities, media queries (`d-none d-sm-block`), and responsive
classes.
Backend (Python / Node.js / PHP)
Q: What is a decorator in Python?
A: A decorator is a function that modifies the behavior of another function. Used for logging, access control, etc.
Q: Explain RESTful APIs in Node.js with Express.
A: RESTful APIs use HTTP methods (GET, POST, PUT, DELETE) to perform CRUD operations. Example:
```js
app.get('/users', (req, res) => {
res.send(users);
});
```
Q: Difference between GET and POST in PHP?
A: `GET` appends data to the URL and is visible. `POST` sends data in the request body; safer for sensitive data.
Database (MySQL / MongoDB)
Full Stack Developer Interview Questions & Answers
Q: Write a query to find the second highest salary.
A: ```sql
SELECT MAX(salary)
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
```
Q: What are indexes in MySQL?
A: Indexes improve query speed by allowing faster data retrieval. However, they use more storage and slow down
`INSERT`/`UPDATE`.
Q: What is a document in MongoDB?
A: A document is a JSON-like object (BSON) used to store data. Each document can have different fields, unlike fixed
columns in SQL.
Version Control / Git
Q: Difference between `git merge` and `git rebase`?
A: `git merge` keeps the history of both branches. `git rebase` moves your branch to the latest base, creating a cleaner,
linear history.
Q: What is `.gitignore`?
A: A `.gitignore` file tells Git which files or folders to ignore in a project (like `node_modules/`, `.env`, `__pycache__/`).