Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short 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: Real-world example (S…
Short answer: 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 typ…
Short answer: 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 as…
Short answer: React Testing Library (RTL) and Enzyme are two popular testing utilities for React. Explain a bit more Feature React Testing Library Enzyme Philosophy Tests behavior from the user's perspective Tests compon…
Short answer: 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…
Short answer: 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 snap…
Short answer: The render props pattern is a technique for sharing code between components using a prop whose value is a function (a “render prop”). This function can return JSX or other values, allowing more dynamic beha…
Short answer: llowing more dynamic behavior and custom rendering. Explain a bit more Purpose: It enables a component to expose its logic while letting its consumers define how the output is rendered. Real-world example (…
Short answer: Reconciliation is the process by which React updates the DOM efficiently when a component's state or props change. Explain a bit more React uses a virtual DOM to compare the new virtual DOM tree with the pr…
Short answer: React Fiber is a complete rewrite of React's reconciliation algorithm. Explain a bit more It is designed to improve the rendering performance and make React more responsive and capable of handling asynchron…
Short answer: 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 Nex…
Short answer: Hydration refers to the process where React takes over the static HTML rendered by the server and attaches event listeners and restores interactivity. Explain a bit more This happens once the JavaScript bun…
Short answer: Next.js is a React framework that enables server-side rendering (SSR), static site generation (SSG), API routes, and more out-of-the-box. Explain a bit more It simplifies React app development by providing…
Short answer: And 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…
Short answer: Create React App (CRA) is a boilerplate tool to set up a modern React app without configuring build tools like Webpack, Babel, etc. Explain a bit more It’s designed to help you focus on writing code instead…
Short answer: PropTypes is a runtime type-checking library used to validate the types of props passed to React components. It helps catch errors during development by ensuring that props match the expected data types. Ex…
Short 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 warni…
Short answer: React Native is a framework for building native mobile applications (iOS and Android) using React and JavaScript. Explain a bit more While React is for web development, React Native allows you to create mob…
Short answer: Reconciliation is the process React uses to update the UI efficiently when state or props change. Explain a bit more React compares the old virtual DOM with the new virtual DOM and calculates the minimal se…
Short answer: React: Library for building UI, focusing on components and rendering. Explain a bit more Declarative and flexible: Use JavaScript to write components. React has a rich ecosystem, but you often need addition…
Short answer: 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. Real-world example (ShopNest) Shop…
Short answer: 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…
Short answer: 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 prioritizin…
React.js React.js Tutorial · React
Short 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:
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
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.
React.js React.js Tutorial · React
Short answer: 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
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: React Testing Library (RTL) and Enzyme are two popular testing utilities for React.
Feature React Testing Library Enzyme Philosophy Tests behavior from the user's perspective Tests component internals and implementation Test Focus Interaction, rendering, and accessibility 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).
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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).
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: The render props pattern is a technique for sharing code between components using a prop whose value is a function (a “render prop”). This function can return JSX or other values, allowing 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.
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.
ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.
React.js React.js Tutorial · React
Short answer: 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.
ProductCard receives price via props. The parent Catalog owns selected filters in state and passes them down.
React.js React.js Tutorial · React
Short answer: 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:
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
React.js React.js Tutorial · React
Short answer: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: Next.js is a React framework that enables server-side rendering (SSR), static site generation (SSG), API routes, and more out-of-the-box.
It simplifies React app development by providing a set of conventions and features that improve performance, SEO, and 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: And 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: PropTypes is a runtime type-checking library used to validate the types of props passed to React components. It helps catch errors during development by ensuring that props match the expected data types.
import PropTypes from 'prop-types'; function MyComponent({ name, age }) { return <div>{name} is {age} years old</div>; } MyComponent.propTypes = { name: PropTypes.string.isRequired, age: PropTypes.number.isRequired, }; In this example, PropTypes.string.isRequired ensures that the name prop is a string and is required. If it’s not passed or is of the wrong type, React will display a warning in the console.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
React.js React.js Tutorial · React
Short answer: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: React: Library for building UI, focusing on components and rendering.
Declarative and flexible: Use JavaScript to write components. React has a rich ecosystem, but you often need additional libraries for routing, state management, etc. Angular: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
const element = <h1>Hello, world!</h1>; Babel transpiles the JSX into: const element = React.createElement('h1', null, 'Hello, world!');
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
React.js React.js Tutorial · React
Short answer: 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.
ShopNest’s storefront is React: components for ProductCard, CartDrawer, and CheckoutForm, with hooks for local UI state.
Install Toolliyo like an app Free
Home-screen access to tutorials, coding practice & career tools — no app store needed.
On iPhone/iPad: tap Share then Add to Home Screen.