⚛️ Top 150 React Interview Questions – 139/150 📌 Topic: 💉 Dependency Injection ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHAT is it? Dependency Injection (DI) is a design pattern where a component receives its dependencies (services, utilities, data sources) from the outside instead of creating them internally. Instead of this ❌ Component creates its own API client We do this ✅ Component receives the API client from its parent Component focuses on what to do, not how tools are built. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHY use Dependency Injection? 🔗 Decoupling Component is not tightly bound to a specific implementation. 🧪 Testability You can inject mock services instead of real APIs during testing. ♻️ Reusability Same component can work with different services. 🔄 Flexibility Swap behavior without rewriting the component. Cleaner architecture. Less chaos. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 HOW to implement in React? In React, DI is done using: • Props (simple injection) • Context API (global injection) ✅ 1. Service (Dependency) const api = { fetch: () => ["Apple", "Orange"] }; ✅ 2. Component (Dependency Injected via Props) const List = ({ service }) => ( <ul> {service.fetch().map(item => ( <li key={item}>{item}</li> ))} </ul> ); ✅ 3. Injector (Parent Provides Dependency) const App = () => <List service={api} />; Component doesn’t know where data came from. It only knows how to render it. That’s DI. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHERE to use it? 🌐 API Clients Inject Axios, Fetch wrappers, or GraphQL clients. 🔐 Authentication / Theme Inject user or theme using Context API. 🧪 Testing Replace real payment gateways with mock services. 🏢 Enterprise Apps Swap implementations without touching UI components. ━━━━━━━━━━━━━━━━━━━━━━ 📝 SUMMARY Dependency Injection is like a Chef and their Tools 👨🍳 The Chef (Component) doesn’t build their own stove (Dependency). The Restaurant Owner (Parent) provides the tools. The Chef only focuses on cooking (UI logic). ━━━━━━━━━━━━━━━━━━━━━━ 👇 Comment “React” if this series is helping you 🔁 Share with someone improving frontend architecture #ReactJS #DependencyInjection #FrontendArchitecture #CleanCode #ScalableApps #Top150ReactQuestions #LearningInPublic #Developers ━━━━━━━━━━━━━━━━━━━━━━
React Dependency Injection: Decoupling, Testability, and Reusability
More Relevant Posts
-
⚛️ Top 150 React Interview Questions – 147/150 📌 Topic: 🛑 Stale Closures in React ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHAT is it? A Stale Closure happens when a function captures a variable from an old render and keeps using that outdated value. In React: Every render creates a new scope. If a function is created once and never updated, it keeps referencing the old state. Closure = Snapshot of variables at creation time. If not refreshed → it becomes stale. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHY does it happen? 🧠 Environment Locking JavaScript closures freeze the scope they were created in. ⚠️ Logic Errors Timers or handlers read outdated values → UI feels broken. 📦 Hook Dependency Rules This is exactly why dependency arrays exist in useEffect and useCallback. Ignoring dependencies = stale data risk. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 HOW does it occur? Classic mistake: const [count, setCount] = useState(0); useEffect(() => { const id = setInterval(() => { // ❌ STALE: 'count' is always 0 console.log(count); }, 1000); return () => clearInterval(id); }, []); // Empty dependency array Here: • Effect runs only once • Closure captures count = 0 • Interval never sees updated state ✅ Fix 1: Add Dependency useEffect(() => { const id = setInterval(() => { console.log(count); }, 1000); return () => clearInterval(id); }, [count]); ✅ Fix 2: Use Functional Update setCount(c => c + 1); Functional updates always use the latest value. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHERE does this bug appear? ⏱ Intervals & Timeouts setInterval reading outdated state. 🌍 Manual Event Listeners window.addEventListener referencing old values. 🧩 useCallback / useMemo Memoized functions missing dependencies. Any long-lived function = risk of stale closure. ━━━━━━━━━━━━━━━━━━━━━━ 📝 SUMMARY A Stale Closure is like Navigating with an Old Map 🗺️ You’re using a map from 1990 (old render) to find a building built in 2026 (current state). The map is stuck in time. So you reach the wrong destination. Always update your map (Dependencies). ━━━━━━━━━━━━━━━━━━━━━━ 👇 Comment “React” if this series is helping you 🔁 Share with someone mastering React hooks #ReactJS #StaleClosures #useEffect #JavaScriptClosures #FrontendDebugging #Top150ReactQuestions #LearningInPublic #Developers ━━━━━━━━━━━━━━━━━━━━━━
To view or add a comment, sign in
-
-
🚀 React Interview Questions Asked in recent interview (For Mid–Senior Frontend Developers) During interviews, many React questions are not about definitions but about understanding how React behaves internally. Here are some commonly asked questions along with clear explanations. 1️⃣ Multiple components are rendering and the app becomes slow — why? When multiple components re-render frequently, performance can degrade. This usually happens because React re-renders a component whenever its state or props change. Common causes: Parent component re-renders, causing all child components to re-render. Passing new object/array references in props. Inline functions created on every render. Expensive computations inside render. Example problem: <Child data={{ name: "John" }} /> Even if the value is the same, a new object reference is created on every render, so React treats it as a change. Solutions: Use React.memo for child components. Avoid inline objects/functions. Memoize values with useMemo. Memoize callbacks with useCallback. 2️⃣ Dependency array exists in useEffect, but I still want to avoid unnecessary re-renders Important concept: useEffect does not control rendering. Rendering happens because of state or prop changes, not because of useEffect. Example: useEffect(() => { fetchData(); }, [userId]); This only controls when the effect runs, not when the component renders. Ways to reduce unnecessary renders: Avoid unnecessary state updates Use React.memo Use useMemo / useCallback Lift state only when needed 3️⃣ What is Hydration in React? Hydration is mainly used in server-side rendering frameworks like Next.js. Steps: Server renders HTML. Browser receives fully rendered HTML. React attaches event listeners and makes it interactive. Example flow: Server: HTML sent to browser Client: React attaches JS behavior to existing HTML This process is called hydration. If the server HTML and client render output differ, React throws a hydration mismatch warning. Common causes: Random values Date/time differences Browser-only APIs 4️⃣ React Strict Mode in Development vs Production React.StrictMode is a development tool. Development behavior: Components render twice intentionally Helps detect side effects Warns about unsafe lifecycle methods Important point: Strict Mode does NOT affect production. Double rendering happens only in development. Purpose: Detect bugs early Ensure components are resilient 5️⃣ Same hook behaves differently in two sibling components — why? Hooks are isolated per component instance. Example: <ComponentA /> <ComponentB /> Even if both use the same hook: const [count, setCount] = useState(0); Each component maintains its own independent state. Possible reasons behavior differs: Different props Different lifecycle timing Conditional rendering Parent re-rendering one child more often #ReactJS #FrontendDevelopment #JavaScript #ReactInterview #WebDevelopment #NextJS #SoftwareEngineering #FrontendEngineer #ReactHooks #CodingInterview
To view or add a comment, sign in
-
React.js Interview Prep Checklist – What You Should Actually Revise 🚀 If you're preparing for a Frontend React.js interview, don’t just revise hooks randomly. Structure your preparation across layers: fundamentals → rendering → performance → architecture. Here’s a practical checklist to guide you 👇 🔹 React Core Concepts • What is React and why do we use it? • What is the Virtual DOM and how does it differ from the Real DOM? • How does reconciliation (diffing) work internally? • Why are keys important in lists? • What happens if you use array index as a key? • Props vs State — what’s the real difference? • Functional vs Class components — trade-offs? If you can’t explain rendering clearly, you’re not interview-ready. 🔹 Lifecycle & Rendering Behavior • Mounting, Updating, Unmounting — what actually happens? • Lifecycle equivalents using hooks • When should you use useEffect? • How does cleanup in useEffect prevent memory leaks? Most bugs in React apps come from misunderstanding effects. 🔹 React Hooks Deep Dive • useState — batching & async updates • useEffect dependency array logic • useContext — when to use and when to avoid • useRef — persistence without re-render • useReducer — complex state management • useMemo vs useCallback — real performance use cases • useLayoutEffect — when timing matters • Custom hooks — extracting reusable logic Hooks are easy to use, hard to master. 🔹 Performance & Optimization • What causes unnecessary re-renders? • How does React.memo work? • Code splitting & lazy loading • Suspense basics • Bundle size reduction strategies • Tree shaking Senior interviews heavily focus on performance thinking. 🔹 State Management • Context API fundamentals • Context vs Redux — real-world trade-offs • When Redux makes sense • Reducers, actions, store structure Architectural clarity > tool knowledge. 🔹 Advanced Topics • Error Boundaries • Higher Order Components (HOCs) • Event bubbling & delegation • Controlled vs Uncontrolled components • Debouncing vs Throttling • Virtualization for large datasets • API caching strategies • Web Workers — when to move work off the main thread These topics differentiate mid-level from senior engineers. 🎯 Final Advice Don’t just memorize definitions. Understand: • Why React re-renders • How scheduling works • How data flows • How performance degrades • How to debug production issues That’s what interviewers truly evaluate. Learn deeply. Build intentionally. Explain clearly. 👉 Follow Rahul R Jain for more real interview insights, React fundamentals, and practical frontend engineering content. #ReactJS #FrontendEngineering #JavaScript #WebDevelopment #TechInterviews #PerformanceOptimization #SoftwareEngineering #ReactDeveloper
To view or add a comment, sign in
-
🚨 React Native Interview Prep: Stop Memorizing, Start Architecting. I’ve sat on both sides of the interview table. The difference between a Junior and a Senior isn't knowing the syntax—it's understanding the "Why." If you can’t explain how the Bridge works or why a UI freezes during a heavy JS calculation, you aren't ready for that Senior role. Here is the ultimate 2026 React Native Interview Checklist. Save this for your next technical round. 👇 📱 1. The Architecture (The "Under the Hood" Stuff) * What is the Bridge, and how does it differ from the New Architecture (JSI, Fabric)? * Explain the Threading Model: Main Thread vs. JS Thread vs. Shadow Thread. * How does Hermes actually improve startup time? ⚡ 2. Performance & Optimization (The Senior Filter) * FlatList vs. ScrollView: Why does the former win for large datasets? * When does useCallback actually hurt performance instead of helping? * What causes UI Lag, and how do you profile it using Flipper or DevTools? 🧭 3. Navigation & State * How do you structure a secure Auth Flow (Login -> Home)? * Context vs. Zustand vs. Redux: When is Redux "overkill"? * How do you reset the navigation stack on logout to prevent "back-button" bugs? 🛠️ 4. Native & Ecosystem * Expo vs. CLI: Which one do you pick for a high-compliance banking app? Why? * How do you handle Platform-specific code without creating a maintenance nightmare? * What is Deep Linking, and how does the OS handle the intent? 🔥 The "Curveball" Questions * Explain the Event Loop in the context of React Native. * How do you structure a large-scale app to ensure 10+ developers can work on it simultaneously? * Why does a heavy JSON parse freeze the UI, and how do you fix it? 🎯 Pro-Tip from the Field Interviews aren't a quiz; they are a consultation. Don't just give the answer—justify the trade-off. > "I chose Zustand over Redux because the boilerplate was slowing down our feature velocity, and we didn't need complex middleware." > That sentence alone proves more seniority than a 5-minute explanation of Redux Thunk. Which topic should I deep-dive into next? 1️⃣ Detailed Interview Answers 2️⃣ Senior-Level System Design for Mobile 3️⃣ Coding Round Live-Challenge Prep Don’t just memorize the syntax. In a high-stakes interview, they aren't testing your ability to Google—they are testing your clarity of thinking. #ReactNative #MobileDev #SoftwareEngineering #TechInterviews #CareerGrowth #Programming #AppDevelopment #60/ReactNative
To view or add a comment, sign in
-
⚛️ Top 150 React Interview Questions – 146/150 📌 Topic: 🧹 Cleanup Function Importance ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHAT is it? The Cleanup Function is the function returned inside useEffect. It runs: • Right before a component unmounts • Before the effect re-runs (when dependencies change) Its job is to undo side effects created by the effect. Think of it as a reset mechanism. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHY is it critical? 🧠 Prevents Memory Leaks Stops timers, subscriptions, or listeners from running after unmount. ⚠️ Avoids Illegal State Updates Prevents “Cannot update state on an unmounted component” errors. 🔒 System Integrity Releases global resources like WebSockets and browser listeners. Without cleanup → background chaos. With cleanup → controlled environment. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 HOW does it work? React automatically executes the returned function. ✅ WebSocket Cleanup useEffect(() => { const socket = connect(id); // CLEANUP return () => socket.disconnect(); }, [id]); When id changes or component unmounts → connection closes. ✅ Abort API Request useEffect(() => { const controller = new AbortController(); fetch(url, { signal: controller.signal }); return () => controller.abort(); // Cancel request }, [url]); Prevents updating state after navigation. ━━━━━━━━━━━━━━━━━━━━━━ 🔹 WHERE is cleanup mandatory? 🔌 Subscriptions WebSocket, Firebase, Chat APIs. 🌍 Browser APIs window.addEventListener (scroll, resize). ⏱ Timers clearTimeout / clearInterval. 📡 Async Requests AbortController for pending fetch calls. Any persistent side effect → requires cleanup. ━━━━━━━━━━━━━━━━━━━━━━ 📝 SUMMARY The Cleanup Function is like Checking Out of a Hotel Room 🏨 Before leaving (Unmount), you must turn off lights and close taps. If you don’t, the hotel (Browser) keeps wasting resources. Cleanup ensures nothing is left running after you leave. ━━━━━━━━━━━━━━━━━━━━━━ 👇 Comment “React” if this series is helping you 🔁 Share with someone mastering useEffect #ReactJS #useEffect #MemoryLeaks #FrontendBestPractices #WebPerformance #Top150ReactQuestions #LearningInPublic #Developers ━━━━━━━━━━━━━━━━━━━━━━
To view or add a comment, sign in
-
-
🚀 15 Node.js Interview Questions Every Developer Should Know If you're preparing for Node.js interviews or building backend systems, these questions are commonly asked 👇 1️⃣ What is Node.js? Node.js is a JavaScript runtime built on the V8 engine that allows developers to run JavaScript on the server side. 2️⃣ What is the Event Loop in Node.js? The Event Loop handles asynchronous operations and allows Node.js to manage multiple requests without blocking the main thread. 3️⃣ What is the difference between "setTimeout()" and "setImmediate()"? • "setTimeout()" executes after a specified delay. • "setImmediate()" executes in the next event loop cycle. 4️⃣ What are Streams in Node.js? Streams process data piece by piece instead of loading the entire data in memory. 5️⃣ What is Middleware in Express.js? Middleware functions run between request and response and can modify data, handle authentication, or log requests. 6️⃣ What is the difference between "process.nextTick()" and "setImmediate()"? "process.nextTick()" runs before the event loop continues, while "setImmediate()" runs in the next iteration. 7️⃣ What is the "cluster" module? It allows Node.js applications to use multiple CPU cores by creating worker processes. 8️⃣ What is "package.json"? It contains project metadata, dependencies, scripts, and configuration. 9️⃣ What is "package-lock.json"? It locks dependency versions to ensure consistent installations across environments. 🔟 What is the difference between "require()" and "import"? • "require()" → CommonJS modules • "import" → ES Modules syntax 1️⃣1️⃣ What is error-first callback in Node.js? A callback pattern where the first argument is an error object. Example: fs.readFile("file.txt", (err, data) => { if (err) throw err; console.log(data); }); 1️⃣2️⃣ What are Buffers in Node.js? Buffers are used to handle binary data such as images, videos, and file streams. 1️⃣3️⃣ What is the difference between synchronous and asynchronous functions? • Synchronous → executes line by line and blocks execution. • Asynchronous → runs in the background without blocking the main thread. 1️⃣4️⃣ What is REST API in Node.js? A REST API allows communication between client and server using HTTP methods like GET, POST, PUT, DELETE. 1️⃣5️⃣ What is CORS? CORS (Cross-Origin Resource Sharing) allows servers to specify which domains can access their APIs. 💡 Pro Tip: If you understand Event Loop + Async patterns + Streams + Scaling, you’re already thinking like a senior Node.js developer. 🔥 Save this post for your next backend interview. #NodeJS #BackendDevelopment #JavaScript #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
Real React + TypeScript Interview Scenarios (That Actually Get Asked) Most React + TypeScript interviews don’t test syntax. They test how you think. From typing API responses to fixing real production bugs these are the exact scenarios interviewers use to judge if you can build scalable, safe applications. 1️⃣ Fix Type Errors in a Real Component Scenario: You’re given a component throwing TypeScript errors. They test: Props typing Optional vs required props Union vs interface React.FC vs explicit typing Typical question: > Why is this prop possibly undefined? How would you fix it without using any? They expect: Optional chaining Default values Proper narrowing 2️⃣ Build a Generic Reusable Component Scenario: Create a reusable Dropdown or Table. They test: Generics <T> Typed callbacks Preventing runtime bugs at compile time Follow-up trap: > How do you restrict T to objects with an id? Correct thinking: <T extends { id: string }> 3️⃣ useState with Complex Types const [user, setUser] = useState(null); Works in JS. Problematic in TS. Why? Because TypeScript infers null only. Correct approach: const [user, setUser] = useState<User | null>(null); They’re checking if you understand union types and inference. 4️⃣ API Response Typing (Very Common) Scenario: API may return success or error. They expect discriminated unions: type ApiResponse = | { status: "success"; data: User } | { status: "error"; message: string }; They’ll ask: > How does this prevent runtime crashes? Answer: Safe narrowing based on status. 5️⃣ Event Typing in Forms They expect: const handleChange = ( e: React.ChangeEvent<HTMLInputElement> ) => {} Follow-up: > Difference between SyntheticEvent and native event? If you can answer this clearly you stand out. 6️⃣ useRef Proper Typing Accessing DOM element? const inputRef = useRef<HTMLInputElement | null>(null); They’re checking: Null safety Strict mode awareness 7️⃣ Preventing Re-renders with memo Scenario: Performance issue in large list. They test: React.memo useCallback with typed functions Dependency typing Follow-up: > When can memo make performance worse? If you mention unnecessary comparisons and memory overhead bonus points. 8️⃣ Context API + Type Safety Bad: const ThemeContext = createContext(null); Expected fix: Proper context type Custom hook Runtime guard if (!context) { throw new Error("Must be used within provider"); } 9️⃣ Type vs Interface (They WILL Ask) Question: > When would you prefer type over interface? They expect you to mention: Unions & intersections Utility types Declaration merging 🔟 Real Production Bug Scenario Scenario: Component works locally but crashes in production. #ReactJS #TypeScript #Frontend #ReactDeveloper #WebDevelopment #MERN
To view or add a comment, sign in
-
-
🚀 Preparing for React Interviews in 2026? Read This. React is no longer just a library — it’s an ecosystem. If you’re applying for Frontend or Full-Stack roles, you must go beyond basic components. Here are some important React interview questions you should be ready for 👇 🔹 1. What is React and why is it called a library, not a framework? 👉 Understand how React focuses only on the UI layer. 👉 Compare it with full frameworks like Angular. 👉 Explain the Virtual DOM concept clearly. 🔹 2. What is the Virtual DOM and how does it improve performance? ✔️ Real DOM vs Virtual DOM ✔️ Reconciliation process ✔️ Diffing algorithm Pro Tip: Be ready to explain this with a small diagram. 🔹 3. What are Hooks in React? Explain: useState useEffect useMemo useCallback useRef Also answer: 👉 Why were hooks introduced after React 16.8? 👉 What problems do they solve compared to class components? 🔹 4. What is the difference between State and Props? Interviewers love this one. Make sure you explain: Mutability Data flow (Unidirectional) Re-rendering behavior 🔹 5. What is React Fiber? Most candidates skip this. Know that: It was introduced in React 16. It improves rendering performance. It enables features like Concurrent Rendering. 🔹 6. What is Redux and when should you use it? Understand: Global state management Actions, Reducers, Store Middleware Also compare Redux with Context API. 🔹 7. What is Server-Side Rendering (SSR)? Be ready to talk about: SEO benefits Performance improvements Frameworks like Next.js 🔹 8. Explain Controlled vs Uncontrolled Components Commonly asked in mid-level interviews. 🔹 9. What are keys in React and why are they important? Important for list rendering & reconciliation. 🔹 10. How do you optimize React performance? Mention: React.memo Code splitting Lazy loading Memoization Avoiding unnecessary re-renders 🔥 Bonus Tip for 2026 Developers Don’t just memorize answers. Build projects. ✔️ Authentication system ✔️ Dashboard with charts ✔️ CRUD app with API ✔️ Deployment on Vercel / Netlify Because interviews now focus on problem-solving + architecture thinking, not just definitions. Also, I and Ribhu Mukherjee have authored in depth 0 to DREAM placement book, from our experience with expert video resources. Check it out here: https://lnkd.in/gJtXjkBP #ReactJS #FrontendDeveloper #WebDevelopment #JavaScript #TechCareers #CodingInterview #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Angular Interview Questions with Detailed Answers (Mid–Senior Frontend Developers) Angular interviews often focus on change detection, performance optimization, and architecture decisions rather than just definitions. Here are some practical interview questions with clear explanations. 1️⃣ Why does an Angular component re-render multiple times and become slow? Angular updates the UI through its change detection mechanism. Every time an event occurs (click, HTTP response, timer, input change), Angular runs change detection to check if values have changed. If your component becomes slow, common reasons are: Large component trees Heavy logic inside templates Frequent change detection cycles Using default change detection instead of optimized strategies Example problem: <li *ngFor="let item of items"> {{ calculateHeavyValue(item) }} </li> Here, calculateHeavyValue() runs every change detection cycle, which can slow down the app. Solutions: Use pure pipes Move heavy logic outside templates Use trackBy in ngFor Use ChangeDetectionStrategy.OnPush 2️⃣ How do you avoid unnecessary change detection in Angular? Angular provides OnPush change detection strategy. Example: @Component({ selector: 'app-user', templateUrl: './user.component.html', changeDetection: ChangeDetectionStrategy.OnPush }) With OnPush, Angular only checks the component when: Input reference changes Event occurs inside the component Observable emits new value Manual trigger using markForCheck() This significantly improves performance in large applications. 3️⃣ What is the difference between constructor and ngOnInit? This is a very common Angular interview question. Constructor Used for dependency injection Called when the class instance is created Should not contain business logic Example: constructor(private userService: UserService) {} ngOnInit Lifecycle hook Runs after Angular initializes component inputs Used for component initialization Example: ngOnInit() { this.loadUser(); } Rule: Use constructor for injection and ngOnInit for logic. 4️⃣ Why use trackBy in ngFor? Without trackBy, Angular recreates DOM elements whenever the list changes. Example without trackBy: <li *ngFor="let user of users"> {{user.name}} </li> If one item changes, Angular rebuilds the entire list DOM. Using trackBy: <li *ngFor="let user of users; trackBy: trackById"> {{user.name}} </li> trackById(index: number, user: any) { return user.id; } Now Angular only updates the changed items, improving performance. 5️⃣ Why does Angular subscribe multiple times to the same observable? This happens when using cold observables. Example: this.http.get('/api/users') Each subscription triggers a new HTTP request. Solution: Use shareReplay() to share the response. this.users$ = this.http.get('/api/users').pipe( shareReplay(1) ); #Angular #AngularInterview #FrontendDevelopment #TypeScript #WebDevelopment #SoftwareEngineering #RxJS #FrontendEngineer #CodingInterview #AngularDevelopers
To view or add a comment, sign in
-
Commonly asked React.js Low-Level Design (LLD) interview questions that come up in frontend interviews: 𝟭. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗶𝗻𝗳𝗶𝗻𝗶𝘁𝗲 𝘀𝗰𝗿𝗼𝗹𝗹𝗶𝗻𝗴 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁? - Think about how you would detect when the user reaches near the bottom of the page and trigger additional data loading. Also consider techniques like throttling or debouncing to avoid excessive API calls. 𝟮. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗯𝘂𝗶𝗹𝗱 𝗮 𝘀𝗲𝗮𝗿𝗰𝗵 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝗮𝗹𝗶𝘁𝘆 𝘄𝗶𝘁𝗵 𝗹𝗶𝘃𝗲 𝗳𝗶𝗹𝘁𝗲𝗿𝗶𝗻𝗴 𝗶𝗻 𝗮 𝗥𝗲𝗮𝗰𝘁 𝗮𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻? - Discuss how you would optimise filtering for large datasets, debounce user input, and manage filtered results when interacting with an API. 𝟯. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗱𝗲𝘀𝗶𝗴𝗻 𝗮 𝗳𝗼𝗿𝗺 𝘄𝗶𝘁𝗵 𝗱𝘆𝗻𝗮𝗺𝗶𝗰 𝗳𝗶𝗲𝗹𝗱𝘀 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁? - Consider how you would structure state for adding and removing fields, handle validation and errors, and decide between controlled vs uncontrolled components. 𝟰. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗺𝗮𝗻𝗮𝗴𝗲 𝘀𝘁𝗮𝘁𝗲 𝗳𝗼𝗿 𝗮 𝗺𝘂𝗹𝘁𝗶-𝘀𝘁𝗲𝗽 𝗳𝗼𝗿𝗺 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁? - Think about how data from each step is stored, how it can be accessed across steps, and how navigation and validation should be handled. 𝟱. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗮 𝗰𝘂𝘀𝘁𝗼𝗺 𝘂𝘀𝗲𝗙𝗲𝘁𝗰𝗵 𝗵𝗼𝗼𝗸 𝗳𝗼𝗿 𝗵𝗮𝗻𝗱𝗹𝗶𝗻𝗴 𝗛𝗧𝗧𝗣 𝗿𝗲𝗾𝘂𝗲𝘀𝘁𝘀? - A good design should manage loading, success, and error states while remaining reusable across multiple components. 𝟲. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗹𝗮𝘇𝘆 𝗹𝗼𝗮𝗱𝗶𝗻𝗴 𝗼𝗳 𝗰𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁𝘀 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁? - Explain how tools like React.lazy and Suspense can help load components only when they are needed, especially in route-based applications. 𝟳. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗮 𝗱𝗿𝗮𝗴𝗴𝗮𝗯𝗹𝗲 𝗹𝗶𝘀𝘁 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁? - This involves managing drag state, updating item order, and ensuring the implementation remains performant. 𝟴. 𝗛𝗼𝘄 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝗱𝗲𝘀𝗶𝗴𝗻 𝗮𝘂𝘁𝗵𝗲𝗻𝘁𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗮𝗻𝗱 𝗮𝘂𝘁𝗵𝗼𝗿𝗶𝘇𝗮𝘁𝗶𝗼𝗻 𝗶𝗻 𝗮 𝗥𝗲𝗮𝗰𝘁 𝗮𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻? - Consider protected routes, redirecting unauthenticated users, token-based authentication (such as JWT), and handling token expiration. These questions are great for evaluating a candidate’s understanding of state management, performance optimization, component design, and real-world frontend architecture. Which other React LLD questions do you think interviewers should ask? Share in the comments! Like. Repost. Save for later. -- Advanced frontend interview preparation resources: https://lnkd.in/dTPdEYwz
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development