Interview questions

EY 𝗼𝗳𝗳𝗲𝗿𝗲𝗱 𝗺𝘆 𝗳𝗿𝗶𝗲𝗻𝗱 𝗮 𝗽𝗮𝗰𝗸𝗮𝗴𝗲 𝗼𝗳 𝟮𝟴 𝗟𝗣𝗔.

Position: 𝗦𝗿 𝗦𝗼𝗳𝘁𝘄𝗮𝗿𝗲 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿
Experience: 𝟰+ 𝘆𝗲𝗮𝗿𝘀
Application Process: 𝗥𝗲𝗳𝗲𝗿𝗿𝗮𝗹

𝗥𝗼𝘂𝗻𝗱 𝟭 - 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 𝟭 (𝗥𝗲𝗮𝗰𝘁 | 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 | 𝗗𝗦𝗔)

1️⃣ Explain React rendering lifecycle and how React.memo, useMemo, and useCallback improve performance.
2️⃣ Difference between state and props in React. How does state management work in large-scale applications?
3️⃣ How would you optimize a slow React application with unnecessary re-renders?
4️⃣ Write a JavaScript function to remove duplicate objects from an array based on a specific key.
5️⃣ Explain closures, event loop, promises, async/await, and hoisting in JavaScript with real examples.
6️⃣ DSA question: Find the second largest element in an array with optimal time complexity.

𝗥𝗼𝘂𝗻𝗱 𝟮 - 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 𝟮 (𝗡𝗼𝗱𝗲.𝗷𝘀 | 𝗦𝘆𝘀𝘁𝗲𝗺 𝗗𝗲𝘀𝗶𝗴𝗻 | 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲)

1️⃣ How do you design scalable REST APIs in Node.js and Express.js?
2️⃣ Explain authentication and authorization using JWT and refresh tokens.
3️⃣ How would you handle caching and performance optimization in backend applications?
4️⃣ Difference between SQL and NoSQL databases. When would you choose MongoDB over MySQL?
5️⃣ Explain indexing and query optimization techniques you have used in production.
6️⃣ Design a scalable e-commerce or chat application architecture.

𝗥𝗼𝘂𝗻𝗱 𝟯 - 𝗠𝗮𝗻𝗮𝗴𝗲𝗿𝗶𝗮𝗹 / 𝗕𝗲𝗵𝗮𝘃𝗶𝗼𝗿𝗮𝗹

1️⃣ Tell me about a challenging production issue you resolved under tight deadlines.
2️⃣ How do you handle code reviews and mentor junior developers?
3️⃣ How do you manage conflicting priorities while ensuring timely delivery?
4️⃣ What’s your approach when requirements change during sprint execution?
----------------------------------------------------------------------------------------------------------------------
🚀 React JS Interview Coding Questions (For Mid–Senior Developers)

If you're preparing for React interviews (3–10+ years experience), these coding questions are MUST practice 👇

🔥 1. Debounced Search Input
Build a search bar that calls API only after user stops typing (use "useEffect + setTimeout" or custom hook).

🔥 2. Infinite Scroll
Load more data when user reaches bottom (Intersection Observer API).

🔥 3. Custom useFetch Hook
Create reusable hook with loading, error, and data handling.

🔥 4. Optimized Re-rendering
Prevent unnecessary re-renders using "React.memo", "useMemo", "useCallback".

🔥 5. Form Handling + Validation
Build form with controlled inputs + validation (email, password rules).

🔥 6. Implement Dark/Light Mode
Toggle theme using Context API or Redux.

🔥 7. Role-Based Routing
Admin/User protected routes using JWT + React Router.

🔥 8. Shopping Cart Logic
Add/remove/update quantity + total price calculation.

🔥 9. File Upload with Preview
Upload image and show preview before submit.

🔥 10. Build a Modal from Scratch
Reusable modal with open/close, backdrop, and ESC key support.
 -------------------------------------------------------------------------------------------------------------------------

Some of the questions they asked:

1. What is React and why is it efficient?
2. How does React work internally?
3. What is the most challenging task you handled in your project?
4. Is JavaScript tightly coupled or loosely coupled?
5. Why do we use TypeScript?
6. How does "extends" work in TypeScript and what is the difference between type and interface?
7. How does Redux work, from installation to usage in a project?
8. Have you used Redux Toolkit (RTK) or TanStack Query?
9. What is the difference between bind and apply in JavaScript?
10. What has been your experience with useCallback and useMemo in real projects?
11. What is the role of the dependency array in useEffect?

-----------------------------------------------------------------------------------------------------------------------

𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 🫪

Most interviews today are not checking whether you “know React.”

They are checking:
• How deeply you understand systems
• How you debug real-world problems
• How you optimize performance
• How you explain technical decisions clearly

And honestly, that changes the entire interview game.

• What is hoisting?
• What are closures?
• Explain React Fiber.
• What is code splitting?
• Explain lazy loading.
• What is tree shaking?
• Explain CORS in simple terms.
• What causes UI jank?
• What are stale closures in React?
• Explain optimistic UI updates.
• Difference between CSR and SSR?
• Explain prototypal inheritance.
• Difference between shallow copy and deep copy?
• What causes memory leaks in React apps?
• Explain repaint vs reflow vs compositing.
• How does React batching improve rendering?
• Explain debounce and throttle with examples.
• How does browser rendering work internally?
• How do you optimize bundle size in React?
• How do you avoid unnecessary re-renders?
• Explain controlled vs uncontrolled components.
• Difference between localStorage and sessionStorage?
• Explain authentication vs authorization.
• How do refresh tokens work internally?
• How do you securely store tokens in frontend apps?
• Explain race conditions in frontend applications.
• How do you cancel ongoing API requests in React?
• Explain hydration mismatch and why it happens.
• How does React reconciliation work internally?
• Explain browser caching strategies with examples.
• How do you debug frontend performance bottlenecks?
• How would you optimize a slow-loading React app?
• Explain the JavaScript event loop step by step.
• Difference between synchronous and asynchronous JavaScript?
• How do you handle API retries and failures gracefully?
• Explain JWT authentication end-to-end with refresh flow.
• How do service workers improve frontend applications?
• How would you design state management for large applications?
• Explain accessibility best practices in frontend development.
• Difference between SSR, CSR, SSG, ISR, and hydration?
• How do you implement infinite scrolling efficiently?
• What happens internally when a user types a URL in the browser?
• Explain frontend security vulnerabilities developers should know.
• How do you monitor frontend applications in production?
• How would you optimize an eCommerce product listing page?
• Tell me about a difficult production bug you solved recently.
• How would you architect a scalable frontend application?
--------------------------------------------------------------------------------------------------------------------

Some of the questions they asked:

1. What is React and why is it efficient?
2. How does React work internally?
3. What is the most challenging task you handled in your project?
4. Is JavaScript tightly coupled or loosely coupled?
5. Why do we use TypeScript?
6. How does "extends" work in TypeScript and what is the difference between type and interface?
7. How does Redux work, from installation to usage in a project?
8. Have you used Redux Toolkit (RTK) or TanStack Query?
9. What is the difference between bind and apply in JavaScript?
10. What has been your experience with useCallback and useMemo in real projects?
11. What is the role of the dependency array in useEffect?
------------------------------------------------------------------------------------------------------------------

𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 (𝗖𝗼𝗿𝗲 𝗗𝗲𝗽𝘁𝗵)
1. Explain the JavaScript event loop. Microtasks vs macrotasks?
2. Implement Promise.all from scratch.
3. Implement debounce and throttle.
4. Explain closures with a real-world example.
5. How does prototypal inheritance work?
6. Difference between var, let, and const.
7. Difference between == and ===.
8. Explain shallow copy vs deep copy. Implement deep clone.
9. How does this behave in arrow functions, class methods, and event handlers?
10. Explain call, apply, and bind with use cases.

𝗥𝗲𝗮𝗰𝘁 (𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗗𝗲𝗽𝘁𝗵)
11. What is reconciliation? How does React diffing work?
12. Why are keys important in lists?
13. What causes unnecessary re-renders in React?
14. Explain useEffect deeply. Cleanup? Dependency array pitfalls?
15. Difference between useMemo and useCallback.
16. When would you use React.memo?
17. Controlled vs uncontrolled components.
18. What is state batching? What changed in React 18?
19. How does React Context work? When can it hurt performance?
20. Build a custom hook like useDebounce or useFetch.

𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗦𝘆𝘀𝘁𝗲𝗺 𝗗𝗲𝘀𝗶𝗴𝗻 (𝗦𝗲𝗻𝗶𝗼𝗿 𝗥𝗼𝘂𝗻𝗱)
21. Design an autocomplete search with debouncing and caching.
22. Design an infinite scrolling feed.
23. How would you optimize a slow React application?
24. How would you improve Web Vitals (LCP, CLS, INP)?
25. Design a reusable component library for a large team.
26. How would you handle API failures and retries gracefully?
27. How would you implement dark mode across the app?
28. Redux vs Context vs Zustand, how do you decide in a large-scale application?
29. How would you prevent XSS, CSRF, token leakage, and secure authentication flows in a frontend app?
30. How would you design SSR/SSG or hydration strategy for a React application? When would you use each?

𝗗𝗦𝗔 (𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗥𝗼𝘂𝗻𝗱)
31. Maximum sum subarray (Kadane’s algorithm).
32. Sliding window maximum.
33. Merge k sorted linked lists.
34. Detect a cycle in a linked list.
35. Longest palindromic substring.
36. Design and implement an LRU Cache.

𝗛𝗶𝗿𝗶𝗻𝗴 𝗠𝗮𝗻𝗮𝗴𝗲𝗿 𝗥𝗼𝘂𝗻𝗱
37. Explain a frontend project you built end-to-end.
38. Describe the hardest production bug you fixed.
39. How do you balance performance vs feature delivery?
40. How do you handle disagreements in technical decisions?

----------------------------------------------------------------------------------------------------------------

That decides 12 LPA vs 30+ LPA frontend roles.

1. Duplicate API Calls Issue
 - Your SPA (like Flipkart cart) starts firing duplicate API requests randomly.
 - Network tab looks fine. State seems consistent.
 - They’re testing:
 → Idempotency, Race conditions
 → Retry logic, Debouncing/throttling
 → At-least-once delivery problems

2. Works in Staging, Fails in Production
 - In staging, everything works. In production, under heavy traffic, UI randomly freezes. No clear console error.
 - They’re testing:
 → Memory leaks
 → Event loop blocking
 → Bundle size explosion, Hydration mismatches
 → CDN caching issues
 → Virtual scrolling limits

3. Bundle is Slow After Deployment
 - You deployed a feature. Now LCP is 8s. Core Web Vitals tanked.
 - What changed?
 → Missing code splitting? N+1 bundle chunks?
 → Tree shaking failures?
 → Critical render path blocking?
 → Compression issues?

4. React Re-renders Processing Duplicate State Updates
 - Your components (like in Uber-scale dashboards) re-render unnecessarily.
Business impact is huge.
 - Explain:
 → useMemo vs useCallback
 → Idempotent state updates
 → React.memo optimization
 → Concurrent mode tradeoffs

5. System Design + Failure Handling
- Design a Real-time Dashboard like Google Analytics.
 - Explain what happens if:
 → WebSocket disconnects?
 → API rate limits hit?
 → Browser tab crashes?
 → Traffic spikes 10x?

-----------------------------------------------------------------------------------------------------------

🟡 Core Frontend & Performance:
1️⃣ How do you optimize performance of an application?
2️⃣ What is lazy loading?
3️⃣ How to cancel previous API requests?
4️⃣ Difference between SSR and CSR?
5️⃣ What is WebSocket?
6️⃣ What is Service Worker?
7️⃣ How do you prevent XSS and CSRF attacks?
🟢 React & State Management:
8️⃣ Explain implementation of Context API?
9️⃣ Explain implementation of Redux Toolkit?
🔟 Difference between Redux and Redux Toolkit?
1️⃣1️⃣ What is useEffect?
1️⃣2️⃣ What are Error Boundaries? Explain implementation?
1️⃣3️⃣ How do you handle errors in React applications?
1️⃣4️⃣ What is reconciliation?
1️⃣5️⃣ Difference between React 16 and React 18?
1️⃣6️⃣ What is state scheduling?
🔵 JavaScript & Coding:
1️⃣7️⃣ What are closures?
1️⃣8️⃣ Implement throttle?
1️⃣9️⃣ Difference between fetch and axios?
2️⃣0️⃣ Write code to find frequency of elements in an array?
🟣 Practical / Scenario-Based:
2️⃣1️⃣ Why migrate from Angular to React? What challenges did you face?
2️⃣2️⃣ How to send data from parent to child component?
2️⃣3️⃣ What is prop drilling?

--------------------------------------------------------------------------------------------------------------------------

𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 + 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗙𝘂𝗻𝗱𝗮𝗺𝗲𝗻𝘁𝗮𝗹𝘀 + 𝗦𝘆𝘀𝘁𝗲𝗺 𝗧𝗵𝗶𝗻𝗸𝗶𝗻𝗴

Here are the most asked frontend interview problems 👇

𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 (𝗠𝘂𝘀𝘁 𝗵𝗮𝘃𝗲):
 1. Implement debounce and throttle from scratch
 2. Explain event loop with real examples
 3. Write polyfills (map, reduce, bind)
 4. Closures and practical use cases
 5. Promise handling (all, race, async/await)


𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 (𝗥𝗲𝗮𝗹 𝘄𝗼𝗿𝗸 𝘀𝗸𝗶𝗹𝗹𝘀):
 1. Build a form with proper validation
 2. Create reusable components (modal, toast)
 3. Implement infinite scroll
 4. Optimize re-renders in React
 5. Make UI responsive and accessible


𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗦𝘆𝘀𝘁𝗲𝗺 𝗗𝗲𝘀𝗶𝗴𝗻 (𝗗𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝘁𝗶𝗮𝘁𝗼𝗿):
 1. Design autocomplete search
 2. Build a scalable dashboard
 3. Handle API caching on client
 4. Design real-time features

--------------------------------------------------------------------------------------------------------

𝗥𝗼𝘂𝗻𝗱 𝟭: 𝗢𝗻𝗹𝗶𝗻𝗲 𝗔𝘀𝘀𝗲𝘀𝘀𝗺𝗲𝗻𝘁
 - 3 coding problems on HackerEarth, 90 minutes.
 - Topics: arrays, hashmaps, and string manipulation.
 - Two problems were medium difficulty, one was hard.

𝗥𝗼𝘂𝗻𝗱 𝟮: 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 𝗣𝗵𝗼𝗻𝗲 𝗦𝗰𝗿𝗲𝗲𝗻
 - JavaScript fundamentals, event loop, call stack, and task queue with a live example.
 - Write a polyfill for Promise.all handling both resolve and reject cases.
 - Follow-ups:
 - How is Promise.allSettled different and when would you use it?
 - Implement a basic debounce function without using any library.
 - Difference between microtask and macrotask queue with a real example.

𝗥𝗼𝘂𝗻𝗱 𝟯: 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗠𝗮𝗰𝗵𝗶𝗻𝗲 𝗖𝗼𝗱𝗶𝗻𝗴
 - Build a product listing page with search, multi-select filters, and a cart in React.
 - Filters should update the product grid in real time without a page reload.
 - Follow-ups:
 - Persist cart state across page refreshes using localStorage.
 - Reflect active filters in the URL so the view is shareable.
 - Identify which components need memoization and justify why.
 - Add skeleton loaders while the initial data is being fetched.

𝗥𝗼𝘂𝗻𝗱 𝟰: 𝗟𝗼𝘄 𝗟𝗲𝘃𝗲𝗹 𝗗𝗲𝘀𝗶𝗴𝗻
 - Design a reusable toast notification system from scratch.
 - Support multiple simultaneous toasts, auto-dismiss timing, and manual close.
 - Follow-ups:
 - How would you queue toasts so they don't all stack at once?
 - Handle accessibility, how should screen readers announce new toasts?
 - Make it framework-agnostic so it can be used outside of React.

𝗥𝗼𝘂𝗻𝗱 𝟱: 𝗛𝗶𝗿𝗶𝗻𝗴 𝗠𝗮𝗻𝗮𝗴𝗲𝗿
 - Deep dive into your most impactful project, focus on decisions made and trade-offs.
 - How do you handle disagreements on technical approach within a team?
 - Meesho values a founder's mindset, expect questions on ownership and moving fast with ambiguity.
 - Closed with a discussion on what excites you about Meesho's engineering scale.

---------------------------------------------------------------------------------------------------------

𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 :

1. Closures & Scope
2. Event Loop & Async
3. Promises & Async/Await
4. Hoisting & This Keyword
5. Prototypes & Inheritance

𝗥𝗲𝗮𝗰𝘁 :

6. useState & useEffect
7. Context API & useContext
8. Custom Hooks
9. Component Lifecycle
10. State Management (Redux/Zustand)

𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 & 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻:

11. Code Splitting & Lazy Loading
12. Memoization (useMemo, useCallback)
13. Virtual DOM & Reconciliation
14. Bundle Optimization
15. Web Vitals & Performance Metrics

𝗘𝘀𝘀𝗲𝗻𝘁𝗶𝗮𝗹 𝗖𝗼𝗻𝗰𝗲𝗽𝘁𝘀:

16. Event Delegation & Bubbling
17. Debouncing & Throttling
18. Error Boundaries & Error Handling
19. Browser Storage (localStorage, sessionStorage)
20. REST APIs & HTTP Methods

--------------------------------------------------------------------------------------------------------------------------------

𝗥𝗼𝘂𝗻𝗱 𝟭 - 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹
1️⃣ Explain event loop and how asynchronous tasks are executed in JavaScript.
 2️⃣ Implement a custom hook in React that debounces input value.
 3️⃣ Create a reusable dropdown component that supports search and multi-select.
 4️⃣ How would you optimize React rendering performance in large lists (e.g., 10k+ rows)?
 5️⃣ Explain the difference between controlled and uncontrolled components with examples.

𝗥𝗼𝘂𝗻𝗱 𝟮 - 𝗔𝗱𝘃𝗮𝗻𝗰𝗲𝗱 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 / 𝗗𝗲𝘀𝗶𝗴𝗻
1️⃣ How would you design a scalable React application for a dashboard with 100+ pages?
 2️⃣ Explain how code splitting and lazy loading improve performance.
 3️⃣ How do you handle API rate limits gracefully on the frontend?
 4️⃣ What is hydration in Next.js and when can it cause UI mismatches?
 5️⃣ How would you build a component library used by multiple teams?
 6️⃣ Explain CSR, SSR, and SSG — when would you use each?
 7️⃣ How would you design a frontend architecture that can handle 1M+ users daily?

𝗥𝗼𝘂𝗻𝗱 𝟯 - 𝗠𝗮𝗻𝗮𝗴𝗲𝗿𝗶𝗮𝗹 / 𝗕𝗲𝗵𝗮𝘃𝗶𝗼𝗿𝗮𝗹
1️⃣ Tell me about a time when a critical production bug broke the UI — how did you handle it?
 2️⃣ How do you prioritize technical debt vs. new features?
 3️⃣ Describe how you handle conflicts with designers or backend teams.
 4️⃣ How do you communicate complex technical decisions to non-technical stakeholders?