Interview Q&A

Technical interview Q&A plus 100+ career & HR questions—notice period, salary negotiation, resume, LinkedIn, freelancing, AI careers, and behavioral interviews with detailed, real-world answers.

Online interview practice exams

40 MCQs per stack · 80% pass · certificate + per-question feedback

All quizzes

ADO.NET — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

ASP.NET Core MVC — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

ASP.NET Core — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

ASP.NET Web API — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Agile & Scrum — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Angular — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Azure DevOps — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

C# Coding Interview — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

C# Collections — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

C# OOP — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Design Patterns & SOLID — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Entity Framework Core — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Gang of Four Patterns — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Git & GitHub — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

JavaScript — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

LINQ — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Managerial Interview — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Microservices — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Microsoft Azure — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Node.js — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

React.js — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

SQL & Databases — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Unit Testing — Interview Practice Exam

40 questions · 60 min · Pass 80%

Start practice exam

Popular tracks

React.js React.js Tutorial · React

pplications. It helps developers create reusable UI components, manage state efficiently,

nd update the UI in a performant way.

✅ Why use React?

  • Easy to break UIs into components
  • Efficient updates with Virtual DOM
  • Rich ecosystem (React Router, Redux, etc.)
  • Backed by Facebook and a large community
Permalink

React.js React.js Tutorial · React

(Don’t call hooks inside loops, conditions, or nested functions.)

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: props change. If not properly optimized, this can lead to performance bottlenecks. Example: A large component tree where every small state change causes re-renders for the entire tree.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Use the Profiler tab to measure the render times and identify slow components. Check for unnecessary re-renders and optimize with React.memo or shouldComponentUpdate.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Library (for testing React components).

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

xios.get.mockResolvedValue({ data: 'mock data' });

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

ReactDOMServer.renderToString().

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: ssets. It’s highly configurable and can be used for React apps, though tools like CRA automate this.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: You can import regular CSS files directly into your components. import './App.css'; // Regular CSS file

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

styled based on props or state.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

i18next library to manage translation strings and locale settings.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Fetch) to authenticate and get a token.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

on the server. This allows search engines to crawl the content.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

dependencies can lead to bugs or infinite loops.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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)

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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>

);

}
Permalink

React.js React.js Tutorial · React

time it takes for React to render.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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.
Permalink

React.js React.js Tutorial · React

update only the items that have changed.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

component. Never call hooks inside loops, conditions, or nested functions.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

fireEvent() to simulate user interaction.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: wait waitFor(() =&gt; screen.getByText('Data loaded')); expect(screen.getByText('Data loaded')).toBeInTheDocument(); }); Here, we mock the fetch function to return mock data, then test whether it appears in the component.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Example:

class ErrorBoundary extends React.Component {

constructor(props) {

super(props);

this.state = { hasError: false };
}

static getDerivedStateFromError(error) {

return { hasError: true }; // Update state to trigger a fallback

UI

}

componentDidCatch(error, info) {

console.error("Error caught by Error Boundary:", error, info);

}

render() {

if (this.state.hasError) {
return <h1>Something went wrong!</h1>;
}
return this.props.children;
}
}

export default ErrorBoundary;

You can wrap parts of your app in this ErrorBoundary to gracefully handle errors.

Permalink

React.js React.js Tutorial · React

nd making it interactive.

Example with express and React:

const express = require('express');
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const App = require('./App');
const server = express();

server.get('*', (req, res) => {

const content = ReactDOMServer.renderToString(<App />);

res.send(`

<html>

<head><title>SSR Example</title></head>

<body>

<div id="root">${content}</div>

</body>

</html>

`);

});

server.listen(3000, () => console.log('Server running on

In this setup, React renders the app to HTML on the server, then the client "hydrates" it for

interactivity.
Permalink

React.js React.js Tutorial · React

(ES6+) and JSX syntax in React.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: function Home() { return &lt;h1&gt;Home Page&lt;/h1&gt;; } function About() { return &lt;h1&gt;About Page&lt;/h1&gt;; }

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

understand the context of your content.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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.

Permalink

React.js React.js Tutorial · React

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();

});

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: the items that are visible in the viewport. Example of list optimization with key: const List = ({ items }) =&gt; { return ( &lt;ul&gt; {items.map(item =&gt; ( &lt;li key={item.id}&gt;{item.name}&lt;/li&gt; ))} &lt;/ul&gt; ); };

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

sure to account for the most recent state.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

making sure your code follows a consistent style.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

rendered or a function is called.

Example of a simple unit test:

import { render, screen, fireEvent } from '@testing-library/react';

import Counter from './Counter';

test('increments counter on button click', () => {

render(<Counter />);

const button = screen.getByText('Increment');

fireEvent.click(button);

expect(screen.getByText('1')).toBeInTheDocument();

});

In this test, you:

Permalink

React.js React.js Tutorial · React

the render method, it can block the UI thread, resulting in slow rendering.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

internationalization.

Example with react-i18next:

npm install react-i18next i18next

import { useTranslation } from 'react-i18next';

function MyComponent() {

const { t } = useTranslation();
return <h1>{t('welcome_message')}</h1>;
}

In this case, t('welcome_message') will fetch the corresponding translation for the

current language set in your app.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: state changes frequently or if the shouldComponentUpdate method isn’t properly utilized.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

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>

);

}
Permalink

React.js React.js Tutorial · React

or effects that trigger multiple renders. ⚙ Miscellaneous React Concepts

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Components are the building blocks of a React application. Each component is an isolated, reusable piece of the UI. ✅ Example: function Welcome(props) { return &lt;h1&gt;Hello, {props.name}&lt;/h1&gt;; }

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

  • 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>;
}
Permalink

React.js React.js Tutorial · React

Feature Class

Component

Functional

Component

Syntax ES6 Class Function

State this.state useState hook

Lifecycle methods Yes Use useEffect, etc.

Code size More verbose Cleaner and shorter

✅ Example:

Class:
class Welcome extends React.Component {

render() {

return <h1>Hello, {this.props.name}</h1>;
}
}

Functional:

function Welcome(props) {

return <h1>Hello, {props.name}</h1>;
}
Permalink

React.js React.js Tutorial · React

Answer: JSX can create new function references on every render, causing unnecessary re-renders.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

The Virtual DOM is a lightweight in-memory representation of the real DOM. React

updates the Virtual DOM first and compares it with the previous version, only applying the

necessary changes to the real DOM.

✅ Benefit: Improves performance by reducing real DOM operations.

Permalink

React.js React.js Tutorial · React

React’s reconciliation algorithm compares the new Virtual DOM with the old one using a

diffing algorithm. It:

  • Identifies what changed (nodes, attributes, etc.)
  • Applies minimum changes to the actual DOM
  • Uses keys to track list item changes efficiently
Permalink

React.js React.js Tutorial · React

Answer: Props (short for "properties") are read-only data passed from a parent component to a child. ✅ Example: function Greeting(props) { return &lt;h1&gt;Hello, {props.name}!&lt;/h1&gt;; } &lt;Greeting name="Alice" /&gt;

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Utility-first CSS framework that uses predefined classes for layout and styling. Great for rapid development.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

State is data that is local to a component and can change over time.

✅ Example using useState:

import { useState } from 'react';

function Counter() {

const [count, setCount] = useState(0);
return <button onClick={() => setCount(count +

1)}>{count}</button>;

}
Permalink

React.js React.js Tutorial · React

Answer: Functional component: Use setState from useState. Class component: Use this.setState(). ✅ Example: const [name, setName] = useState("John"); setName("Doe");

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Feature Props State Mutable? ❌ No (read-only) ✅ Yes Who sets it? Parent component Component itself Used for Passing data Handling internal data

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Keys help React identify which items have changed, been added, or removed. ✅ Example: {items.map(item =&gt; ( &lt;li key={item.id}&gt;{item.name}&lt;/li&gt; ))} 🛑 Avoid using array index as key unless absolutely necessary.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: ✅ Using ternary: {isLoggedIn ? &lt;Logout /&gt; : &lt;Login /&gt;} ✅ Using short-circuit: {isVisible &amp;&amp; &lt;Sidebar /&gt;}

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Fragments let you return multiple elements without adding an extra DOM node. ✅ Example: &lt;&gt; &lt;h1&gt;Title&lt;/h1&gt; &lt;p&gt;Description&lt;/p&gt; &lt;/&gt; 🔍 Equivalent to &lt;React.Fragment&gt; but shorter.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: React uses camelCase syntax and passes functions directly. ✅ Example: &lt;button onClick={handleClick}&gt;Click Me&lt;/button&gt;

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: React wraps native browser events in a SyntheticEvent object for cross-browser compatibility. ✅ Example: function handleClick(e) { console.log(e); // SyntheticEvent }

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: ccess value via useState ref Example use case Forms with validation Quick, simple input fields ✅ Controlled: &lt;input value={value} onChange={e =&gt; setValue(e.target.value)} /&gt; ✅ Uncontrolled: &lt;input ref={inputRef} /&gt;

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Use controlled components and onChange handlers.

✅ Example:

function Form() {

const [name, setName] = useState("");

const handleSubmit = e => {

e.preventDefault();

console.log(name);

};

return (

<form onSubmit={handleSubmit}>

<input value={name} onChange={e => setName(e.target.value)} />

<button type="submit">Submit</button>

</form>

);

}
Permalink

React.js React.js Tutorial · React

Lifting state up means moving state to the nearest common ancestor when multiple

components need to share or modify it.

✅ Example:

function Parent() {

const [value, setValue] = useState("");
return (

<>

<Input value={value} onChange={setValue} />

<Display value={value} />

</>

);

}

function Input({ value, onChange }) {

return <input value={value} onChange={e =>

onChange(e.target.value)} />;

}

function Display({ value }) {

return <p>{value}</p>;
}

React Hooks

Permalink

React.js React.js Tutorial · React

Answer: Hooks are functions that let you "hook into" React state and lifecycle features in functional components. Before hooks, only class components could use state and lifecycle methods. ✅ Hooks introduced in React 16.8.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

useState lets you add state to functional components.

✅ Syntax:

const [state, setState] = useState(initialValue);

✅ Example:

import { useState } from 'react';

function Counter() {

const [count, setCount] = useState(0);
return (

<button onClick={() => setCount(count + 1)}>

Count: {count}

</button>

);

}
Permalink

React.js React.js Tutorial · React

useEffect lets you run side effects in functional components (like data fetching,

subscriptions, etc.).

✅ Syntax:

useEffect(() => {

// Side effect

return () => {

// Cleanup

};

}, [dependencies]);

✅ Common use cases:

  • Fetching data
  • Event listeners
  • Updating DOM directly
  • Subscribing to services
Permalink

React.js React.js Tutorial · React

✅ componentDidMount:

useEffect(() => {

console.log("Component mounted");

}, []); // Empty array = run once on mount

✅ componentWillUnmount:

useEffect(() => {

const id = setInterval(() => console.log("tick"), 1000);
return () => {

clearInterval(id); // Cleanup

console.log("Component unmounted");

};

}, []);

Permalink

React.js React.js Tutorial · React

Feature useEffect useLayoutEffect

When it runs After paint Before paint (after DOM mutation)

Use for Async tasks, data

fetching

Measuring DOM, sync layout

Blocking paint? ❌ No ✅ Yes (can cause jank)

🔍 Use useLayoutEffect only when layout measurement or synchronously modifying

DOM is necessary.

Permalink

React.js React.js Tutorial · React

useRef creates a mutable reference that persists across renders.

✅ Syntax:

const ref = useRef(initialValue);

✅ Use cases:

  • Accessing DOM elements
  • Persisting values without causing re-renders
  • Storing previous values

✅ Example (DOM access):

const inputRef = useRef();

function focusInput() {

inputRef.current.focus();

}
return <input ref={inputRef} />;

✅ Example (storing previous state):

const prevCount = useRef();

useEffect(() => {

prevCount.current = count;

});

Permalink

React.js React.js Tutorial · React

useContext lets you consume a context value without using a Context.Consumer.

✅ Example:

const ThemeContext = React.createContext("light");

function App() {

return (

<ThemeContext.Provider value="dark">

<Toolbar />

</ThemeContext.Provider>

);

}

function Toolbar() {

const theme = useContext(ThemeContext);
return <div className={`theme-${theme}`}>Theme is {theme}</div>;
}
Permalink

React.js React.js Tutorial · React

Custom hooks are just functions that use hooks.

✅ Example:

import { useState, useEffect } from 'react';

function useWindowWidth() {

const [width, setWidth] = useState(window.innerWidth);

useEffect(() => {

const handleResize = () => setWidth(window.innerWidth);

window.addEventListener('resize', handleResize);

return () => window.removeEventListener('resize', handleResize);

}, []);

return width;
}

// Usage

function Component() {

const width = useWindowWidth();
return <p>Window width: {width}</p>;
}
Permalink

React.js React.js Tutorial · React

Answer: void recalculating heavy logic on every render. const filteredList = useMemo(() =&gt; { return items.filter(item =&gt; item.includes(searchTerm)); }, [items, searchTerm]);

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

useCallback memoizes a function to avoid unnecessary re-creations.

✅ Syntax:

const memoizedCallback = useCallback(() => {

doSomething(a, b);

}, [a, b]);

✅ Use case:

  • Prevents unnecessary re-renders of child components receiving functions as props.

const handleClick = useCallback(() => {

console.log("Clicked!");

}, []);

Permalink

React.js React.js Tutorial · React

Class Component

Pitfall

Hook-Based Solution

this binding issues ✅ No this in hooks

Boilerplate code ✅ More concise with hooks

Sharing logic ✅ Custom hooks enable reuse

Complex lifecycle logic ✅ useEffect unifies side

effects

✅ Hooks lead to simpler, more readable, and reusable code.

React State Management – Redux,

Context API, and More

Permalink

React.js React.js Tutorial · React

Redux is a predictable state container for JavaScript apps, often used with React.

✅ Why use Redux?

  • Centralizes app state
  • Makes state predictable and traceable
  • Useful in large-scale apps with deeply nested components
  • Works well with middleware for async tasks (like API calls)
Permalink

React.js React.js Tutorial · React

Local State (useState) Global State (Redux/Context)

Exists within a component Shared across multiple components

Ideal for UI-level concerns Ideal for app-wide data (e.g., auth,

theme)

Cannot be accessed by

siblings

Easily accessible across app

Permalink

React.js React.js Tutorial · React

Answer: sync support Manual Built-in via middleware DevTools ❌ Limited ✅ Excellent support

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: ✅ Create context: const ThemeContext = React.createContext(); ✅ Provide context: &lt;ThemeContext.Provider value="dark"&gt; &lt;App /&gt; &lt;/ThemeContext.Provider&gt; ✅ Consume context: const theme = useContext(ThemeContext);

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Middleware are functions that sit between dispatching an action and reaching the

reducer.

✅ Common uses:

  • Handle async operations (API calls)
  • Logging
  • Error handling

✅ Examples:

  • redux-thunk
  • redux-saga
  • redux-logger

✅ Example (redux-logger):

const logger = store => next => action => {

console.log('dispatching', action);

return next(action);

};

Permalink

React.js React.js Tutorial · React

ctions

Generator-based side effects

Complexity Simple Advanced

Syntax Imperative (JS functions) Declarative (generators/yield)

Use case Basic async logic Complex flows, retries, delays

✅ Thunk example:

const fetchUser = () => (dispatch) => {

fetch("/api/user")

.then(res => res.json())

.then(data => dispatch({ type: "SET_USER", payload: data }));

};

Permalink

React.js React.js Tutorial · React

Redux Toolkit (RTK) is the official, recommended way to write Redux logic.

✅ RTK Benefits:

  • Less boilerplate
  • Built-in createSlice, createAsyncThunk, configureStore
  • Integrated DevTools
  • Handles immutability under the hood

✅ Example:

const counterSlice = createSlice({

name: 'counter',

initialState: 0,

reducers: {

increment: (state) => state + 1,

},

});

export const { increment } = counterSlice.actions;
Permalink

React.js React.js Tutorial · React

✅ Using middleware, such as:

  • redux-thunk – lets you dispatch functions
  • redux-saga – handles complex side effects via generators
  • redux-observable – uses RxJS

✅ Example with thunk:

const fetchData = () => async (dispatch) => {

const response = await fetch('/data');
const data = await response.json();

dispatch({ type: 'SET_DATA', payload: data });

};

Permalink

React.js React.js Tutorial · React

Selectors are functions that read and return data from the store, often with memoization.

✅ Purpose:

  • Centralize access to state shape
  • Avoid duplication
  • Optimize performance

✅ Basic selector:

const selectUser = (state) => state.user;

✅ With reselect:

import { createSelector } from 'reselect';

const selectCartItems = (state) => state.cart.items;

const selectTotalPrice = createSelector(

[selectCartItems],

(items) => items.reduce((sum, item) => sum + item.price, 0)

);

React Routing

Permalink

React.js React.js Tutorial · React

Answer: pplications (SPA). Declarative routing: Allows you to define routes using JSX. Dynamic routing: Routes can be dynamically rendered based on the state, props, or URL.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

You can implement routing in React using React Router. Here's how:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

web server

Useful for apps without server-side

routing (e.g., static sites)

History API

support

Uses the HTML5 history API Uses the URL's hash to manage

routing

SEO

friendliness

SEO-friendly (with server-side

configuration)

Less SEO-friendly due to # in the

URL

Permalink

React.js React.js Tutorial · React

To create nested routes, place a <Route /> inside another route's component.

Example:

import { BrowserRouter as Router, Route, Switch, Link } from

'react-router-dom';

function App() {

return (

<Router>

<div>

<nav>

<Link to="/about/team">Team</Link>

<Link to="/about/company">Company</Link>

</nav>

<Switch>

<Route exact path="/about" component={About} />

<Route path="/about/team" component={Team} />

<Route path="/about/company" component={Company} />

</Switch>

</div>

</Router>

);

}

function About() {

return <h2>About Page</h2>;
}

function Team() {

return <h3>Team Page</h3>;
}

function Company() {

return <h3>Company Page</h3>;
}
Permalink

React.js React.js Tutorial · React

You can pass URL parameters (also called dynamic routes) using : in the route path.

Example:

import { BrowserRouter as Router, Route, Switch, useParams } from

'react-router-dom';

function App() {

return (

<Router>

<Switch>

<Route path="/user/:id" component={User} />

</Switch>

</Router>

);

}

function User() {

const { id } = useParams(); // Access the dynamic parameter
return <h1>User ID: {id}</h1>;
}

In the example above, visiting /user/1 will display User ID: 1.

Permalink

React.js React.js Tutorial · React

ctive

style

No built-in active

style

utomatically adds an active class when the route is

ctive

Use case Basic navigation For creating navigation menus with active links (e.g.,

highlighting the active link)

Example of NavLink:

import { NavLink } from 'react-router-dom';

function Navbar() {

return (

<nav>

<NavLink to="/" activeClassName="active">Home</NavLink>

<NavLink to="/about" activeClassName="active">About</NavLink>

</nav>

);

}
Permalink

React.js React.js Tutorial · React

nd either redirects or renders the requested route.

Example:

import { Redirect, Route } from 'react-router-dom';

function ProtectedRoute({ component: Component, ...rest }) {

const isAuthenticated = false; // Replace with your auth logic
return (

<Route

{...rest}

render={(props) =>

isAuthenticated ? (

<Component {...props} />

) : (

<Redirect to="/login" />

}

/>

);

}

function App() {

return (

<Router>

<Switch>

<Route path="/login" component={Login} />

<ProtectedRoute path="/dashboard" component={Dashboard} />

</Switch>

</Router>

);

}

In this example, if the user is not authenticated, they will be redirected to the login page

when trying to access the /dashboard route.

Permalink

React.js React.js Tutorial · React

You can navigate programmatically using the useHistory hook (React Router v5) or

useNavigate hook (React Router v6).

For React Router v5 (useHistory):

import { useHistory } from 'react-router-dom';

function MyComponent() {

const history = useHistory();

const goToHome = () => {

history.push('/');

};

return <button onClick={goToHome}>Go to Home</button>;
}
For React Router v6 (useNavigate):

import { useNavigate } from 'react-router-dom';

function MyComponent() {

const navigate = useNavigate();

const goToHome = () => {

navigate('/');

};

return <button onClick={goToHome}>Go to Home</button>;
}

React Performance Optimization

Permalink

React.js React.js Tutorial · React

Common causes of performance issues include:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

React.memo is a higher-order component that memoizes functional components. It only

re-renders the component if its props have changed.

  • Before: Every re-render, even if props haven’t changed.
  • After: Prevents unnecessary re-renders when props remain the same.

const MyComponent = React.memo(function MyComponent({ name }) {

return <div>{name}</div>;

});

// MyComponent will only re-render if the `name` prop changes

Permalink

React.js React.js Tutorial · React

useMemo:

useMemo is a hook that memoizes the result of an expensive function call and only

recomputes the value when one of the dependencies changes.

  • Use case: Expensive calculations or operations that don’t need to be recalculated on

every render.

Example:

const expensiveValue = useMemo(() => computeExpensiveValue(a, b),

[a, b]);

// expensiveValue will only recompute when `a` or `b` changes

useCallback:

useCallback is used to memoize a function so it doesn’t get recreated on every render.

  • Use case: Prevents function re-creation when passing functions down to child

components (important when using React.memo or PureComponent).

Example:

const handleClick = useCallback(() => {

// handle the click event

}, [dependencies]); // Recreate the function only when dependencies

change

Permalink

React.js React.js Tutorial · React

Answer: Code splitting is the practice of breaking up the bundle into smaller chunks so that only the required code is loaded when needed, improving initial load performance. How to Implement:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Lazy loading is a design pattern where resources (like components) are loaded only when

they are needed (e.g., when they enter the viewport or the user navigates to the route).

In React, lazy loading is typically implemented using React.lazy and Suspense.

Example:

import { Suspense } from 'react';

const HeavyComponent = React.lazy(() => import('./HeavyComponent'));

function App() {

return (

<Suspense fallback={<div>Loading...</div>}>

<HeavyComponent />

</Suspense>

);

}

This ensures that the heavy component is only loaded when the app actually needs it.

Permalink

React.js React.js Tutorial · React

shouldComponentUpdate is a lifecycle method in class components that determines

whether a component should re-render. By default, a component re-renders when state or

props change, but shouldComponentUpdate allows you to optimize this behavior.

  • Return false to prevent a re-render.
  • Return true (or omit the method) to allow a re-render.

Example:

class MyComponent extends React.Component {

shouldComponentUpdate(nextProps, nextState) {

// Prevent re-render if props haven't changed

return nextProps.name !== this.props.name;
}

render() {

return <div>{this.props.name}</div>;
}
}
Permalink

React.js React.js Tutorial · React

Answer: Rendering large lists can cause performance issues if each item re-renders unnecessarily. Here are some strategies:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Pure Component is a React class component that automatically implements

shouldComponentUpdate with a shallow prop and state comparison.

  • Benefit: It prevents unnecessary re-renders by performing a shallow comparison of

props and state.

Example:

class MyComponent extends React.PureComponent {

render() {

return <div>{this.props.name}</div>;
}
}

Pure components are a good choice when you know that your component only depends on

props and state and you want to avoid unnecessary updates.

Permalink

React.js React.js Tutorial · React

Virtualization is a technique where only the items that are visible in the viewport are

rendered, while the others are not rendered until they come into view. This significantly

reduces the number of DOM nodes and boosts performance when rendering large lists.

Popular libraries for virtualization in React include:

  • react-window
  • react-virtualized

Example with react-window:

import { FixedSizeList as List } from 'react-window';

function MyList({ items }) {

return (

<List

height={400}

itemCount={items.length}

itemSize={35}

width={300}

{({ index, style }) => (

<div style={style}>{items[index]}</div>

)}

</List>

);

}

Only the visible items will be rendered, and as the user scrolls, new items will be loaded

dynamically.

Permalink

React.js React.js Tutorial · React

Debugging performance issues can be done using several tools and strategies:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: You test React components by writing unit tests that simulate rendering, interaction, and lifecycle behavior. Key Steps:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Jest is a JavaScript testing framework created by Facebook, commonly used for testing

React applications. It comes with:

  • Test runner: Executes test files.
  • Assertions: Provides functions like expect() for asserting conditions.
  • Mocks: Mocking capabilities for API calls or functions.
  • Snapshots: Captures UI output at a given time.

How to use Jest with React:

Install Jest:

npm install --save-dev jest

Permalink

React.js React.js Tutorial · React

ccessibility

Shallow rendering, component

state, and props

Testing Approach Encourages testing DOM

behavior and accessibility

Encourages testing component

internals and methods
Integration with

React

Built with React’s rendering

behavior in mind

Requires enzyme adapter for

different React versions

Recommendation More modern, encourages

better testing practices

Still used, but React Testing

Library is more popular

Key difference:

  • React Testing Library focuses on testing the output of your components (UI

behavior), similar to how a user interacts with the app.

  • Enzyme focuses more on testing the internal implementation (component state,

methods).

Permalink

React.js React.js Tutorial · React

Answer: unit test checks a small unit of functionality, such as a React component. Here’s how you can write a unit test:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

To test component interactions like button clicks, form submissions, or other events, you

can use fireEvent or user-event (for more realistic user interactions).

Example using fireEvent:

import { render, screen, fireEvent } from '@testing-library/react';

import MyComponent from './MyComponent';

test('button click changes text', () => {

render(<MyComponent />);

const button = screen.getByText('Click me');

fireEvent.click(button);

expect(screen.getByText('You clicked!')).toBeInTheDocument();

});

Example using user-event (better for simulating real user interactions):

npm install --save-dev @testing-library/user-event

import { render, screen } from '@testing-library/react';

import userEvent from '@testing-library/user-event';

import MyComponent from './MyComponent';

test('button click changes text', () => {

render(<MyComponent />);

const button = screen.getByText('Click me');

userEvent.click(button);

expect(screen.getByText('You clicked!')).toBeInTheDocument();

});

user-event is better because it simulates real user actions like clicks, typing, and more.

Permalink

React.js React.js Tutorial · React

Answer: To mock API calls in tests, you can use jest.mock() to mock functions or API calls. Mocking fetch or axios: Mock fetch: global.fetch = jest.fn(() =&gt; Promise.resolve({ json: () =&gt; Promise.resolve({ data: 'mock data' }), }) );

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: wait waitFor(() =&gt; screen.getByText('Loaded Data')); expect(screen.getByText('Loaded Data')).toBeInTheDocument(); }); In this case, waitFor() waits until the expected element appears in the DOM after an sync operation completes.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Snapshot testing is a way of testing a component’s rendered output by saving it to a

snapshot file and comparing it with future renders. This helps detect any unintended

changes in the UI.

How to write snapshot tests:

Run Jest with snapshot testing:

npm test -- --updateSnapshot

Permalink

React.js React.js Tutorial · React

Higher-Order Component (HOC) is a function that takes a component and returns a

new component with additional props or behavior.

  • Purpose: HOCs are used for code reuse, logic abstraction, and enhancing

components with common functionality (e.g., authentication, data fetching, etc.).

  • How it works: HOCs are like decorators that wrap a component and add extra logic

before rendering the component.

Example:

function withLoading(Component) {

return function WithLoading(props) {
if (props.isLoading) {
return <div>Loading...</div>;
}
return <Component {...props} />;

};

}
const MyComponent = ({ data }) => <div>{data}</div>;
const MyComponentWithLoading = withLoading(MyComponent);

In this example, withLoading is a higher-order component that adds loading state to

MyComponent.

Permalink

React.js React.js Tutorial · React

llowing more dynamic behavior and custom rendering.

  • Purpose: It enables a component to expose its logic while letting its consumers

define how the output is rendered.

Example:

class MouseTracker extends React.Component {
state = { x: 0, y: 0 };

handleMouseMove = (event) => {

this.setState({

x: event.clientX,

y: event.clientY,

});

};

render() {

return (

<div onMouseMove={this.handleMouseMove}>

{this.props.render(this.state)}

</div>

);

}
}

const App = () => (

<MouseTracker render={({ x, y }) => (

<h1>The mouse position is ({x}, {y})</h1>

)} />

);

In this example, MouseTracker uses the render prop pattern to allow the parent

component to decide how to render the mouse position data.

Permalink

React.js React.js Tutorial · React

Portal provides a way to render children into a different part of the DOM outside of the

parent component’s DOM hierarchy. This is particularly useful for scenarios like modals,

tooltips, or popups that need to visually break out of their parent component but still maintain

their React component state.

  • When to use: When you need to render content outside the DOM hierarchy of a

parent, without losing the React component context (e.g., for modals, overlays, etc.).

Example:

import React from 'react';

import ReactDOM from 'react-dom';

function Modal() {

return ReactDOM.createPortal(

<div className="modal">This is a modal</div>,

document.getElementById('modal-root') // Renders outside the

normal DOM tree

);

}

export default Modal;

In this case, the modal is rendered inside a specific part of the DOM (modal-root) even

though it is a child of the Modal component.

Permalink

React.js React.js Tutorial · React

Reconciliation is the process by which React updates the DOM efficiently when a

component's state or props change. React uses a virtual DOM to compare the new virtual

DOM tree with the previous one and determines the minimal set of changes required to

update the actual DOM.

Key Concepts:

  • Virtual DOM: A lightweight representation of the real DOM.
  • Diffing algorithm: React’s algorithm compares the old and new virtual DOMs to find

the differences (diffs) and apply the smallest set of changes.

Reconciliation Flow:

Permalink

React.js React.js Tutorial · React

React Fiber is a complete rewrite of React's reconciliation algorithm. It is designed to

improve the rendering performance and make React more responsive and capable of

handling asynchronous rendering.

Key Features:

  • Incremental Rendering: React Fiber allows rendering to be split into chunks, so it

can pause and resume work, improving responsiveness.

  • Prioritization: React can assign different priority levels to updates (e.g., user input

vs. background updates).

  • Async Rendering: Enables non-blocking UI updates, making React apps feel more

responsive.

Permalink

React.js React.js Tutorial · React

n Error Boundary is a React component that catches JavaScript errors in its child

components, logs those errors, and displays a fallback UI. This prevents the entire app from

crashing when an error occurs in a part of the component tree.

Usage:

Permalink

React.js React.js Tutorial · React

nd helps with SEO. SSR Process:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Static Site Generation (SSG) is a technique where HTML pages are generated at build

time. Unlike SSR, SSG pre-renders all pages during the build process, which results in

faster load times.

Example with Next.js (SSG):

import React from 'react';

export async function getStaticProps() {

const data = await fetchDataFromAPI();
return { props: { data } };
}

function Page({ data }) {

return <div>{data}</div>;
}

export default Page;

Here, getStaticProps is a Next.js function that fetches data during build time. The page

is pre-rendered and served as static HTML.

Permalink

React.js React.js Tutorial · React

Hydration refers to the process where React takes over the static HTML rendered by the

server and attaches event listeners and restores interactivity. This happens once the

JavaScript bundle is loaded on the client.

  • SSR: Server renders the HTML.
  • Hydration: React "hydrates" the server-rendered HTML to make it interactive.

This process allows the page to load quickly (thanks to the server-rendered HTML) and then

become fully interactive once React takes over.

React Ecosystem & Tools

Permalink

React.js React.js Tutorial · React

nd developer experience.

Why use Next.js?

  • Server-Side Rendering (SSR): Automatically generates HTML on the server for

better SEO and faster initial load.

  • Static Site Generation (SSG): Pre-renders pages at build time, improving

performance.

  • Automatic Code Splitting: Only loads the necessary JavaScript for the current

page.

  • File-Based Routing: Routing is based on the file system, making navigation easier.
  • API Routes: Allows you to build API endpoints directly inside your Next.js app.
  • Image Optimization: Automatically optimizes images for better performance.

Example:

npx create-next-app my-next-app

In this setup, the app can be SSR or SSG-enabled, providing better performance and SEO

out of the box.

Permalink

React.js React.js Tutorial · React

Create React App (CRA) is a boilerplate tool to set up a modern React app without

configuring build tools like Webpack, Babel, etc. It’s designed to help you focus on writing

code instead of spending time configuring tools.

Features:

  • Zero Configuration: It sets up Webpack, Babel, ESLint, and other essential tools.
  • Development Server: Provides a development server with hot reloading.
  • Production Build: Automates production optimizations like minification, asset

optimization, etc.

How to Use CRA:

npx create-react-app my-app

cd my-app

npm start

With CRA, you don’t have to manually configure Webpack or Babel. It gives you everything

you need to start building React applications right away.

Permalink

React.js React.js Tutorial · React

Some common build tools for React are:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: There are several ways to handle CSS in React applications, and each comes with its own pros and cons.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: CSS-in-JS libraries allow you to write CSS styles directly inside JavaScript files, enabling better component encapsulation and dynamic styling. Popular libraries include:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: ge: PropTypes.number.isRequired, }; In this example, PropTypes.string.isRequired ensures that the name prop is a string nd is required. If it’s not passed or is of the wrong type, React will display a warning in the console.

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: Internationalization (i18n) in React can be handled using libraries that help manage translations, time formats, and currency formatting. The most common libraries are:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Answer: uthentication in React apps is typically done using tokens (JWTs) and local storage to persist user sessions. Common Steps:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

React Native is a framework for building native mobile applications (iOS and Android)

using React and JavaScript. While React is for web development, React Native allows you

to create mobile apps with a similar paradigm but using native components (e.g., <View>

instead of <div>).

Key Differences:

  • React: Builds for the web, rendering HTML and managing DOM.
  • React Native: Builds for mobile, using native components and APIs for interaction

with mobile devices (camera, geolocation, etc.).

Example in React Native:

import { Text, View } from 'react-native';

function App() {

return (

<View>

<Text>Hello, React Native!</Text>

</View>

);

}

In React Native, the components map to native UI elements, such as <Text> for text,

<View> for containers, and <Button> for buttons.

Permalink

React.js React.js Tutorial · React

Managing forms in React can be tedious, but libraries like Formik and React Hook Form

simplify form handling by managing state, validation, and submission.

Formik:
  • Provides an easy way to manage form state, validation, and submission.
  • Supports validation using schemas (e.g., Yup).

Example with Formik:

import { Formik, Field, Form } from 'formik';

function MyForm() {

return (

<Formik

initialValues={{ name: '', email: '' }}

onSubmit={(values) => console.log(values)}

<Form>

<Field name="name" />

<Field name="email" />

<button type="submit">Submit</button>

</Form>

</Formik>

);

}

React Hook Form:

  • A lightweight alternative to Formik that uses React hooks to handle form state.
  • It’s more performance-oriented due to less re-rendering.

Example with React Hook Form:

import { useForm } from 'react-hook-form';

function MyForm() {

const { register, handleSubmit } = useForm();
const onSubmit = (data) => console.log(data);
return (

<form onSubmit={handleSubmit(onSubmit)}>

<input {...register('name')} />

<input {...register('email')} />

<button type="submit">Submit</button>

</form>

);

}

Both libraries significantly reduce boilerplate and handle common issues like validation and

form state management.

Hooks Deep Dive

Permalink

React.js React.js Tutorial · React

Infinite loops in useEffect occur when the effect continually triggers itself because the

dependency array includes values that change as a result of the effect itself.

Common cause:

If a value inside useEffect is being updated, and it's in the dependency array, React will

keep rerunning the effect.

How to avoid:

  • Use an empty dependency array ([]) if the effect should run only once.
  • Be selective with dependencies to avoid unnecessary re-renders.

Example:

useEffect(() => {

// Perform API call or other side effects

fetchData();

}, []); // No dependencies, effect runs only once

If the dependency list has state values or props that change inside the effect, React will

rerun it every time those values change. Be mindful of that!

Permalink

React.js React.js Tutorial · React

Custom hooks are a powerful way to share logic between components in a reusable and

encapsulated way. A custom hook is simply a JavaScript function that uses React hooks

(like useState, useEffect, etc.).

Example of a custom hook:

// useLocalStorage.js

import { useState } from 'react';

function useLocalStorage(key, initialValue) {

const [storedValue, setStoredValue] = useState(() => {

const item = localStorage.getItem(key);
return item ? JSON.parse(item) : initialValue;

});

const setValue = (value) => {

setStoredValue(value);

localStorage.setItem(key, JSON.stringify(value));

};

return [storedValue, setValue];
}

export default useLocalStorage;

You can then use this custom hook in any component:

import useLocalStorage from './useLocalStorage';

function App() {

const [name, setName] = useLocalStorage('name', 'John');
return (

<div>

<input

value={name}

onChange={(e) => setName(e.target.value)}

placeholder="Enter your name"

/>

</div>

);

}

Custom hooks allow for reusable logic (like managing form state, fetching data, etc.) and

encapsulation of behavior in a way that doesn't require repeated code.

Permalink

React.js React.js Tutorial · React

In class components, the lifecycle is managed using methods like componentDidMount,

componentDidUpdate, and componentWillUnmount. With hooks, these are replaced

with useEffect, which can mimic any lifecycle behavior.

Lifecycle Mapping:

  • componentDidMount: Use useEffect with an empty dependency array ([]).
  • componentDidUpdate: Use useEffect with dependencies.
  • componentWillUnmount: Return a cleanup function inside useEffect.

Example:

useEffect(() => {

// Equivalent to componentDidMount and componentDidUpdate

console.log("Component mounted or updated");

return () => {

// Equivalent to componentWillUnmount

console.log("Cleanup before component unmount");

};

}, [dependencies]); // Will run on mount and update based on

dependencies

Permalink

React.js React.js Tutorial · React

React keys help React identify which items in a list are changed, added, or removed. Keys

provide a stable identity for each element, allowing React to optimize re-renders.

  • Important: Keys should be unique for each sibling component.
  • Why important: Without keys, React has to re-render all list items when the list

changes, which can be inefficient.

Example:

const items = ['apple', 'banana', 'cherry'];
return (

<ul>

{items.map((item, index) => (

<li key={index}>{item}</li>

))}

</ul>

);

  • Tip: It’s better to use a unique identifier (e.g., id) as a key instead of using index if

the list can change order or content dynamically.

Permalink

React.js React.js Tutorial · React

Handling errors in React is done using Error Boundaries. They are React components

that catch JavaScript errors anywhere in their child component tree and log those errors or

display a fallback UI.

Example of Error Boundary:

class ErrorBoundary extends React.Component {

constructor(props) {

super(props);

this.state = { hasError: false };
}

static getDerivedStateFromError(error) {

return { hasError: true }; // Update state to trigger fallback

UI

}

componentDidCatch(error, info) {

console.error(error, info);

}

render() {

if (this.state.hasError) {
return <h1>Something went wrong!</h1>;
}
return this.props.children;
}
}

You wrap your components inside ErrorBoundary to catch and handle errors gracefully.

Permalink

React.js React.js Tutorial · React

To optimize React apps for SEO (Search Engine Optimization):

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

Reconciliation is the process React uses to update the UI efficiently when state or props

change. React compares the old virtual DOM with the new virtual DOM and calculates the

minimal set of changes required to update the real DOM. This makes React apps fast and

efficient.

Why important:

  • It helps React determine the minimal updates needed, avoiding unnecessary

re-renders.

  • React uses a diffing algorithm to compare previous and current states to optimize

DOM updates.

Permalink

React.js React.js Tutorial · React

Answer: new virtual DOM, compares it to the previous version, and calculates the most efficient way to update the actual DOM. Steps:

What interviewers expect

  • A clear definition tied to React in React.js projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production React.js application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in React.js architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink

React.js React.js Tutorial · React

ngular:

  • Framework: Full-fledged framework for building web apps.
  • Uses TypeScript by default and has built-in solutions for routing, HTTP requests,
form handling, and more.
  • Two-way data binding: Automatically synchronizes model and view.

Vue:

  • Framework: Similar to React, but provides two-way binding and template syntax.
  • Easier to integrate into existing projects.
  • Flexibility: Offers the reactivity model and simplicity in syntax.
Permalink

React.js React.js Tutorial · React

JSX transpilation refers to the process of converting JSX syntax (JavaScript XML) into

regular JavaScript. Since browsers don't understand JSX directly, tools like Babel transpile

JSX into valid JavaScript that browsers can execute.

Example:

const element = <h1>Hello, world!</h1>;

Babel transpiles the JSX into:

const element = React.createElement('h1', null, 'Hello, world!');
Permalink

React.js React.js Tutorial · React

You can use libraries like react-dnd or react-beautiful-dnd for drag-and-drop functionality.

Example with react-beautiful-dnd:

npm install react-beautiful-dnd

import { DragDropContext, Droppable, Draggable } from

'react-beautiful-dnd';

function App() {

const items = ['item1', 'item2', 'item3'];
return (

<DragDropContext onDragEnd={() => {}}>

<Droppable droppableId="droppable">

{(provided) => (

<ul ref={provided.innerRef} {...provided.droppableProps}>

{items.map((item, index) => (

<Draggable key={item} draggableId={item}

index={index}>

{(provided) => (

<li

ref={provided.innerRef}

{...provided.draggableProps}

{...provided.dragHandleProps}

{item}

</li>

)}

</Draggable>

))}

{provided.placeholder}

</ul>

)}

</Droppable>

</DragDropContext>

);

}
Permalink

React.js React.js Tutorial · React

Concurrent Mode is an experimental feature in React that enables the rendering process to

be interruptible. It allows React to work on multiple tasks at once, making apps feel more

responsive by prioritizing higher-priority updates (like animations or user input) over

lower-priority ones.

Permalink

React.js React.js Tutorial · React

React.lazy enables you to dynamically import components only when they are needed,

enabling code splitting and lazy loading.

const LazyComponent = React.lazy(() => import('./LazyComponent'));

function App() {

return (

<React.Suspense fallback={<div>Loading...</div>}>

<LazyComponent />

</React.Suspense>

);

}

Suspense is a wrapper around lazy-loaded components that shows a loading fallback

while the component is being loaded.

Permalink
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