<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shivali on Medium]]></title>
        <description><![CDATA[Stories by Shivali on Medium]]></description>
        <link>https://medium.com/@shivali0087?source=rss-3a11bc43167------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tX_EF1oa8i-Etra_</url>
            <title>Stories by Shivali on Medium</title>
            <link>https://medium.com/@shivali0087?source=rss-3a11bc43167------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:24:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivali0087/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The 2026 System Design Prep Playbook — What to Study, Practice, and Expect]]></title>
            <link>https://medium.com/@shivali0087/how-to-prepare-system-design-interviews-2026-b3068bd2e67e?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3068bd2e67e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Tue, 19 May 2026 12:01:01 GMT</pubDate>
            <atom:updated>2026-05-19T12:01:01.281Z</atom:updated>
            <content:encoded><![CDATA[<p>In Part 1, I covered the three new dimensions interviewers now grade on: AI-aware design, cost reasoning, and operational thinking.</p><p>Now let’s get tactical. What questions are you actually facing? What does a passing answer look like? And how do you prepare in 4 weeks?</p><h3>The Questions You’ll Actually Face</h3><p>Classic questions still appear, but with 2026 twists:</p><ul><li>“Design a URL shortener” → now includes analytics, abuse detection, and cost optimization at 1B links</li><li>“Design a notification system” → now means 50M users, 30 channels, intelligent batching, and user preference learning</li><li>“Design a recommendation engine” → now means collaborative filtering + semantic embeddings + an LLM re-ranker</li></ul><p>And entirely new categories that didn’t exist three years ago:</p><ol><li>Design a RAG pipeline for enterprise document search</li><li>Design an LLM gateway with rate limiting, cost allocation, and model routing</li><li>Design a multi-tenant AI agent orchestration platform</li><li>Design a vector search service with real-time index updates</li><li>Design a real-time fraud detection system using streaming ML inference</li></ol><p>If none of these feel familiar, that’s your signal to update your prep.</p><h3>What a 2022 vs. 2026 Answer Looks Like</h3><p><strong>Question: “Design a content recommendation feed.”</strong></p><p><strong>2022 answer (would have passed then):</strong></p><p>Users, posts, interactions in a relational DB. Recommendation service pulls candidates via collaborative filtering. Cache top-N. Serve via API. Scale horizontally.</p><p><strong>2026 answer (what passes now):</strong></p><p>Three-stage pipeline. Candidate generation via collaborative filtering on interaction history — feature store, updated hourly. Re-ranking layer using a lightweight ML model scoring on real-time signals (recency, engagement velocity, social graph proximity). Optional LLM summarization for top 5 items — called async, cached with a 15-minute TTL because cost per inference at scale is non-trivial.</p><p>Vector component: embeddings via sentence transformer, stored in Qdrant, queried for semantic similarity on cold-start users where collaborative signal is weak.</p><p>Operationally: feature freshness monitored via staleness metric. If feature store falls behind 2+ hours, degrade to popularity-based fallback. Canary deployments for re-ranking model with auto-rollback if CTR drops &gt;5% in first 30 minutes.</p><p>The difference: AI awareness, cost consciousness, and operational maturity — all unprompted.</p><h3>How the Format Itself Is Changing</h3><p>It’s not just the questions. Companies are rethinking the interview format:</p><p><strong>Google (2026):</strong> Piloting AI-assisted interviews where candidates use an approved AI assistant during code comprehension rounds. They’re testing whether you can direct AI effectively — not just write code from memory.</p><p><strong>Sierra AI:</strong> Replaced coding interviews entirely with Plan → Build → Review. Candidates ideate a product, build it in 2 hours using any AI tools, then demo and defend their choices.</p><p><strong>Amazon:</strong> Traditional format, but the rubric now explicitly weights operational thinking and leadership-principle-aligned decisions. Frugality shows up in your architecture choices, not just behavioral rounds.</p><p>The trend is clear: companies are testing whether you can build and operate real systems with AI as a tool — not whether you memorized distributed systems trivia.</p><h3>The 4-Week Prep Strategy</h3><p><strong>Week 1–2: Update your mental models</strong></p><p>You need working knowledge of:</p><ul><li>Vector databases — when to use, how they scale</li><li>RAG architecture — retrieval, augmentation, generation pipeline</li><li>LLM serving — latency, cost per token, batching, caching strategies</li><li>Cost modeling — rough $/request for common services (DynamoDB, Lambda, LLM APIs)</li></ul><p>You don’t need to be an expert. You need to integrate these into a design naturally.</p><p><strong>Week 3: Practice with 2026 constraints</strong></p><p>Take classic problems and add modern requirements:</p><ul><li>“Design YouTube” → add AI-generated video summaries, cost analysis for transcription at scale</li><li>“Design Uber” → add ML-based matching, real-time pricing model, operational monitoring</li><li>“Design a chat app” → add semantic search over message history, smart reply suggestions</li></ul><p>45 minutes each. Out loud. Record yourself.</p><p><strong>Week 4: Mock interviews</strong></p><p>Pattern recognition only forms under pressure. Find a partner. Trade rounds. Focus on:</p><ul><li>Can you integrate an AI component naturally?</li><li>Do you mention cost without being prompted?</li><li>Do you discuss deployment, monitoring, and failure modes?</li></ul><p>If you hit all three unprompted, you’re ready.</p><h3>Start Here</h3><p>Pick one classic system design problem. Redesign it with a 2026 lens:</p><ol><li>Add an AI component</li><li>Estimate the cost</li><li>Describe how you’d deploy it safely and monitor it</li></ol><p>If that feels uncomfortable — good. That’s the gap between where you are and where the bar moved to. And now you know exactly what to work on.</p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><p><em>💬 </em><strong><em>Missed Part 1?</em></strong><em> Read: </em><a href="https://medium.com/@shivali0087/system-design-interview-changed-2026-d5e0cd11c843"><em>The System Design Interview Changed in 2026 — Here’s What No One Tells You</em></a></p><p><em>💬 </em><strong><em>Preparing for LLD rounds?</em></strong><em> Read: </em><a href="https://medium.com/@shivali0087/how-to-actually-crack-lld-interviews-not-just-draw-boxes-and-arrows-1e3d6b52d272"><em>Why Most Engineers Struggle in LLD Interviews</em></a></p><p><em>Thank you for reading! If you found this useful, connect with me on </em><a href="https://linkedin.com/in/shivali-maheshwari"><em>LinkedIn</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3068bd2e67e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The System Design Interview Changed in 2026 — Here’s What No One Tells You]]></title>
            <link>https://medium.com/@shivali0087/system-design-interview-changed-2026-d5e0cd11c843?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5e0cd11c843</guid>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Tue, 12 May 2026 13:39:56 GMT</pubDate>
            <atom:updated>2026-05-12T13:39:56.837Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Design a URL shortener.”</blockquote><blockquote>You take a breath. Draw a load balancer. A database. A cache. Talk about horizontal scaling.</blockquote><blockquote>And the interviewer nods politely — but you can tell something’s off.</blockquote><blockquote>If that’s happened to you recently, it’s not your imagination.</blockquote><p>System design interviews shifted. The questions look the same. The bar behind them doesn’t.</p><h3>What Actually Changed</h3><p>Between 2023 and 2026, three things broke the old playbook:</p><p><strong>1. AI prep made everyone sound identical.</strong></p><p>When every candidate gives the same ChatGPT-polished answer, interviewers stop getting signal. So they changed what they listen for.</p><p><strong>2. “Scale talk” became cheap.</strong></p><p>Saying “we’d shard the database” is free. Knowing <em>when</em> to shard, <em>how</em> to rebalance, and <em>what it costs</em> — that’s the real skill.</p><p><strong>3. AI became infrastructure.</strong></p><p>“Design a recommendation system” no longer means collaborative filtering. It means embeddings, vector stores, LLM gateways, and a cost model that doesn’t bankrupt the company.</p><h3>The Three New Dimensions</h3><p>Here&#39;s what&#39;s now explicitly on the rubric that wasn&#39;t three years ago:</p><h3>1. AI-Aware Design Is Table Stakes</h3><p>You will get questions like:</p><ul><li>&quot;Design a search system with semantic understanding&quot;</li><li>&quot;Design a content feed with LLM-generated summaries&quot;</li><li>&quot;Design a customer support system with an AI agent layer&quot;</li></ul><p>The bar isn’t “build a transformer.” The bar is “integrate AI components the way you’d integrate a cache or a queue.” You need to reason about where embeddings live, what the latency cost of an LLM call is in the hot path, and what your fallback looks like when the model is down.</p><h3>2. Cost Reasoning Is Graded Explicitly</h3><p>&quot;We&#39;d add more servers&quot; is now a red flag. Interviewers want:</p><ul><li>&quot;At this QPS, multi-region active-active costs $X/month — is that justified?&quot;</li><li>&quot;Calling GPT-4 on every request at 10K QPS costs $Y/day. Here&#39;s how I&#39;d tier it.&quot;</li><li>&quot;DynamoDB vs. Aurora at this read pattern — here&#39;s the cost tradeoff.&quot;</li></ul><p>You don&#39;t need exact numbers. You need to show cost is a design constraint, not an afterthought.</p><h3>3. Operational Thinking Is No Longer Optional</h3><p>If you finish without mentioning:</p><ul><li>How you deploy without downtime</li><li>How you know it&#39;s broken before users tell you</li><li>What&#39;s the rollback path</li></ul><p>…you left points on the table. This isn&#39;t a separate round. It&#39;s woven into the system design rubric.</p><h3><strong>The Gaps Interviewers Notice</strong></h3><p><strong>1. Treating AI as a black box.</strong> &quot;We&#39;d use an LLM here&quot; without discussing latency, cost, or failure modes.</p><p><strong>2. Ignoring cost entirely.</strong> Multi-region Cassandra for a 1K-user app. GPT-4 on every request with no caching strategy.</p><p><strong>3. Going wide instead of deep.</strong> Two deep components with trade-off analysis beats five shallow ones every time.</p><p><strong>4. Skipping failure modes.</strong> Every component you draw should have a failure story.</p><p><strong>5. Refusing to commit.</strong> &quot;It depends&quot; is fine once. The third time, pick something and defend it.</p><h3>The Meta-Shift</h3><p>The system design interview is no longer testing whether you <em>know</em> distributed systems. It&#39;s testing whether you have <strong>engineering judgment</strong>.</p><p>Can you make a decision with incomplete information and defend it? Can you identify the <em>one</em> component that will break first? Can you reason about cost, operational burden, and user impact simultaneously?</p><p>That’s not something you cram the week before. It’s something you build.</p><p><em>In Part 2, I&#39;ll break down the exact prep strategy — including new question categories, a worked example showing the difference between a 2022 and 2026 answer, and how companies are changing the interview format itself.</em></p><p><em>Follow so you don&#39;t miss it.</em></p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><p>💬 <strong>Preparing for LLD rounds too?</strong> Read: <a href="https://medium.com/@shivali0087/how-to-actually-crack-lld-interviews-not-just-draw-boxes-and-arrows-1e3d6b52d272">Why Most Engineers Struggle in LLD Interviews</a></p><p><em>Thank you for reading! If you found this useful, connect with me on </em><a href="https://linkedin.com/in/shivali-maheshwari"><em>LinkedIn</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5e0cd11c843" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I’d Prepare for an LLD Interview in 7 Days — If I Had to Start From Scratch]]></title>
            <link>https://medium.com/@shivali0087/how-id-prepare-for-an-lld-interview-in-7-days-if-i-had-to-start-from-scratch-87294ee08ff5?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/87294ee08ff5</guid>
            <category><![CDATA[low-level-design]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[technical-interview]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 07:27:44 GMT</pubDate>
            <atom:updated>2026-05-11T18:27:44.129Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I’d Prepare for an LLD Interview in 7 Days — If I Had to Start From Scratch</h3><p>You’ve got 7 days to prep for a Low-Level Design interview.<br>You’re panicking.<br>Do you start with YouTube? Dig through GitHub repos? Memorize design patterns?</p><p>If that’s you — take a breath.</p><p>Over the years, I’ve noticed a clear pattern among engineers who ace LLD interviews: they don’t wing it. They follow a structured approach to organize their thoughts, communicate trade-offs, and demonstrate real-world design judgment.</p><blockquote><em>So I asked myself: </em>If I had to start from scratch — with just one week — what would I do?</blockquote><p>Here’s the 7-day plan I’d follow:</p><h3>📅 Day 1: Learn the Interviewer’s Lens</h3><p>Before jumping into designs, understand what your interviewer is <em>really</em> assessing:</p><p>🧠 Not perfection, but your clarity, trade-offs, and real-world thinking.</p><p>Start here:</p><ul><li>🎥 Watch 1–2 mock LLD interviews on YouTube. Pause often. Note: where do candidates lose clarity? What follow-ups does the interviewer ask?</li><li>🎯 Be the interviewer: pick a simple system (e.g., URL Shortener), critique a few designs online. Ask: <em>Would I pass this person?</em></li><li>🔍 Skim a Big Tech SDE job description — look for words like “ownership,” “trade-offs,” “component design.” Prep to reflect that.</li></ul><p>💡 Bonus: LLD rounds often begin with 2 minutes of behavioral questions. If that’s a weak spot, <a href="https://medium.com/@shivali0087/mastering-behavioral-interview-questions-the-starr-method-to-tell-powerful-stories-and-land-your-a5198e29e076"><strong>this guide</strong></a> breaks down how to craft strong STARR stories, avoid common traps, and impress within minutes.</p><h3>📅 Day 2: Master the Structure (This is 80% of the Game)</h3><p>Most people get stuck because they have no structure — they improvise under pressure and lose coherence.</p><p>Strong performers use a repeatable structure — a thought process that brings clarity under pressure.</p><p>Here’s a peek into the structure — the full framework lives inside the LLD Interview Blueprint:</p><ul><li>Begin with clarifying goals (user, functional, technical)</li><li>Prioritize user flows before classes</li><li>Use component thinking — not class dumping</li><li>Plan your structure to support future growth (modularity, extensibility)</li><li>Speak your logic out loud — it builds interviewer trust</li></ul><p>This structured flow becomes your compass in every LLD round.</p><h3>📅 Day 3–4: Tackle Real-World Problems (Not Just Toy Examples)</h3><p>Most practice examples are too basic — Library Management Systems, ATM design, etc. Interviewers aren’t asking those anymore.</p><p>Instead, practice with systems that test:</p><ul><li>End-to-end product thinking</li><li>Component interaction</li><li>Extensibility under new requirements</li><li>Trade-off clarity under pressure</li></ul><p><strong>💡 What to do:</strong></p><p>📅 Day 3: Design a Notification System</p><blockquote>Map out user flows (send, retry, failure handling)<br>Define key abstractions like IChannel, Scheduler, and Notifier<br>Think: <em>How will this scale when you add WhatsApp or push notifications?</em></blockquote><p>📅 Day 4: Design a Digital Wallet</p><blockquote>Cover flows like add money, send/receive, and refunds<br>Consider interface design, transaction atomicity.<br>Design for extensibility.</blockquote><h3>📅 Day 5: Spot and Learn From Red Flags</h3><p>Even great designs can raise doubts if you miss hygiene details.</p><p><strong>Look out for:</strong></p><ul><li>No null checks or retries</li><li>Mixed responsibilities in the same class</li><li>No failure recovery or metrics</li><li>Unscalable assumptions</li></ul><h3>📅 Day 6: Patterns &amp; Principles — But Practical</h3><p>It’s not about memorizing every pattern.</p><p>Instead, ask:</p><ul><li>When would I use Strategy vs Factory?</li><li>What makes code extensible <em>and</em> testable?</li><li>Can I spot bad coupling?</li></ul><p>Example:</p><blockquote>“I’m using the <strong>Factory pattern</strong> to create different types of payment methods — credit card, UPI, wallet. This way, the object creation is decoupled from the core checkout flow, and adding a new payment method won’t require changes in the main logic.”</blockquote><p>That’s a <em>signal of design maturity</em>.</p><h3>📅 Day 7: Simulate a Full 45-min Interview</h3><p>The final test: can you think, design, and speak clearly under pressure?</p><p><strong>Action:</strong></p><ul><li>Pick one system you <em>haven’t</em> done yet — maybe a Chat App or Booking System.</li><li>Set a 45-min timer</li><li>Speak your thoughts, sketch flows, explain decisions</li><li>Review your notes afterward</li></ul><p>✅ Ask: Did I cover use cases, explain decisions clearly, and handle edge cases, failures, extensibility?</p><h3>Final Thoughts: You Don’t Need 30 Days. You Need a System.</h3><p>If you’re short on time, don’t panic. Focus on the <em>right</em> prep, not <em>more</em> prep.</p><p>👉 Let me know in the comments:<br><strong>What system do <em>you</em> struggle with the most?</strong> I might write a breakdown for it next. 💬</p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><blockquote>Thank you for reading this blog post. I hope you found it informative. If you have any questions, feedback, or would like to discuss the topic further, please don’t hesitate to reach out. Connect with me on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a>.</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87294ee08ff5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Actually Crack LLD Interviews — Not Just Draw Boxes and Arrows]]></title>
            <link>https://medium.com/@shivali0087/how-to-actually-crack-lld-interviews-not-just-draw-boxes-and-arrows-1e3d6b52d272?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e3d6b52d272</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[tech-interview]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[career-advice]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Thu, 26 Jun 2025 14:39:02 GMT</pubDate>
            <atom:updated>2025-07-06T22:28:16.526Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Actually Crack LLD Interviews — Not Just Draw Boxes and Arrows</h3><blockquote>“Can you design a Food Delivery System?”<br> You pause.<br> Start drawing classes.<br> And 15 minutes in — you’re lost in your own diagram.</blockquote><p>If that sounds familiar, you’re not alone.</p><p>Low-Level Design (LLD) interviews trip up even strong engineers. Not because they lack coding skills — but because they struggle with <em>design judgment</em>, <em>structured thinking</em>, and <em>clear communication in interview.</em></p><p>But let’s first break down why candidates actually stumble — and what to do about it.</p><h3>❌ Mistake #1: Jumping Straight into Classes</h3><p>You hear “Design a food ordering system” — and your first instinct is to draw Order, Restaurant, and Cart classes.</p><p>But good design isn’t about boxes and arrows.<br>It’s about <strong>understanding the product</strong> before the code.</p><p><strong>Fix this:</strong><br>Start with the <strong>user journey</strong>.<br>What’s the flow? What are the use cases? What edge cases exist?<br>Once you map that, the classes will almost design themselves.</p><h3>❌ Mistake #2: Designing Without Trade-offs</h3><p>You hear “Design a Notification Delivery System”</p><p>You say: “I’ll use a Singleton pattern for the NotificationManager.”<br>But when interviewer asks why, you hesitate.</p><p><strong>Fix this: </strong><br>Always ask yourself — What trade-offs am I making here? Could I have solved this a different way? Speak your decisions aloud. Even simple ones.</p><p>Here’s what that sounds like in a real interview: <em>“I’m using the Strategy pattern here so it’s easy to plug in new channels. Right now we only have Email and SMS, but if we add more channels like WhatsApp, it won’t impact the core logic.”</em></p><p>That sentence? 👏 Signals judgment, foresight, and real-world experience.</p><h3>❌ Mistake #3: Lack of OOP Principles in Action</h3><p>Candidates know about SOLID, but forget to <em>use</em> it.</p><p>They dump all logic in one class. They tightly couple things that should be decoupled. They don’t think in terms of <strong>interfaces</strong>, <strong>responsibility</strong>, and <strong>testability</strong>.</p><p><strong>Fix this:</strong><br>LLD isn’t about memorizing SOLID — it’s about applying it <em>in the flow</em>.</p><p>Ask yourself:</p><ul><li>Would this scale with more features?</li><li>Can I unit test this component?</li><li>What if someone else had to maintain this code?</li></ul><h3>❌ Mistake #4: No Red Flag Awareness</h3><p>LLD rounds aren’t scored just on completeness. They’re also scored on <strong>how many red flags you raise</strong> — even unintentionally.</p><p><strong>What usually happens:</strong><br> You walk out thinking, “I covered all the classes and flows.”<br>But behind the scenes, the interviewer notes:</p><ul><li>❌ Mixed business logic in the controller</li><li>❌ No validation for null or edge scenarios</li><li>❌ Inconsistent or unclear naming</li><li>❌ Ignored error handling or retries</li></ul><p>These red flags may seem small, but they hint at <strong>how you’d perform in a real-world engineering role.</strong></p><p><strong>Fix this: </strong>You don’t need to be perfect. You just need to show awareness.</p><p>Say things like:<em>“We should validate user input here to prevent null pointer crashes. For error handling, I’ll use a retry with exponential backoff for external API calls.”</em></p><h3>✅ What Strong Candidates Do Differently?</h3><p>They…</p><ul><li><strong>Start with product thinking</strong> → Who is using this? How?</li><li><strong>Map flows first</strong> → then extract classes</li><li><strong>Explain while designing</strong> → instead of silent sketching</li><li><strong>Think in scenarios</strong> → happy path + edge + scale</li><li><strong>Use patterns &amp; principles</strong> → with purpose and show judgment</li></ul><p>📘 <strong>Want a step-by-step plan to practice LLD in just a week?</strong><br>Don’t miss this blog: <a href="https://medium.com/@shivali0087/how-id-prepare-for-an-lld-interview-in-7-days-if-i-had-to-start-from-scratch-87294ee08ff5">How I’d Prepare for an LLD Interview in 7 Days — If I Had to Start From Scratch</a></p><h3>Final Thoughts</h3><p>LLD rounds are not about remembering class diagrams. They’re about <em>showing you can design real-world systems with clarity and judgment.</em></p><p>Let’s get you interview-ready — <em>without guesswork</em>.</p><h3>💬 Struggling with Behavioral Rounds Too?</h3><p>Even strong engineers get rejected because their stories are vague.<br>Structure &gt; Storytelling &gt; Reflection — that’s the winning formula.</p><p>👉 <a href="https://medium.com/@shivali0087/mastering-behavioral-interview-questions-the-starr-method-to-tell-powerful-stories-and-land-your-a5198e29e076">Read: Mastering Behavioral Interview Questions with the STARR Method</a></p><blockquote>Thank you for reading this blog post. I hope you found it informative.If you have any questions, feedback, or would like to discuss the topic further, please don’t hesitate to reach out. Connect with me on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a>.</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e3d6b52d272" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Average to Outstanding: Real STARR Story Transformations That Get You Hired]]></title>
            <link>https://medium.com/@shivali0087/starr-behavioral-interview-examples-before-after-36a8d7027978?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/36a8d7027978</guid>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 16:11:02 GMT</pubDate>
            <atom:updated>2026-05-11T18:28:19.784Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve got the experience. You’ve done the work. You’ve made an impact.<br>But when it’s time to <em>tell the story</em>, it falls flat. You ramble. You miss the mark.</p><p>If you’ve ever left an interview thinking, <em>“I had a great example… but I didn’t tell it well,”</em> this is for you.</p><p>In this post, I’ll walk you through <strong>real STARR story makeovers</strong> — so you can stop underselling yourself and start standing out.</p><p>Whether you’re prepping for tech, product, consulting, or any role that values leadership and ownership — these story patterns work.</p><p>📌 <em>New to STARR? </em>Start with my <a href="https://medium.com/@shivali0087/mastering-behavioral-interview-questions-the-starr-method-to-tell-powerful-stories-and-land-your-a5198e29e076">step-by-step guide</a> to mastering the method.</p><h3>🔄 Real Example #1: Process Improvement</h3><p>🎯 <strong>Interview Question: </strong>Tell me about a time you improved a process.</p><h4>🟡 Before: The Common Response</h4><blockquote><em>In my last team, onboarding for new members took a while. So I talked to a few folks, and we started documenting some stuff. I also set up a Slack channel. It helped new hires a bit.</em></blockquote><h4>✅ After: The STARR Story Makeover</h4><p><strong>S — Situation:</strong> Our team struggled with onboarding delays. New hires took over 4 weeks to become productive, impacting our delivery goals.</p><p><strong>T — Task:</strong> I was asked to reduce the ramp-up time by identifying and fixing bottlenecks.</p><p><strong>A — Action:</strong> I interviewed recent hires, mapped the process, and identified gaps in documentation and communication. I created a structured onboarding guide, paired new hires with onboarding buddies, and launched a Q&amp;A Slack channel.</p><p><strong>R — Result:</strong> Onboarding time dropped from 4 weeks to 2 weeks, reduced dependency on managers by 40%, and new hires reported increased satisfaction, and the system was later adopted by 3 other teams.</p><p><strong>R — Reflection:</strong> This taught me the power of scalable documentation and peer learning. I now apply the same playbook to every new team I join.</p><p>➡️ The “before” version sounds like a helpful teammate. The “after” sounds like a <strong>future leader</strong>. It shows <strong>impact and clarity.</strong></p><h3>🔄 Real Example #2: Ownership Under Pressure</h3><p>🎯 <strong>Interview Question:</strong> Tell me about a time you took ownership.</p><h4>🟡 Before: The Common Response</h4><blockquote><em>Our app was going down frequently. I took initiative to fix it by looking at the logs and restarting the service. Eventually, we stabilized it.</em></blockquote><h4>✅ After: The STARR Story Makeover</h4><p><strong>S — Situation:</strong> Our mobile app was experiencing critical downtime — 3 outages in 2 weeks — hurting user trust and ratings.</p><p><strong>T — Task:</strong> As the on-call engineer, I was responsible for triaging the issue and proposing a sustainable fix.</p><p><strong>A — Action:</strong> I pulled logs across deployments, worked with infra to identify root causes, and discovered a memory leak triggered by a recent dependency upgrade. I rolled back the version, proposed an alerting dashboard, and documented recovery steps.</p><p><strong>R — Result:</strong> We had zero outages over the next 60 days. Our app rating recovered from 3.8 to 4.3.</p><p><strong>R — Reflection:</strong> I realized real ownership isn’t just about solving the issue — it’s ensuring the team doesn’t face it again.</p><p>➡️ You’re not just patching problems. You’re building <strong>long-term trust</strong>.</p><h3>🔄 Real Example #3: Driving Clarity in Ambiguity</h3><p>🎯 <strong>Interview Question:</strong> Tell me about a time you had to work through an ambiguous situation.</p><h4>🟡 Before: The Common Response</h4><blockquote><em>I was once put on a project where the scope was unclear and there weren’t a lot of details provided. I wasn’t sure where to start, so I just began researching and checking in with a few people. Eventually, we figured it out and delivered the project.</em></blockquote><h4>✅ After: The STARR Story Makeover</h4><p><strong>S — Situation:</strong> I was assigned to lead a new internal dashboard project to improve visibility for senior leadership, but there was no clear owner, defined scope, or existing data pipeline — just a vague goal of “better insights.”</p><p><strong>T — Task:</strong> I had to bring clarity to the project, define what success looked like, and align multiple stakeholders — all while keeping the project moving.</p><p><strong>A — Action:</strong> I scheduled quick interviews with 5 stakeholders to understand their real needs. I synthesized the inputs into a proposed scope, got sign-off from the product lead, and built a working prototype using existing data sources. I also set up weekly demos to reduce uncertainty and gather early feedback.</p><p><strong>R — Result:</strong> The final dashboard launched one week early, was adopted by 3 departments, and became a reference project for cross-team visibility work. Stakeholders appreciated how quickly it went from “fuzzy” idea to real value.</p><p><strong>R — Reflection:</strong> This experience taught me that ambiguity isn’t a blocker — it’s an invitation to lead. Now, I treat unclear situations as opportunities to define direction and drive alignment.</p><h3>✨ Final Thought: You Don’t Need to Be Perfect — You Just Need to Be Prepared</h3><p>Your stories are closer to <em>great</em> than you think — they just need sharpening.<br>You don’t need perfect delivery or fancy words. You need a clear, simple framework to highlight your real impact and build confidence.</p><p>Grab the toolkit. Fix your story. Walk into your next interview ready to impress.</p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><blockquote>Thank you for reading this blog post. Have questions or want to connect? Feel free to reach out on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a> — I’d love to hear from you!</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36a8d7027978" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Behavioral Interview Questions: The STARR Method to Tell Powerful Stories and Land Your…]]></title>
            <link>https://medium.com/@shivali0087/mastering-behavioral-interview-questions-the-starr-method-to-tell-powerful-stories-and-land-your-a5198e29e076?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5198e29e076</guid>
            <category><![CDATA[behavioural]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 05:19:49 GMT</pubDate>
            <atom:updated>2026-05-11T18:27:10.908Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Mastering Behavioral Interview Questions: The STARR Method to Tell Powerful Stories and Land Your Dream Job</strong></h3><p>Behavioral interviews often feel like an enigma wrapped in a riddle. You prepare for hours on coding problems, but when asked to “Tell me about a time you faced a challenge,” suddenly words fail. Why?</p><p>Because behavioral questions aren’t about right or wrong answers — they’re about <em>how</em> you communicate your experiences, demonstrate problem-solving, and show growth.</p><p>From mentoring many software engineers, I’ve seen how mastering <strong>the STARR method</strong> transforms candidates from hesitant storytellers into confident narrators who leave interviewers impressed.</p><p>In this post, I’ll break down the STARR method — a simple but powerful framework to structure your answers — and walk you through practical tips and examples so you can own your next behavioral interview.</p><h3>What Are Behavioral Interviews and Why Do They Matter?</h3><p>Hiring managers ask behavioral questions to predict how you’ll perform based on your past behavior. It’s less about technical prowess and more about:</p><ul><li>Your mindset in solving problems</li><li>How you collaborate with others</li><li>How you handle pressure, setbacks, and feedback</li><li>Your ability to learn and improve</li></ul><p>Common questions include phrases like “Tell me about a time when…” or “Describe how you handled…”</p><p>Understanding their purpose is the first step to answering confidently.</p><h3>The STARR Method: Your Framework for Clear, Impactful Stories</h3><p>STARR stands for:</p><ul><li><strong>S</strong>ituation: Set the stage — What was happening?</li><li><strong>T</strong>ask: What challenge or responsibility did you face?</li><li><strong>A</strong>ction: What steps did you take?</li><li><strong>R</strong>esult: What was the outcome or impact?</li><li><strong>R</strong>eflect: What did you learn or how would you do things differently?</li></ul><p>By following STARR, you turn vague anecdotes into compelling narratives that highlight your skills and self-awareness.</p><h3>Five Key Behavioral Questions You Should Prepare</h3><ol><li>Give an example of when you took on work outside of your comfort zone.</li><li>Give an example of a time when you were not able to meet a commitment.</li><li>Describe a situation when you disagreed with your manager or peer.</li><li>How did you manage a tight deadline?</li><li>Describe a challenging project you led.</li></ol><p>Preparing solid stories for these will cover many behavioral interview scenarios.</p><h3>Sample STARR Answer: Tell Me About a Time You Were Not Able To Meet A Commitment.</h3><ul><li><strong>Situation</strong>: In my role at XYZ Company, I was leading the development of a backend service that was part of a larger feature rollout.</li><li><strong>Task</strong>: I had committed to delivering the service within a 2-week sprint so that the frontend team could integrate and test it in time for the end-of-month release.</li><li><strong>Action</strong>: During development, I encountered unexpected issues with a third-party API that we relied on. It was returning inconsistent data and occasionally timing out. I realized early on that this could delay my progress, so I proactively informed the tech lead and product manager. I kept stakeholders updated with daily progress, proposed fallback solutions, and worked with the external vendor to debug the issue.</li><li><strong>Result</strong>: Despite my efforts, the delays with the third-party API caused the backend service delivery to slip by three days. However, because I had communicated the risks and status transparently throughout, the frontend team was able to adjust their priorities, and the overall project timeline was only minimally impacted.</li><li><strong>Reflect</strong>: This experience taught me the value of early risk identification and clear communication. I now include buffer time in my estimates for external dependencies and make it a point to flag potential blockers early, which has helped me improve delivery accuracy without compromising trust.</li></ul><h3>Pro Tips for Crafting STARR Responses</h3><ol><li><strong>Pick Impactful Stories</strong> — Choose examples that show ownership, adaptability, or leadership — not just task completion.</li><li><strong>Be Specific</strong> — Mention timelines, tools, stakeholders, and measurable results. Avoid vague or generic tasks.</li><li><strong>Focus on <em>You</em></strong> — Even if it was a team project, highlight <em>your</em> role, what <em>you</em> did and the decisions you made.</li><li><strong>End with Growth</strong> — Tie it back to how you’ve grown since. Reflect on what you learned or how you’ve improved. This shows self-awareness and growth mindset.</li></ol><h3>Final Thought</h3><p>Mastering behavioral interviews isn’t about having perfect stories — it’s about showing you’ve grown from real ones.</p><p>Use STARR to stand out. Reflect to rise above.</p><p>Your future team is listening.</p><p>🔁 <strong>Related Read : </strong><a href="https://medium.com/@shivali0087/starr-behavioral-interview-examples-before-after-36a8d7027978"><strong>Real STARR Story Transformations</strong></a></p><p><em>💡 </em><strong><em>Pro Tip:</em></strong><em> </em><strong><em>I’m working on an AI behavioral coach powered by insights from thousands of real interviews I’ve conducted as an interviewer and bar raiser.</em></strong><em> <br> </em><strong><em>👉 </em></strong><a href="https://forms.gle/XecnjWFiiTmfMgrC8"><strong><em>Sign up here</em></strong></a><em> to be among the first to access it and sharpen your behavioral skills!</em></p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><h3>🧠 Also Preparing for LLD Interviews?</h3><p>Mastering behavioral interviews is just one part of the puzzle. For many tech roles <strong>Low-Level Design (LLD)</strong> rounds can be the real deal-breaker.</p><p>If you’ve ever felt stuck when asked to “design a food delivery system” or worried about what interviewers actually want to hear…</p><p>👉 <strong>Check out this companion article</strong>:<br> <a href="https://medium.com/@shivali0087/how-to-actually-crack-lld-interviews-not-just-draw-boxes-and-arrows-1e3d6b52d272"><strong>How to Actually Crack LLD Interviews — Not Just Draw Boxes and Arrows</strong></a><br> It breaks down the top 4 mistakes people make — and how to fix them with clarity, trade-offs, and real-world thinking.</p><blockquote>Thank you for reading this blog post. I hope you found it informative. If you have any questions, feedback, or would like to discuss the topic further, please don’t hesitate to reach out. Connect with me on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a>.</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5198e29e076" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns Unveiled: A Wizard’s Guide to Crafting Magical Code]]></title>
            <link>https://medium.com/@shivali0087/design-patterns-unveiled-a-wizards-guide-to-crafting-magical-code-eda8675f8e0c?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/eda8675f8e0c</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[harry-potter]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 17:12:28 GMT</pubDate>
            <atom:updated>2026-05-11T18:28:32.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*WLo-D0VaqfOucq6TxToATw.png" /></figure><p>Welcome to a captivating journey that brings the enchanting world of Harry Potter into the realm of software development. Just as aspiring witches and wizards study their magical craft at Hogwarts School of Witchcraft and Wizardry, software developers embark on a quest to master the art of writing efficient, maintainable, and scalable code through a set of guiding principles known as design patterns.</p><p>In this blog, we’ll merge the mystical and the technical to offer a unique and entertaining perspective on learning design patterns. By drawing parallels with the magical universe created by J.K. Rowling, we’ll make the world of software design both relatable and engaging.</p><p>Whether you’re a coding novice or a seasoned developer seeking fresh insights, this blog will provide you with a magical perspective on design patterns. As we journey through this wizarding world of software development, you’ll discover how these patterns are not just tools but also powerful spells that can transform your code and elevate your programming skills.</p><p>So, grab your metaphorical wands (coding editors) and prepare to dive into the world where the spells of code meet the enchantments of Harry Potter. Together, we’ll unlock the secrets of design patterns while reliving the wonder and excitement of the magical adventures that have captured the hearts of millions around the world.</p><h3>Broad categories</h3><p>In the context of software engineering, design patterns can be grouped into broad categories such that each serves a unique purpose, much like the different branches of magic in the world of Harry Potter. These categories bear a resemblance to the magical disciplines that young witches and wizards at Hogwarts learn to harness.</p><p>First, we have <strong>Creational Patterns</strong>, these are like the spells in Harry Potter that create magical objects or creatures. Creational Patterns provide mechanisms for creating objects in a way that’s flexible, efficient, and in some cases, even magical. Think of these patterns as the wizards’ toolkit for crafting new entities.</p><p>Next, we delve into <strong>Structural Patterns</strong>, which are like enchantments that transform or modify existing objects. These patterns help organize and shape the relationships between classes and objects, akin to the architectural framework that holds Hogwarts Castle together.</p><p>Finally, there are <strong>Behavioral Patterns</strong>, which guide how objects interact and communicate with one another, much like the way wizards and magical creatures interact within the wizarding world. Behavioral Patterns define the interactions and responsibilities between objects, promoting a harmonious and efficient system.</p><p>Just as a well-rounded wizard in the Harry Potter universe excels in a variety of magical disciplines, a skilled software engineer should be proficient in understanding and applying these different design pattern categories. By doing so, they can harness the power of design patterns to create software solutions that are not only functional but also elegant and maintainable.</p><h3><strong>Creational Patterns: Crafting Magical Entities</strong></h3><p>In the world of Harry Potter, creating magical entities, such as wands, potions, and even creatures, requires specific knowledge and techniques. Creational design patterns are akin to these magical crafting methods. They focus on how objects are created, ensuring that the right object is summoned for a particular purpose.</p><h4><strong><em>1. Singleton Pattern: The Elder Wand</em></strong></h4><p>Just as the Elder Wand is the one true wand that can conquer all, the Singleton pattern ensures there’s only one instance of a class, making it the exclusive and globally accessible instance. Just as there’s only one Elder Wand in existence, the Singleton pattern enforces that there’s only one instance of a particular class. This is particularly useful in scenarios where exactly one object is needed to coordinate actions across the system, such as a database connection pool, a configuration manager, or a logging service.</p><h4><strong><em>2. Factory Pattern: Ollivander&#39;s Wand Shop</em></strong></h4><p>Ollivander’s Wand Shop, where wands are crafted for specific wizards, resembles the Factory pattern. It abstracts the creation process, allowing the selection of the appropriate wand based on certain criteria. In software development, the Factory Pattern operates similarly. The client code requests objects through a factory method without knowing the exact class or details of the object creation. The factory (like Mr. Ollivander) takes care of creating the appropriate objects based on the client’s request. This separation of concerns makes code more flexible and maintainable, just as Mr. Ollivander’s expertise ensures you get the right wand without worrying about the details of wand crafting.</p><h4><strong><em>3. Abstract Factory Pattern: Potion Brewing</em></strong></h4><p>The complex art of brewing potions in the wizarding world reflects the intricate nature of the Abstract Factory pattern. In potion-making, you need various ingredients that work together to create a specific potion. You don’t necessarily know the exact source or details of each ingredient. You just need them to be compatible and produce the desired result. In software development, the Abstract Factory Pattern operates similarly. The client code requests objects from an abstract factory, and the factory ensures that the created objects are compatible and part of the same family, simplifying the process of creating complex, interrelated object structures.</p><h4><strong><em>4. Builder Pattern: Crafting Customized Wands</em></strong></h4><p>In the magical world of Harry Potter, wands are not just ordinary tools; they are personalized instruments of immense power. Wizards and witches carefully select the core, wood type, length, and other features to create wands that suit their unique needs and abilities. Similarly, in software development, the Builder pattern allows developers to construct complex objects with customized configurations. It allows you to create an object step by step and gives you fine-grained control over its construction process.</p><h3><strong>Structural Patterns: Building Magical Structures</strong></h3><p>Structural design patterns are like constructing magical structures, such as castles, bridges, and enchanted objects. These patterns deal with organizing and composing objects to form larger, more complex structures.</p><h4><strong><em>1. Adapter Pattern: Animagus Transformations</em></strong></h4><p>In the wizarding world of Harry Potter, we can draw an analogy to Animagi. Animagi are witches and wizards who have the rare ability to transform themselves into animals. When they do this, they essentially adapt their human interface (wizard) to the interface of an animal, allowing them to communicate and interact with other animals. Similarly, the Adapter Pattern allows the interface of one class to be used as if it were another class. It allows objects with incompatible interfaces to work together seamlessly.</p><h4><strong><em>2. Decorator Pattern: Enchanting Items</em></strong></h4><p>Enchanting items to add or modify their magical properties is analogous to the Decorator pattern in software development. In the wizarding world, enchantments dynamically enhance the properties of objects without fundamentally altering their core nature. Similarly, the Decorator pattern dynamically adds new features or behaviors to objects without changing their core structure.</p><h4><strong><em>3. Composite Pattern: Magical Families</em></strong></h4><p>Families in the wizarding world are a diverse collection of individuals, each with their own unique abilities and characteristics. This diversity can be compared to the Composite pattern, which allows you to compose objects into tree structures to represent part-whole hierarchies. Composite pattern combines objects to create more complex structures.</p><h4><strong>4. Bridge Pattern: Spell Casting and Wands</strong></h4><p>In the wizarding world of Harry Potter, witches and wizards cast spells using wands. Each wand has unique properties and materials, but they all share the common purpose of channeling magic to cast spells. The Bridge Pattern can be likened to the relationship between the act of spell casting and the various types of wands. It decouples abstractions from implementations, providing flexibility and independence.</p><h3><strong>Behavioral Patterns: Enchanting Object Interactions</strong></h3><p>In the magical world, spells and charms dictate how objects and creatures interact. Behavioral design patterns are like these enchantments, defining how objects collaborate and communicate with one another.</p><h4><strong>1. Observer Pattern: Daily Prophet</strong></h4><p>The observer<strong> </strong>pattern resembles how the Daily Prophet newspaper in the wizarding world delivers news and updates to its readers. The newspaper serves as the subject, and readers who subscribe to it are the observers. When a new story is published, the newspaper notifies its subscribers, and they receive the latest news. The observer pattern defines a one-to-many dependency between objects, where one object (the subject) maintains a list of its dependents (observers) and notifies them of any state changes.</p><h4><strong>2. Strategy Pattern: Spell Selection</strong></h4><p>In the wizarding world, the selection of spells is crucial, as different situations demand different magical effects. The Strategy pattern in software development shares this concept, defines a family of algorithms, encapsulates each one, and makes them interchangeable. Just as wizards select different spells for different situations, the Strategy pattern allows clients to choose the appropriate algorithm at runtime.</p><h4><strong>3. Command Pattern: Casting Spells</strong></h4><p>Casting spells in the wizarding world involves specifying what needs to be done, much like issuing commands. The Command pattern in software development encapsulates a request as an object, allowing for parameterization of clients with requests. It’s as if wizards cast spells by creating magical scrolls, each containing the command needed to perform a specific action.</p><h4><strong>4. Chain of Responsibility Pattern: Wizarding Authority Chain</strong></h4><p>The Chain of Responsibility Pattern passes a request along a chain of handlers. Each handler decides whether to process the request or pass it on to the next handler in the chain. It provides a way to handle requests without specifying their concrete handlers. In the Ministry of Magic, there might be a chain of approval for certain magical requests. For instance, a request to use a powerful spell could pass through various levels of approval, starting with the Auror Office and moving up to the Minister of Magic. The chain continues until the request is either granted or denied by the appropriate authority.</p><h3><strong>Summary</strong></h3><p>In the magical world of software design, we’ve explored a variety of design patterns, each with its own unique charm. Much like the wizarding world’s ability to achieve extraordinary feats with magic, these design patterns empower software developers to create robust and maintainable code. As Albus Dumbledore once wisely said, ‘<strong><em>It is our choices, Harry, that show what we truly are, far more than our abilities</em></strong><em>.</em>’ Similarly, the choice to apply these design patterns can transform code into truly magical creations.</p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><blockquote>Thank you for reading this blog post. I hope you found it fun and informative. 🎯 If you have any questions, feedback, or would like to discuss the topic further, please don’t hesitate to reach out. Connect with me on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a>. See my other blog on <a href="https://medium.com/@shivali0087/mastering-behavioral-interview-questions-the-starr-method-to-tell-powerful-stories-and-land-your-a5198e29e076">mastering behavioral interviews</a> too.</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eda8675f8e0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revamping Your Code: Masterful Techniques for Effective Code Refactoring]]></title>
            <link>https://medium.com/@shivali0087/revamping-your-code-masterful-techniques-for-effective-code-refactoring-3d60550bffdf?source=rss-3a11bc43167------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d60550bffdf</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Shivali]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 07:36:39 GMT</pubDate>
            <atom:updated>2026-05-11T18:28:46.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56Eea7G-79KCg_-oj9XZ_g.png" /></figure><p><em>“Enhance code quality, reduce technical debt, and boost software reliability with essential code refactoring techniques.”</em></p><p>In the dynamic world of software development, change is the only constant. As projects evolve and requirements shift, it’s easy for codebases to become tangled, complex, and hard to maintain. That’s where the art of code refactoring comes into play.</p><p>Code refactoring is like giving your code a makeover — it’s about making it cleaner, simpler, more efficient, and easier to understand, all without altering its functionality. It’s not just a helpful skill. It’s a mindset that distinguishes exceptional developers.</p><p>In this blog, I’ll take you on a journey into the world of code refactoring. Whether you’re a seasoned developer looking to optimize your code or a novice eager to learn, this exploration of code refactoring will equip you with the knowledge and techniques to transform your code into a work of art. So, let’s embark on this exciting journey and discover the power of code refactoring.</p><h3>Clean code</h3><blockquote>“In the world of software development, refactoring stands as a crucial practice, and at its core lies the pursuit of clean code.”</blockquote><p>But what exactly is ‘<strong>clean code’</strong>? Let’s dive into some of its defining characteristics:</p><ul><li>Clean code is easy to understand, with clear and descriptive variable and method names, consistent formatting, and a well-organized structure.</li><li>Clean code is efficient and optimized, avoiding redundancy and resource waste.</li><li>Clean code minimizes dependencies, reduces the risk of errors, and simplifies maintenance.</li><li>Clean code typically has comprehensive test coverage to ensure its reliability and correctness.</li><li>Clean code is designed with scalability in mind, allowing for growth and expansion without major overhauls.</li></ul><p>In essence, clean code simplifies the development process, enhances collaboration among programmers, reduces the risk of errors, and ultimately saves time and resources during maintenance.</p><h3>Code Smells</h3><blockquote>What? How can code “smell”??</blockquote><blockquote>When your code is so bad, even a nose can tell!</blockquote><p>Code smells serve as warning signs of potential issues that can be resolved through refactoring. While code smells are readily identifiable and correctable, they might also signal underlying, more significant problems within the code.</p><p><strong>1. Code Swellings</strong>: These are methods or classes that grow excessively over time, making them difficult to manage. Examples include long methods (typically more than 10 lines), large classes (with many variables and methods), and lengthy parameter lists (over four parameters).</p><p><strong>2. Object-Oriented Misuse:</strong> These issues arise from improper application of object-oriented principles, such as complex and nested sequences of `if` statements or different classes performing the same functions with different method names.</p><p><strong>3. Change Hindrances:</strong> These smells indicate that a change in one part of the code necessitates multiple modifications in other areas, complicating and increasing development costs. For instance, adding a new room type in a hotel management system may require altering unrelated methods for finding, displaying, and booking rooms.</p><p><strong>4. Unnecessary code:</strong> These are unnecessary code elements, like duplicate or dead code, whose removal improves code cleanliness and effectiveness.</p><p><strong>5. Couplers:</strong> All the smells in this category either encourage excessive coupling between classes or demonstrate what happens when excessive delegation takes the place of coupling. Example: If a class only performs one action, assigning work to another class, why does it even exist in the first place? Additionally, when a method accesses another object’s data more often than its own, it signifies excessive coupling.</p><h3>Refactoring Techniques</h3><p>Having examined code smells, let’s now explore the world of refactoring techniques. Refactoring techniques are like a craftsman’s toolkit for developers, enabling them to reshape and refine code.</p><p><strong>1. Simplifying method calls</strong></p><p><strong>Extract Method:</strong> If a section of code within a method performs a specific task or calculation, you can extract it into a separate method with a meaningful name. This simplifies the main method by abstracting away the details of that specific task.</p><p><strong>Before Refactoring:</strong></p><pre>public double calculateAverage(int a, int b, int c) { <br> int sum = a + b + c; <br> double result = sum / 3.0; <br> return result;<br>}</pre><p><strong>After Refactoring:</strong></p><pre>public double calculateAverage(int a, int b, int c) {<br> return sum(a, b, c) / 3.0;<br>}<br>public int sum(int a, int b, int c) {<br> return a + b + c;<br>}</pre><p><strong>Inline Method:</strong> Conversely, if a method call doesn’t add much clarity and is only used once, you can choose to inline it directly into the calling code. This is done to eliminate the need for an extra method.</p><p><strong>Before Refactoring:</strong></p><pre>public int add(int a, int b) {<br> return calculateSum(a, b);<br>}<br>private int calculateSum(int a, int b) {<br> return a + b;<br>}</pre><p><strong>After Refactoring:</strong></p><pre>public int add(int a, int b) {<br> return a + b;<br>}</pre><p><strong>2. Simplifying conditional expressions</strong></p><p>This involves combining several conditionals that lead to the same result into a single expression and eliminating duplicate and overlapping code snippets by moving them outside the conditions. This also involves replacing conditional logic with polymorphic behavior.</p><p><strong>Before Refactoring:</strong></p><pre>class Employee {   <br>    double getPaymentAmount() {  <br>        if (isManager) {  <br>            return salary + bonus; <br>        } else {    <br>            return salary;    <br>        }    <br>    }<br>}</pre><p><strong>After Refactoring:</strong></p><pre>interface Payment {<br>    double getPaymentAmount();<br>} <br><br>class ManagerPayment implements Payment {<br>    double getPaymentAmount() {   <br>        return salary + bonus;<br>    }  <br>}    <br><br>class EmployeePayment implements Payment {<br>    double getPaymentAmount()   <br>        return salary;<br>    }   <br>}</pre><p><strong>3. Extract Method Object</strong></p><p>This technique is used to improve code organization, readability, and maintainability by grouping related functionality together and adhering to the Single Responsibility Principle.</p><p><strong>Before Refactoring:</strong></p><pre>@AllArgsConstructor<br>public class Order {<br>    private List&lt;LineItem&gt; lineItems;<br><br>    public double calculateTotalPrice() {<br>        double total = 0;<br>        for (LineItem item : lineItems) {<br>            total += item.getPrice(); <br>        }<br>        return total; <br>    }<br>}<br>    <br>@Getter<br>@AllArgsConstructor<br>public class LineItem {  <br>   private String name;   <br>   private double price;  <br>}<br>    <br>public class Main {<br>    public static void main(String[] args) {<br>       LineItem item1 = new LineItem(&quot;Item 1&quot;, 10);<br>       LineItem item2 = new LineItem(&quot;Item 2&quot;, 20)<br>       List&lt;LineItem&gt; items = Arrays.asList(item1, item2);<br>       Order order = new Order(&quot;John Doe&quot;, items);<br>       order.calculateTotalPrice();   <br>    }<br>}</pre><p><strong>After Refactoring:</strong></p><pre>@Getter<br>@AllArgsConstructor<br>public class Order {<br>    private List&lt;LineItem&gt; lineItems;<br><br>    public double calculateTotalPrice() {<br>        return new OrderCalculator(lineItems).calculateTotalPrice();<br>    }<br>}<br><br>@AllArgsConstructor<br>public class OrderCalculator {<br>    private Order order;<br><br>    public double calculateTotalPrice() {<br>        double total = 0;<br>        for (LineItem item : order.getLineItems()) {<br>            total += item.getPrice();<br>        }<br>        return total;<br>    }<br>}<br>    <br>@Getter<br>@AllArgsConstructor<br>public class LineItem {  <br>   private String name;   <br>   private double price;  <br>}<br>    <br>public class Main {<br>    public static void main(String[] args) {<br>        LineItem item1 = new LineItem(&quot;Item 1&quot;, 10);<br>        LineItem item2 = new LineItem(&quot;Item 2&quot;, 20)<br>        List&lt;LineItem&gt; items = Arrays.asList(item1, item2);<br>        Order order = new Order(&quot;John Doe&quot;, items);<br>        order.calculateTotalPrice();   <br>    }<br>}</pre><p>In this refactoring, the <em>`OrderCalculator`</em> class is introduced to encapsulate the logic for calculating the total price of an order. This separation of concerns enhances code organization and adheres to the principle of single responsibility, making the code more maintainable and extensible. The<em> `Order`</em> class delegated the total price calculation to the <em>`OrderCalculator`.</em></p><p><strong>4. Organizing Data</strong></p><p>This involves restructuring and optimizing the way data is stored, accessed, and managed within a codebase.</p><p><strong>Before Refactoring:</strong></p><pre>class Order {<br>    private String customerName;<br>    private String customerAddress;<br>    private String customerCity;<br>    private String customerState;<br>    private String customerZip;<br><br>    public Order(String customerName, String customerAddress, String customerCity, String customerState, String customerZip) {<br>        this.customerName = customerName;<br>        this.customerAddress = customerAddress;<br>        this.customerCity = customerCity;<br>        this.customerState = customerState;<br>        this.customerZip = customerZip;<br>    }<br><br>    // Other methods related to the Order...<br>}</pre><p><strong>After Refactoring:</strong></p><pre>class Customer {<br>    private String name;<br>    private Address address;<br><br>    public Customer(String name, String street, String city, String state, String zip) {<br>        this.name = name;<br>        this.address = new Address(street, city, state, zip);<br>    }<br><br>    public String getName() {<br>        return name;<br>    }<br><br>    public Address getAddress() {<br>        return address;<br>    }<br>}<br><br>class Address {<br>    private String street;<br>    private String city;<br>    private String state;<br>    private String zip;<br><br>    public Address(String street, String city, String state, String zip) {<br>        this.street = street;<br>        this.city = city;<br>        this.state = state;<br>        this.zip = zip;<br>    }<br><br>    public String getStreet() {<br>        return street;<br>    }<br><br>    public String getCity() {<br>        return city;<br>    }<br><br>    public String getState() {<br>        return state;<br>    }<br><br>    public String getZip() {<br>        return zip;<br>    }<br>}<br><br>class Order {<br>    private Customer customer;<br><br>    public Order(Customer customer) {<br>        this.customer = customer;<br>    }<br><br>    public Customer getCustomer() {<br>        return customer;<br>    }<br><br>    // Other methods related to the Order...<br>}</pre><p>In this refactoring example, the code is improved by replacing the separate data fields for customer information in the <strong><em>Order</em></strong> class with a more organized and encapsulated <strong><em>Customer</em></strong> class and an <strong><em>Address</em></strong> class. This not only enhances code readability but also adheres to the principles of encapsulation and data organization. It makes it easier to manage customer data and reduces code duplication if customer information needs to be accessed or modified in multiple places.</p><p><strong>5. Dealing with Generalization</strong></p><p>This refactoring technique involves optimizing the inheritance hierarchy in object-oriented code. It includes actions such as “Pull Up Method,” “Push Down Method,” and “Extract Interface/Abstract Class.”</p><p><strong>Pull-Up Method or Field</strong>: This involves moving a method or field up the inheritance hierarchy from subclasses to a common superclass to promote code reusability.</p><p><strong>Push Down Method/Field:</strong> This is the opposite of “Pull Up.” It involves moving a method or field down from a superclass to one or more of its subclasses when the method or field is specific to certain subclasses.</p><p><strong>Extract Interface/Abstract Class:</strong> This technique involves creating an interface or abstract class to define a common set of methods and fields that multiple classes can implement or extend, respectively.</p><p><strong>Before Refactoring:</strong></p><pre>@AllArgsConstructor<br>class Employee {<br>    protected String name;<br>    protected double salary;<br>    protected String department;<br><br>    double calculateSalary() {<br>        return salary;<br>    }<br>}<br><br>class Manager extends Employee {<br><br>    public Manager(String name, double salary, String department) {<br>        super(name, salary, department);<br>    }<br><br>    // Specific salary calculation for Manager<br>    double calculateManagerSalary() {<br>        return salary * 1.2; // Example: 20% bonus for managers<br>    }<br>}</pre><p><strong>After Refactoring:</strong></p><pre>interface Payable {<br>    double calculateSalary();<br>}<br><br>@AllArgsConstructor<br>class Employee implements Payable {<br>    protected String name;<br>    protected double salary;<br>    protected String department;<br><br>    pubic double calculateSalary() {<br>        return salary;<br>    }<br>}<br><br>class Manager extends Employee {<br><br>    public Manager(String name, double salary, String department) {<br>        super(name, salary, department);<br>    }<br><br>    @Override<br>    public double calculateSalary() {<br>        return super.calculateSalary() * 1.2; // Example: 20% bonus for managers<br>    }<br>}</pre><p>In this refactoring, we’ve extracted a Payable interface with the <strong><em>calculateSalary</em></strong> method, and both Employee and Manager classes now implement this interface using the “Extract Interface/Abstract Class” technique. We’ve applied the “Pull Up Method” refactoring to the <strong><em>calculateSalary</em></strong> method, moving it from the <strong><em>Manager</em></strong> class up to the Employee class. Now, both <strong><em>Employee</em></strong> and <strong><em>Manager</em></strong> share the same method signature for salary calculation, promoting code reusability and consistency.</p><h3>Conclusion</h3><p>By implementing the above code refactoring techniques, you’ll elevate your code quality, reduce technical debt, and become a more proficient software engineer. By making code refactoring a continuous process, you can ensure long-term project success and increased team satisfaction. So, embark on this journey of code improvement, and watch your codebase evolve into a masterpiece of clean, maintainable software. Happy coding!</p><p><em>📬 I write weekly about system design, LLD, and behavioral interviews — from the other side of the table. Get it in your inbox: </em><a href="https://shivalimaheshwari.substack.com/"><em>Subscribe on Substack</em></a></p><blockquote>Thank you for reading this blog post. I hope you found it insightful and informative. If you have any questions, feedback, or would like to discuss the topic further, please don’t hesitate to reach out. Connect with me on <a href="https://www.linkedin.com/in/shivali-maheshwari-5812b711b/">LinkedIn</a>.</blockquote><blockquote>Shivali Maheshwari</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d60550bffdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>