Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 4026–4050 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Use Suspense to handle the loading state while the component is loading.?

Short answer: import React, { Suspense } from 'react'; const LazyComponent = React.lazy(() => import('./LazyComponent')); function App() { return ( <Suspense fallback={<div>Loading...</div>}> <Laz…

React Read answer
Mid PDF
Wrap your app with BrowserRouter (or HashRouter):?

Short answer: import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; function App() { return ( <Router> <Switch> <Route exact path="/" component={Home} /> <Route path=&q…

React Read answer
Mid PDF
Reducer: A pure function that returns the next state.?

Short answer: function counterReducer(state = 0, action) { switch (action.type) { case 'INCREMENT': return state + 1; default: return state; } } Example code function counterReducer(state = 0, action) { switch (action.ty…

React Read answer
Mid PDF
Only call hooks from React functions?

Short answer: (functional components or custom hooks) React enforces these rules with a linter: eslint-plugin-react-hooks. Real-world example (ShopNest) ShopNest’s cart icon uses useState for count and useEffect to load…

React Read answer
Mid PDF
What are the main features of React?

Short answer: JSX – JavaScript + XML Components – Reusable and composable Virtual DOM – Efficient DOM updates Unidirectional data flow – One-way data binding Lifecycle methods (in class components) Hooks (in functional c…

React Read answer
Junior PDF
What is JSX?

Short answer: Can browsers read JSX directly? JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫 No, browsers cannot read JSX directly.…

React Read answer
Mid PDF
State updates with closures: If using state in a function inside useEffect, make?

Short answer: sure to account for the most recent state. Real-world example (ShopNest) ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount. Say this in the interview Define — one cle…

React Read answer
Mid PDF
JSS: A framework-agnostic CSS-in-JS solution that works well with React.?

Short answer: These libraries help solve problems like global namespace conflicts and style collisions in large React applications, allowing for scoped, dynamic styles. Real-world example (ShopNest) ShopNest’s storefront…

React Read answer
Mid PDF
CSS Modules:?

Short answer: Scoped CSS that helps avoid name collisions. import styles from './App.module.css'; function App() { return <div className={styles.container}>Hello, world!</div>; Real-world example (ShopNest) S…

React Read answer
Mid PDF
ESLint: A static code analysis tool that identifies problematic patterns in JavaScript,?

Short answer: making sure your code follows a consistent style. Real-world example (ShopNest) ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state. Say t…

React Read answer
Mid PDF
Assertions: Use expect() to assert the expected behavior.?

Short answer: Example: import { render, screen, fireEvent } from '@testing-library/react'; import MyComponent from './MyComponent'; test('renders the component and interacts', () => { render(<MyComponent />); co…

React Read answer
Mid PDF
React's useEffect Dependency Analysis:?

Short answer: If using hooks, make sure you are providing the correct dependencies to useEffect and useMemo, and avoid unnecessary recalculations. Real-world example (ShopNest) ShopNest’s cart icon uses useState for coun…

React Read answer
Mid PDF
Virtualization: Use libraries like react-window or react-virtualized to only render?

Short answer: the items that are visible in the viewport. Example of list optimization with key: const List = ({ items }) => { return ( <ul> {items.map(item => ( <li key={item.id}>{item.name}</li>…

React Read answer
Junior PDF
Define routes using the <Route /> component:

Short answer: function Home() { return &lt;h1&gt;Home Page&lt;/h1&gt;; } function About() { return &lt;h1&gt;About Page&lt;/h1&gt;; } Example code function Home() { return &lt;h1&gt;Home Page&lt;/h1&gt;; } function About…

React Read answer
Mid PDF
Store: Holds the state and dispatches actions.?

Short answer: import { createStore } from 'redux'; const store = createStore(counterReducer); Example code import { createStore } from 'redux'; const store = createStore(counterReducer); Real-world example (ShopNest) Pro…

React Read answer
Junior PDF
What is JSX?

Short answer: JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = &lt;h1&gt;Hello, world!&lt;/h1&gt;; 🚫 No, browsers cannot read JSX directly. JSX needs to be transpiled (e.g…

React Read answer
Mid PDF
Overusing useEffect: Using useEffect for trivial things (e.g., directly?

Short answer: manipulating the DOM when it’s unnecessary) can lead to performance issues. Real-world example (ShopNest) ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount. Say this…

React Read answer
Mid PDF
Logout: Remove the token from storage and redirect to the login page.?

Short answer: Example: function App() { const isAuthenticated = localStorage.getItem('authToken'); return isAuthenticated ? &lt;Dashboard /&gt; : &lt;Login /&gt;; } For handling OAuth or third-party login (e.g., with Goo…

React Read answer
Mid PDF
Third-party libraries:?

Short answer: Use performance monitoring tools like why-did-you-render to detect unnecessary re-renders in functional components. Example: npm install @welldone-software/why-did-you-render Testing React Components Real-w…

React Read answer
Mid PDF
Inefficient List Rendering: Rendering large lists or complex components without?

Short answer: optimization can degrade performance, especially if each item is re-rendered every time the parent changes. Real-world example (ShopNest) When rendering cart lines, use a stable key={item.id} —not the array…

React Read answer
Mid PDF
How does React differ from other JavaScript frameworks?

Short answer: Feature React Angular Vue Type Library (UI focused) Framework (full-featured) Framework (lightweight) DOM Handling Virtual DOM Real DOM Virtual DOM Data Binding One-way Two-way Both supported Learning Curve…

React Read answer
Mid PDF
Ensure Accessibility: Use semantic HTML to make content accessible to search?

Short answer: engines. Example (with react-helmet): import { Helmet } from 'react-helmet'; function MyPage() { return ( &lt;div&gt; &lt;Helmet&gt; &lt;title&gt;My SEO Optimized Page&lt;/title&gt; &lt;meta name=&quot;desc…

React Read answer
Mid PDF
State updates in loops: Avoid unnecessary re-renders or state updates inside loops?

Short answer: or effects that trigger multiple renders. ⚙ Miscellaneous React Concepts Real-world example (ShopNest) ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them…

React Read answer
Mid PDF
Styled-components (CSS-in-JS):?

Short answer: CSS-in-JS allows writing actual CSS inside JavaScript files. Supports dynamic styling and theming. import styled from 'styled-components'; const Button = styled.button` background: ${(props) =&gt; (props.pr…

React Read answer
Mid PDF
Parcel: A zero-config bundler that provides a fast alternative to Webpack.?

Short answer: Many of these tools are integrated automatically when you use CRA or Next.js, but they can be configured or customized in more advanced setups. Real-world example (ShopNest) ShopNest’s storefront is React:…

React Read answer

React.js React.js Tutorial · React

Short answer: import React, { Suspense } from 'react'; const LazyComponent = React.lazy(() => import('./LazyComponent')); function App() { return ( <Suspense fallback={<div>Loading...</div>}> <LazyComponent /> </Suspense> ); } React.lazy enables dynamic imports for code splitting. Suspense lets you specify a loading state while waiting for the component to load.

Real-world example (ShopNest)

ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; function App() { return ( <Router> <Switch> <Route exact path="/" component={Home} /> <Route path="/about" component={About} /> </Switch> </Router> ); }

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: function counterReducer(state = 0, action) { switch (action.type) { case 'INCREMENT': return state + 1; default: return state; } }

Example code

function counterReducer(state = 0, action) { switch (action.type) { case 'INCREMENT': return state + 1; default: return state;
}
}

Real-world example (ShopNest)

ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: (functional components or custom hooks) React enforces these rules with a linter: eslint-plugin-react-hooks.

Real-world example (ShopNest)

ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: JSX – JavaScript + XML Components – Reusable and composable Virtual DOM – Efficient DOM updates Unidirectional data flow – One-way data binding Lifecycle methods (in class components) Hooks (in functional components)

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Can browsers read JSX directly? JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫 No, browsers cannot read JSX directly. JSX needs to be transpiled (e.g., using Babel) into regular JavaScript.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: sure to account for the most recent state.

Real-world example (ShopNest)

ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: These libraries help solve problems like global namespace conflicts and style collisions in large React applications, allowing for scoped, dynamic styles.

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Scoped CSS that helps avoid name collisions. import styles from './App.module.css'; function App() { return <div className={styles.container}>Hello, world!</div>;

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: making sure your code follows a consistent style.

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Example: import { render, screen, fireEvent } from '@testing-library/react'; import MyComponent from './MyComponent'; test('renders the component and interacts', () => { render(<MyComponent />); const button = screen.getByText('Click me'); fireEvent.click(button); expect(screen.getByText('Clicked!')).toBeInTheDocument(); });

Example code

import { render, screen, fireEvent } from '@testing-library/react'; import MyComponent from './MyComponent'; test('renders the component and interacts', () => { render(<MyComponent />); const button = screen.getByText('Click me'); fireEvent.click(button); expect(screen.getByText('Clicked!')).toBeInTheDocument(); });

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: If using hooks, make sure you are providing the correct dependencies to useEffect and useMemo, and avoid unnecessary recalculations.

Real-world example (ShopNest)

ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: the items that are visible in the viewport. Example of list optimization with key: const List = ({ items }) => { return ( <ul> {items.map(item => ( <li key={item.id}>{item.name}</li> ))} </ul> ); };

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: function Home() { return <h1>Home Page</h1>; } function About() { return <h1>About Page</h1>; }

Example code

function Home() { return <h1>Home Page</h1>;
} function About() { return <h1>About Page</h1>;
}

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: import { createStore } from 'redux'; const store = createStore(counterReducer);

Example code

import { createStore } from 'redux'; const store = createStore(counterReducer);

Real-world example (ShopNest)

ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫 No, browsers cannot read JSX directly. JSX needs to be transpiled (e.g., using Babel) into regular JavaScript. JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫…… No, browsers cannot read JSX directly. JSX needs to be…

Explain a bit more

transpiled (e.g., using Babel) into regular JavaScript. JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫 No, browsers cannot read JSX directly. JSX needs to be transpiled (e.g., using Babel) into regular JavaScript. JSX stands for JavaScript XML. It lets you write HTML-like syntax in JavaScript. const element = <h1>Hello, world!</h1>; 🚫 No, browsers cannot read JSX directly. JSX needs to be transpiled (e.g., using Babel) into regular JavaScript.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: manipulating the DOM when it’s unnecessary) can lead to performance issues.

Real-world example (ShopNest)

ShopNest’s cart icon uses useState for count and useEffect to load the cart once on mount.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Example: function App() { const isAuthenticated = localStorage.getItem('authToken'); return isAuthenticated ? <Dashboard /> : <Login />; } For handling OAuth or third-party login (e.g., with Google or Facebook), you might use a library like Firebase or Auth0.

Example code

Example: function App() { const isAuthenticated = localStorage.getItem('authToken');
return isAuthenticated ? <Dashboard /> : <Login />;
}
For handling OAuth or third-party login (e.g., with Google or Facebook), you might use a library like Firebase or Auth0.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Use performance monitoring tools like why-did-you-render to detect unnecessary re-renders in functional components. Example: npm install @welldone-software/why-did-you-render Testing React Components

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: optimization can degrade performance, especially if each item is re-rendered every time the parent changes.

Real-world example (ShopNest)

When rendering cart lines, use a stable key={item.id}—not the array index—so React updates the right row after delete.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Feature React Angular Vue Type Library (UI focused) Framework (full-featured) Framework (lightweight) DOM Handling Virtual DOM Real DOM Virtual DOM Data Binding One-way Two-way Both supported Learning Curve Medium Steep Easy

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: engines. Example (with react-helmet): import { Helmet } from 'react-helmet'; function MyPage() { return ( <div> <Helmet> <title>My SEO Optimized Page</title> <meta name="description" content="Description of my page for SEO" /> </Helmet> <h1>Welcome to My SEO Page</h1> </div> ); }

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: or effects that trigger multiple renders. ⚙ Miscellaneous React Concepts

Real-world example (ShopNest)

ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: CSS-in-JS allows writing actual CSS inside JavaScript files. Supports dynamic styling and theming. import styled from 'styled-components'; const Button = styled.button` background: ${(props) => (props.primary ? 'blue' : 'gray')}; color: white; `; function App() { return <Button primary={true}>Click Me</Button>;

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

React.js React.js Tutorial · React

Short answer: Many of these tools are integrated automatically when you use CRA or Next.js, but they can be configured or customized in more advanced setups.

Real-world example (ShopNest)

ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details