🚀 Day 3/30 – Frontend Interview Series 📌 Topic: Debouncing vs Throttling If you’ve ever worked on search inputs, scroll events, or button clicks — you’ve probably faced performance issues. 👉 That’s where Debouncing and Throttling come into play. 🔹 What is Debouncing? Debouncing ensures that a function is called only after a certain delay once the user stops triggering the event. 📌 Example: Search input field (API call after user stops typing) function debounce(fn, delay) { let timer; return function (...args) { clearTimeout(timer); timer = setTimeout(() => { fn.apply(this, args); }, delay); }; } 👉 Use when: ✔ API calls ✔ Input validation ✔ Auto-save 🔹 What is Throttling? Throttling ensures that a function is called at most once in a given time interval, no matter how many times the event is triggered. 📌 Example: Scroll or resize events function throttle(fn, limit) { let flag = true; return function (...args) { if (flag) { fn.apply(this, args); flag = false; setTimeout(() => { flag = true; }, limit); } }; } 👉 Use when: ✔ Scroll events ✔ Window resize ✔ Button spam prevention #JavaScript #FrontendDeveloper #ReactJS #WebDevelopment #InterviewPrep #CodingInterview #100DaysOfCode
Debouncing vs Throttling in Frontend Development
More Relevant Posts
-
🚀 Day 10/30 – Frontend Interview Series Event Loop Explained Simply If you've ever wondered how JavaScript handles multiple tasks at once… 👉 The answer is the Event Loop --- 🧠 What is the Event Loop? JavaScript is single-threaded, meaning it can do one task at a time. But still, it handles async tasks like APIs, timers, and promises smoothly. This is possible because of the Event Loop. --- ⚙️ How it works: 1️⃣ Call Stack - Executes synchronous code - One function at a time 2️⃣ Web APIs (Browser/Node) - Handles async operations (setTimeout, fetch, DOM events) 3️⃣ Callback Queue (Macrotask Queue) - Stores callbacks from async tasks like setTimeout 4️⃣ Microtask Queue - Higher priority - Used by Promises (.then, .catch) 5️⃣ Event Loop - Continuously checks: 👉 Is Call Stack empty? 👉 If yes → moves tasks from queues to stack --- ⚡ Execution Priority: 👉 First: Synchronous Code 👉 Then: Microtasks (Promises) 👉 Then: Macrotasks (setTimeout, setInterval) --- 💡 Example: console.log("Start"); setTimeout(() => { console.log("Timeout"); }, 0); Promise.resolve().then(() => { console.log("Promise"); }); console.log("End"); ✅ Output: Start End Promise Timeout --- 🔥 Why this matters? Understanding the Event Loop helps you: ✔ Write better async code ✔ Avoid bugs ✔ Crack JavaScript interviews #JavaScript #EventLoop #WebDevelopment #Frontend #ReactJS #AsyncJS #CodingJourney #Interview
To view or add a comment, sign in
-
🚀𝐅𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐒𝐞𝐫𝐢𝐞𝐬 – 𝐃𝐚𝐲 𝟖 𝐀𝐟𝐭𝐞𝐫 𝐠𝐢𝐯𝐢𝐧𝐠 𝟓𝟎+ 𝐟𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐬, 𝐈 𝐧𝐨𝐭𝐢𝐜𝐞𝐝 𝐨𝐧𝐞 𝐩𝐚𝐭𝐭𝐞𝐫𝐧: 𝐌𝐚𝐧𝐲 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫𝐬 𝐮𝐬𝐞 𝐚𝐫𝐫𝐨𝐰 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬… 𝐛𝐮𝐭 𝐝𝐨𝐧’𝐭 𝐟𝐮𝐥𝐥𝐲 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝 𝐡𝐨𝐰 𝐭𝐡𝐞𝐲 𝐛𝐞𝐡𝐚𝐯𝐞. Today’s question 👇 🔹 What will this code print? const obj = { name: "Swapnil", greet: function () { console.log(this.name); }, greetArrow: () => { console.log(this.name); } }; obj.greet(); obj.greetArrow(); Take 10 seconds. ✅ Correct Output: Swapnil undefined 🔥 Why? 1️⃣ Normal Function obj.greet(); 👉 Called as a method of obj 👉 this refers to obj So: Swapnil 2️⃣ Arrow Function obj.greetArrow(); 👉 Arrow functions do NOT have their own this They inherit this from the surrounding scope. In this case: 👉 this refers to the global scope (or undefined in strict mode) So: undefined 🧠 Key Difference 👉 Normal Function → this depends on how it's called 👉 Arrow Function → this is lexically bound (fixed) 🎯 What Interviewers Are Testing -They want to see if you understand: -Lexical this -Difference in function behavior -Why arrow functions are not suitable for object methods -Real-world implications 🚀 Pro Tip ❌ Don’t use arrow functions for object methods ❌ Don’t use arrow functions in constructors ✅ Use them for: -Callbacks -Functional programming -Cleaner syntax 💡 𝐎𝐧𝐞-𝐋𝐢𝐧𝐞 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐀𝐧𝐬𝐰𝐞𝐫 𝐀𝐫𝐫𝐨𝐰 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬 𝐝𝐨𝐧’𝐭 𝐡𝐚𝐯𝐞 𝐭𝐡𝐞𝐢𝐫 𝐨𝐰𝐧 𝐭𝐡𝐢𝐬; 𝐭𝐡𝐞𝐲 𝐢𝐧𝐡𝐞𝐫𝐢𝐭 𝐢𝐭 𝐟𝐫𝐨𝐦 𝐭𝐡𝐞 𝐬𝐮𝐫𝐫𝐨𝐮𝐧𝐝𝐢𝐧𝐠 𝐥𝐞𝐱𝐢𝐜𝐚𝐥 𝐬𝐜𝐨𝐩𝐞. Tomorrow: We’ll break another classic trap: 👉 setTimeout inside loop (var vs let) Follow for Day 9 🔥 #javascript #frontend #interviewprep #webdevelopment #reactjs #coding
To view or add a comment, sign in
-
Cracking Frontend Interviews in 2026 — Phase 2 (React + LLD) 🧵 If JavaScript is the foundation, React is where interviews get serious. 🔥 PHASE 2 — React (Beginner → Advanced) ▸ Why React? JSX & Babel ▸ Functional vs Class Components ▸ Props vs State ▸ React Lifecycle (important for interviews) ▸ Hooks — useState, useEffect, useRef, useContext, useReducer ▸ Custom Hooks (highly asked) ▸ useEffect vs useLayoutEffect ▸ React.memo vs useMemo vs useCallback ▸ Virtual DOM → Reconciliation → Fiber ▸ Why keys matter in lists ▸ Controlled vs Uncontrolled components ▸ Error Boundaries ▸ Portals & Refs ⚙️ Advanced React ▸ State Management — Context API vs Redux vs Zustand ▸ How Redux works internally ▸ API Handling — fetch vs axios ▸ React Query (TanStack Query) ▸ Rendering — CSR vs SSR vs SSG vs ISR ▸ Hydration & Hydration issues ▸ TypeScript with React ▸ Micro Frontend Architecture ▸ Design Patterns in React 🧠 LLD in React (GAME CHANGER) - Don’t just read — build these. ▸ Counter (with edge cases) ▸ Stopwatch / Timer ▸ Todo App (with clean state logic) ▸ Search (Debounce + Throttle + Infinite Scroll) ▸ Accordion / Modal / Tabs / Autocomplete ▸ Form with validation (no library) ▸ Virtualized List (10k+ rows efficiently) ▸ Drag & Drop UI ⭐ Most Asked: ▸ File Explorer (Nested Tree structure) → recursion + state + performance 📚 Practice Resources: ▸ greatfrontend.com ▸ bigfrontend.dev ▸ Learn patterns from → patterns.dev If you can build these from scratch, you’re already ahead of 80% candidates. Next: Phase 3 — SEO & Performance ⚡ ♻️ Repost to help someone preparing for frontend interviews. #ReactJS #FrontendDevelopment #WebDevelopment #InterviewPrep #LLD #JavaScript #SoftwareEngineering #CareerGrowth
To view or add a comment, sign in
-
💼 Frontend Interview Experience – Round 2 As promised, sharing my Round 2 interview experience and the questions I was asked. This round was more focused on system design, performance, and deeper frontend concepts. 🟡 Questions I was asked: 1️⃣ Difference between GraphQL and REST API? 2️⃣ How do you decide which library to use in a project? For example: Date handling — Day.js vs Moment.js 3️⃣ How do you reduce bundle size in a frontend application? 4️⃣ What is Webpack and how does it create bundles? 5️⃣ What is Tree Shaking? How does it work internally and how does it decide what to remove? 6️⃣ What is Suspense in React? 7️⃣ What are loaders and actions? (React Router / data handling concepts) 8️⃣ What is hydration and dehydration? 9️⃣ What is Critical Rendering Path? 🔟 What are stale closures? 💭 My takeaway from Round 2: This round was less about basic concepts and more about real-world decision making, performance optimization, and understanding how things work internally. It made me realize that to crack such interviews, it’s important to go beyond “what” and focus on “why” and “how internally”. Grateful for the learning experience 🚀 #frontenddevelopment #reactjs #javascript #systemdesign #performance #interviewexperience
To view or add a comment, sign in
-
I’ve been diving deep into interview prep lately, and it’s easy to get caught in the trap of memorising "Top 50 JavaScript Questions." But after years in the trenches of frontend development, I’ve realised that interviews aren't looking for a dictionary, they’re looking for a mental model. Take the Event Loop, for example. It’s one thing to say "it handles async code." It’s another to explain why a Promise resolves before a setTimeout(0). When you understand the Microtask Queue, you aren't just answering a quiz; you’re demonstrating that you can debug performance bottlenecks in a complex React application. The shift that changed my prep: ▶️ From Syntax to Scenarios: Don't just learn what a Closure is. Explain how you used one to create a private state or a factory function in your last project. ▶️ From "How" to "Trade-offs": Don't just use ===. Explain why Type Coercion in JavaScript can lead to silent failures in production and why strict equality is the standard for clean, predictable code. ▶️ From Coder to Architect: Every line of code is a decision. Seniority is about being able to defend those decisions when the pressure is on. The goal isn't just to pass the interview; it's to be the engineer who knows exactly what's happening under the hood when the "impossible" bug hits production. #JavaScript #WebDevelopment #SoftwareEngineering #CareerGrowth #Frontend
To view or add a comment, sign in
-
🚀 What You Should Learn to Crack Any Frontend Interview (2026 Edition) Frontend interviews aren’t about just writing code anymore — they test how you think, structure, and scale your solutions. Here’s a no-BS roadmap 👇 --- 🧠 1. Strong JavaScript Fundamentals (Non-Negotiable) - Closures, Scope, Hoisting - Promises, Async/Await, Event Loop - Callbacks & Error Handling - Array/Object manipulation 👉 If JS is weak, nothing else matters. --- ⚛️ 2. Master One Framework (Preferably React or Vue) - Component lifecycle - State management (Context API / Vue reactivity) - Hooks / Composition API - Reusable components 👉 Depth > switching multiple frameworks. --- 🎯 3. DOM & Browser Concepts - Event delegation - Debouncing & Throttling - Reflow & Repaint - How rendering works 👉 Interviewers love these questions. --- 🎨 4. CSS That Actually Matters - Flexbox & Grid (must) - Responsive design - Positioning & layout - Basic animations 👉 Clean UI = strong impression. --- ⚡ 5. API Handling & Async Data - Fetch / Axios - Error handling - Loading states - Data transformation 👉 Real apps = API driven. --- 🧩 6. Problem Solving (DSA — but focused) - Arrays, Strings, Objects - Basic recursion - Logic building 👉 No need to go full hardcore — but basics are expected. --- 🏗️ 7. System Thinking (This is the game changer) - How to structure a project - Folder architecture - Performance optimization - Code readability & scalability 👉 This is what separates average vs selected. --- 🔥 8. Real Projects (Most Important) - Build 2–3 solid projects - Add filtering, sorting, API integration - Deploy them 👉 Your project often speaks louder than your resume. --- 💬 Final Advice: Don’t try to learn everything. Learn deeply, build consistently, and explain clearly. Because in interviews: 👉 They don’t hire the best coder 👉 They hire the best problem solver --- #Frontend #WebDevelopment #JavaScript #React #Vue #InterviewPrep #Developer
To view or add a comment, sign in
-
🚀 Top 30 MUST-KNOW Frontend Interview Questions If you're preparing for your next frontend role, these are the questions that keep showing up. Not just theory — these test how you think, build, and debug in real-world scenarios. 👉 Challenge yourself: How many can you confidently answer without Googling? 🔥 Core JavaScript ① What is the difference between == and ===? ② Explain closures with a practical example. ③ How does the event loop work? ④ What are promises vs async/await? ⑤ What is hoisting? ⑥ Explain prototypal inheritance. ⑦ What are higher-order functions? ⑧ What is debouncing vs throttling? ⚛️ React (or similar frameworks) ⑨ What happens during React’s rendering process? ⑩ Difference between state and props? ⑪ What are hooks? Why were they introduced? ⑫ Explain useEffect lifecycle behavior. ⑬ Controlled vs uncontrolled components? ⑭ What causes unnecessary re-renders? ⑮ How does React reconciliation work? ⑯ What is memoization (React.memo, useMemo, useCallback)? 🌐 Browser & Performance ⑰ How does the DOM work? ⑱ What is the difference between localStorage, sessionStorage, and cookies? ⑲ What is CORS and how does it work? ⑳ How can you optimize frontend performance? ㉑ What is lazy loading? ㉒ What happens when you type a URL in the browser? 🎨 HTML & CSS ㉓ Difference between display: none and visibility: hidden? ㉔ What is the box model? ㉕ Flexbox vs Grid — when to use which? ㉖ What are pseudo-classes vs pseudo-elements? ㉗ How does CSS specificity work? 🧠 Architecture & Best Practices ㉘ How do you structure a scalable frontend app? ㉙ What is code splitting? ㉚ How do you handle API errors and loading states? 💡 Pro Tip: Interviewers aren’t just checking answers — they’re evaluating: Your clarity of thought Real-world experience Ability to debug and optimize 🔥 Your turn: How many did you get confidently? Drop your score 👇 And tell me — which one do you find the trickiest? #FrontendDevelopment #JavaScript #ReactJS #WebDevelopment #FrontendEngineer #CodingInterview #TechCareers #SoftwareEngineering #InterviewPrep #Developers #LearnToCode #CareerGrowth
To view or add a comment, sign in
-
Frontend Interview Experience – A Small but Interesting Redux Debate Recently attended a frontend interview where the discussion covered HTML, CSS, JavaScript, React, GraphQL, and Microfrontends. During the React round, I was asked about the core pillars of Redux. I explained: • Store – holds the application state • Actions – plain JavaScript objects describing what happened • Reducers – pure functions that return the new state • Dispatch – sends actions to the store • Selectors – used to read data from the store Then came an interesting moment The interviewer mentioned that "Actions are functions, not objects." I respectfully shared my understanding that: In Redux, an Action is a plain JavaScript object with a mandatory type field. After the interview, I double-checked — and yes, Redux defines actions as plain objects. The likely confusion: What the interviewer referred to was Action Creators, which are functions that return action objects. Example: const addTodo = (text) => ({ type: "ADD_TODO", payload: text }); Key takeaway: • Action = Object • Action Creator = Function 🎯 Interviews are not just about right or wrong — they’re about clarity of concepts and communication. Curious to know — have you ever faced a situation where both perspectives were technically correct but misunderstood in interviews? #Frontend #React #Redux #JavaScript #InterviewExperience #Learning
To view or add a comment, sign in
-
🚀 Day 7 of My Frontend Developer Interview Preparation Today’s learning was all about functions in JavaScript — and honestly, this topic goes much deeper than it looks 👀 Here’s what I explored today: ✅ First-Class Functions – How functions can be treated like variables (passed, returned, stored) ✅ Function Declaration vs Function Expression – Understanding the key differences and how hoisting behaves differently ✅ Types of Functions – Different ways to define and use functions effectively ✅ Event Listeners & Callback Functions – How JavaScript handles events and executes callbacks behind the scenes 💡 One thing I realized today: Functions are not just reusable blocks of code — they are the core building blocks of JavaScript behavior 🔥 Tomorrow’s Plan: I’ll be solving output-based and conceptual questions from these topics to strengthen my understanding. If you’re also preparing for frontend interviews, stay consistent and keep building step by step 💪 👉 If you know some tricky questions from these topics, drop them in the comments! #Day7 #JavaScript #FrontendDevelopment #InterviewPreparation #WebDevelopment #LearningJourney
To view or add a comment, sign in
-
How I cracked 40+ companies and 100+ interview rounds (My Secret Strategy). 🚀 I used to prepare for interviews the traditional way—reading books cover-to-cover and endless tutorial hell. It was exhausting and inefficient. Now, I don't do that. My strategy shifted from passive consuming to active problem-solving. I focus purely on high-impact questions and deep-diving into the underlying concepts only when needed. If you are preparing for a JavaScript/Frontend role, here is Part 1 of my personal, curated must-know list: 👇 The Core JavaScript List (Part 1) 👇 1. Closures: How do they work? Be ready for closure-based output questions and a real-life use case. 2. Prototypal Inheritance: Explain it with an example and know what sits at the very top of the prototypal chain. 3. Array Methods: Master map, filter, and reduce. Can you write a polyfill for reduce from scratch? 4. Context (this): What are call, bind, and apply? Write a polyfill for bind. 5. Asynchronous JS: Explain callbacks, promises, and async/await. 6. Debouncing: What is it? Write a polyfill for debounce. 7. Array Flattening: How to flatten a deeply nested array (e.g., [1, [2, 3, [4, 5], 6]]). 8. Throttling: Implement a throttle function. Constraint: It must cover all edge cases (the naive approach found online fails often). 9. Promises: Implement a polyfill for the Promise object. 10. Currying: Write a curried version of a standard function. Part 2 is coming soon! Follow Santosh Yadav Which one of these concepts do you find the trickiest? Let me know in the comments! 👇 #JavaScript #Frontend #InterviewPrep #React #CareerGrowth #SoftwareEngineering
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