Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devsafix/interview-practice


https://github.com/devsafix/interview-practice

Last synced: 12 days ago
JSON representation

Awesome Lists containing this project

README

        

Here’s a list of **70 technical and interpersonal questions** with **easy-to-understand answers**. These cover **JavaScript, HTML, CSS, Redux, React, Node.js, MongoDB, and Express**, plus some **behavioral questions**.

---

## **Technical Questions (50 Questions) – Marks: 10**

### **JavaScript (10 Questions)**
1. **What is the difference between `let`, `const`, and `var`?**
- `let` and `const` are block-scoped, while `var` is function-scoped. `const` can't be reassigned, while `let` can.

2. **What are closures?**
- A closure is when a function remembers variables from its parent scope, even after the parent function has finished running.

3. **How does event delegation work?**
- It allows us to handle events on parent elements instead of many child elements by capturing events as they bubble up.

4. **What is `async/await`, and how is it different from promises?**
- `async/await` makes code that handles promises easier to read, like synchronous code.

5. **What is hoisting in JavaScript?**
- Variables and functions are moved to the top of their scope before the code runs, so you can use them before declaring them.

6. **How is deep cloning different from shallow cloning?**
- Shallow cloning copies only the first layer of an object, while deep cloning copies everything.

7. **What are higher-order functions?**
- Functions that take other functions as arguments or return them (like `map` or `filter`).

8. **What is the event loop?**
- It’s a mechanism in JavaScript that handles asynchronous tasks, making sure code runs in the right order.

9. **What are `call()`, `apply()`, and `bind()`?**
- They let you change the value of `this` in a function. `call` and `apply` run the function immediately, but `bind` returns a new function.

10. **What is debouncing?**
- Debouncing ensures a function runs only after waiting a certain amount of time, no matter how often it's triggered (useful for search boxes).

---

### **HTML & CSS (10 Questions)**
1. **What are semantic HTML elements?**
- Elements like `` and `` that describe their purpose, making code more readable.

2. **What is the difference between `id` and `class`?**
- An `id` is unique to one element, while a `class` can be used for multiple elements.

3. **What is the box model in CSS?**
- It describes how margins, borders, padding, and the content area make up an element.

4. **How do CSS Flexbox and Grid differ?**
- Flexbox is best for layouts in one direction (row/column), while Grid is for two-dimensional layouts.

5. **What is the purpose of media queries?**
- They make websites responsive by applying CSS rules based on screen size.

6. **What is the difference between `relative`, `absolute`, and `fixed` positioning?**
- `relative` is based on the element's normal position, `absolute` is based on the nearest positioned parent, and `fixed` stays in the same spot on the screen.

7. **What are pseudo-classes?**
- Special states like `:hover` or `:focus` that apply styles under certain conditions.

8. **What is the difference between `inline`, `block`, and `inline-block` elements?**
- `inline` elements don’t break lines, `block` elements take up the whole width, and `inline-block` behaves like both.

9. **What is a CSS preprocessor?**
- Tools like SASS or LESS that add extra features to CSS, like variables and functions.

10. **What is z-index in CSS?**
- It controls the stack order of elements—higher values appear on top.

---

### **React (10 Questions)**
1. **What is React?**
- A JavaScript library for building user interfaces.

2. **What are components in React?**
- Reusable building blocks that return HTML (UI elements).

3. **What is the difference between state and props?**
- State is managed inside a component, while props are passed from parent to child.

4. **What is JSX?**
- JavaScript syntax extension that looks like HTML, used in React to describe UIs.

5. **What is a React hook?**
- Functions like `useState` or `useEffect` that let you use state and other features in function components.

6. **What is the virtual DOM?**
- A lightweight copy of the real DOM that React uses to update only changed elements.

7. **What is the purpose of `useEffect`?**
- It runs side effects like data fetching or subscriptions after rendering.

8. **What is conditional rendering?**
- Displaying different content based on conditions using React’s syntax.

9. **How does React handle forms?**
- By controlling input values through state (controlled components).

10. **What is React Router?**
- A library for handling routing/navigation in React applications.

---

### **Redux (10 Questions)**
1. **What is Redux?**
- A state management tool that stores the entire app state in a single object.

2. **What are actions in Redux?**
- Objects that describe what needs to be done (type + payload).

3. **What is a reducer?**
- A function that updates the state based on actions.

4. **What is the Redux store?**
- A place where the entire state of the application is kept.

5. **How does `dispatch` work?**
- It sends actions to the store to update the state.

6. **What are middleware in Redux?**
- Functions that run between dispatching actions and reaching reducers (e.g., `redux-thunk`).

7. **What is the purpose of `connect()`?**
- A function that connects React components to the Redux store.

8. **How do you handle asynchronous actions in Redux?**
- Using middleware like `redux-thunk` or `redux-saga`.

9. **What is Redux Toolkit?**
- A simplified way to use Redux with less boilerplate code.

10. **How do you debug Redux applications?**
- Using the Redux DevTools extension.

---

### **Node.js, Express, MongoDB (10 Questions)**
1. **What is Node.js?**
- A runtime that lets you run JavaScript on the server.

2. **What is Express.js?**
- A lightweight framework for building web servers with Node.js.

3. **What is middleware in Express?**
- Functions that run between receiving a request and sending a response.

4. **What is MongoDB?**
- A NoSQL database that stores data in JSON-like documents.

5. **How do you connect MongoDB with Node.js?**
- Using the `mongoose` or `mongodb` library.

6. **What is a REST API?**
- An API that follows REST principles, using HTTP methods like GET and POST.

7. **What is the difference between `GET` and `POST`?**
- `GET` fetches data, while `POST` sends new data to the server.

8. **How does JWT work?**
- It creates a token for secure user authentication.

9. **What is CORS?**
- A security feature that allows or blocks cross-origin requests.

10. **What is Socket.io?**
- A library for real-time communication between clients and servers.

---

## **Interpersonal Questions (20 Questions) – Marks: 10**

1. **How do you handle tight deadlines?**
- I prioritize tasks and communicate with my team to stay on track.

2. **Can you give an example of solving a conflict in a team?**
- I listened to both sides, identified the issue, and suggested a compromise.

3. **How do you manage stress?**
- I break down tasks into smaller parts and take short breaks to recharge.

4. **How do you handle feedback?**
- I welcome feedback as a chance to grow and improve.

5. **What would you do if you missed a project deadline?**
- I would notify the team immediately and suggest solutions to catch up.

---