<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arslan Ahmad</title>
    <description>The latest articles on DEV Community by Arslan Ahmad (@arslan_ah).</description>
    <link>https://dev.to/arslan_ah</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F34147%2F2974e0a5-f688-45b5-a4c9-5fa49c257854.jpg</url>
      <title>DEV Community: Arslan Ahmad</title>
      <link>https://dev.to/arslan_ah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arslan_ah"/>
    <language>en</language>
    <item>
      <title>The 9 Things Engineers Get Wrong About the System Design Interview (and the 185 Articles I Wrote to Fix Them)</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Mon, 13 Apr 2026 08:38:14 +0000</pubDate>
      <link>https://dev.to/arslan_ah/the-9-things-engineers-get-wrong-about-the-system-design-interview-and-the-185-articles-i-wrote-to-22p1</link>
      <guid>https://dev.to/arslan_ah/the-9-things-engineers-get-wrong-about-the-system-design-interview-and-the-185-articles-i-wrote-to-22p1</guid>
      <description>&lt;p&gt;Every time I sit down to run a system design mock interview, the candidate fails for one of nine reasons.&lt;/p&gt;

&lt;p&gt;Not ten. Not seven. Nine.&lt;/p&gt;

&lt;p&gt;I've been doing this long enough — coaching engineers, running mocks, swapping debrief notes with hiring managers at Google, Meta, Amazon, Netflix, Microsoft, OpenAI, and a long tail of smaller companies — that the patterns have stopped surprising me. The same nine misconceptions show up in candidate after candidate, regardless of seniority. A junior at a startup makes the same mistakes as a staff engineer at a unicorn. Not the same magnitude, but the same shape.&lt;/p&gt;

&lt;p&gt;Over the years, I've written 185+ articles on DesignGurus.io and DEV Community trying to address these exact failure modes one at a time. This essay pulls all of them together, organized not by topic — that's the way I usually shelf them — but by the misconception each one actually exists to correct.&lt;/p&gt;

&lt;p&gt;If you're prepping for a &lt;strong&gt;system design interview&lt;/strong&gt; right now, this is the order I'd hand the articles to you in. Read each section. Ask yourself honestly whether the misconception applies to you. &lt;em&gt;Only then&lt;/em&gt; click into the posts. The goal isn't to read all 185. The goal is to read the ones that fix what's actually broken in your prep.&lt;/p&gt;

&lt;p&gt;One quick note on audience. I write for engineers from junior all the way up through staff, plus engineering managers. Almost every misconception below applies across the board, but where a particular section skews toward one group, I'll say so. Engineering managers especially: don't skip Section 9. The gap between EMs who pass design loops and EMs who don't is almost never about technical depth.&lt;/p&gt;

&lt;p&gt;Alright. Here are the nine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Misconception #1: "It's a memorization test."
&lt;/h2&gt;

&lt;p&gt;This is the most common one, and the most expensive.&lt;/p&gt;

&lt;p&gt;Engineers walk in thinking the system design interview is a quiz: name three load balancing algorithms, define CAP theorem, list the four Vs of big data. They study it the way you'd study for a vocabulary test. Then they walk into the room, the interviewer says "design Twitter," and they freeze — because flash cards don't tell you how to start.&lt;/p&gt;

&lt;p&gt;The system design interview is not a quiz. It's a structured conversation that tests whether you can reason about ambiguity, gather requirements, make trade-offs out loud, and defend your decisions when challenged. The vocabulary matters — you can't have the conversation without the words — but the vocabulary is the floor, not the ceiling. What you actually need first is a &lt;em&gt;method&lt;/em&gt;. A repeatable approach you can fall back on when your brain goes blank.&lt;/p&gt;

&lt;p&gt;These are the articles that give you one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-system-design-a-complete-roadmap-2026" rel="noopener noreferrer"&gt;Grokking System Design: A Complete Roadmap for 2026&lt;/a&gt; — If I could hand you a single starting point, this would be it.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/complete-system-design-roadmap-2025" rel="noopener noreferrer"&gt;2025 System Design Roadmap: From Beginner to Advanced&lt;/a&gt; — A second pass at the roadmap if you want a different angle on the same path.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-prepare-for-system-design-interview-2026" rel="noopener noreferrer"&gt;How to Prepare for System Design Interview in 2026&lt;/a&gt; — Concrete weekly cadence for engineers who don't know what "study" even looks like for this round.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-approach-system-design-question" rel="noopener noreferrer"&gt;How to Approach Any System Design Question&lt;/a&gt; — A universal opening framework that works on whatever prompt the interviewer lobs at you.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/your-seven-day-system-design-interview-prep-plan" rel="noopener noreferrer"&gt;Your 7-Day System Design Interview Prep Plan&lt;/a&gt; — For when your loop is one week away and panic is setting in.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/last-minute-system-design-prep-what-to-focus-on-right-now" rel="noopener noreferrer"&gt;Last-Minute System Design Prep&lt;/a&gt; — For when your loop is tomorrow morning.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-gather-requirements-in-system-design-interviews" rel="noopener noreferrer"&gt;How to Gather and Prioritize Requirements&lt;/a&gt; — The first five minutes of the interview, broken down so you don't waste them.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/complete-guide-sys-design" rel="noopener noreferrer"&gt;System Design Interview Prep Guide: 7 Steps&lt;/a&gt; — A clean seven-step framework for going from zero to ready.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/step-by-step-guide" rel="noopener noreferrer"&gt;System Design Interview Guide — 7 Steps to Ace It&lt;/a&gt; — The same seven steps, but mapped to what you do live in the room.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/system-design-interviews-a-step-by-step-guide-39am"&gt;System Design Interviews: A Step-By-Step Guide&lt;/a&gt; — My Dev Community version of the same step-by-step framework.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-the-system-design-interview-complete-guide" rel="noopener noreferrer"&gt;Mastering the System Design Interview: A Complete Guide&lt;/a&gt; — A long-form guide for engineers who want one canonical reference.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-the-system-design-interview-landing-your-dream-job" rel="noopener noreferrer"&gt;Mastering the System Design Interview: Landing Your Dream Job&lt;/a&gt; — The companion piece focused on converting prep into outcomes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-mastery-your-roadmap-to-acing-interviews" rel="noopener noreferrer"&gt;System Design Mastery: Your Roadmap to Acing Interviews&lt;/a&gt; — A more advanced roadmap aimed at senior+ candidates.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-guide" rel="noopener noreferrer"&gt;Demystifying System Design Interviews&lt;/a&gt; — What's actually happening on the interviewer's side of the table.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/a-comprehensive-breakdown-of-systems-design-interviews" rel="noopener noreferrer"&gt;A Comprehensive Breakdown of Systems Design Interviews&lt;/a&gt; — The hidden rubric you're being graded on, made explicit.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-clear-system-design-interview" rel="noopener noreferrer"&gt;How To Clear System Design Interview: A Quick Guide&lt;/a&gt; — A ruthlessly compressed checklist for passing the round.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/sys-design-distinguishes" rel="noopener noreferrer"&gt;7 Tips to Stand Out in Your System Design Interview&lt;/a&gt; — How "pass" candidates become "strong hire" candidates.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-candidates-passed-faang-system-design-interviews" rel="noopener noreferrer"&gt;How 4 Candidates Passed FAANG System Design Interviews&lt;/a&gt; — Four real stories that will calm you down if you're spiraling.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #2: "I know what consistency means."
&lt;/h2&gt;

&lt;p&gt;You probably don't.&lt;/p&gt;

&lt;p&gt;Or — more precisely — you know the textbook definition but you can't actually distinguish strong from eventual consistency in a real design conversation, you can't explain when each is appropriate, and you'll mumble something about CAP theorem if you get pushed on it. I've seen this in candidates with eight years of experience.&lt;/p&gt;

&lt;p&gt;The fundamentals are called fundamentals because everything else stacks on top of them. If you can't speak fluently about consistency, caching, load balancing, hashing, rate limiting, idempotency, and back-of-the-envelope estimation, the rest of your prep is a house built on sand. This is the section to go deepest on, even if you think you already know this stuff. &lt;em&gt;Especially&lt;/em&gt; if you think you already know this stuff.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-fundamentals" rel="noopener noreferrer"&gt;25 Fundamental System Design Concepts&lt;/a&gt; — The twenty-five-concept checklist I run through to gauge readiness.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/4-basic-pillars-of-system-design" rel="noopener noreferrer"&gt;4 Basic Pillars of System Design&lt;/a&gt; — Scalability, availability, reliability, performance — the four qualities you're scored on.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-algorithms" rel="noopener noreferrer"&gt;12 System Design Algorithms You Must Know&lt;/a&gt; — The dozen algorithms quietly powering most distributed systems.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/eventual-vs-strong-consistency" rel="noopener noreferrer"&gt;Eventual vs Strong Consistency&lt;/a&gt; — How to talk about consistency without sliding into academic jargon.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/consistency-patterns-distributed-systems" rel="noopener noreferrer"&gt;Consistency Patterns in Distributed Systems&lt;/a&gt; — A tour of the major consistency models and the situations each is built for.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-basics-cap-vs-pacelc" rel="noopener noreferrer"&gt;CAP vs PACELC&lt;/a&gt; — Why senior interviewers have quietly upgraded from CAP to PACELC.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/load-balancing-algorithms-guide" rel="noopener noreferrer"&gt;Load Balancing Algorithms Guide&lt;/a&gt; — The algorithms living inside every load balancer, explained without theory bloat.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/complete-load-balancing-guide" rel="noopener noreferrer"&gt;Complete Load Balancer Guide 2026&lt;/a&gt; — The 2026 deep dive on load balancers in real production deployments.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/caching-system-design-interview" rel="noopener noreferrer"&gt;Mastering the Art of Caching&lt;/a&gt; — Cache layers, eviction strategies, and the pitfalls nobody warns juniors about.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/cache-invalidation-strategies" rel="noopener noreferrer"&gt;Cache Invalidation Strategies&lt;/a&gt; — The hardest problem in computer science, finally given a serious treatment.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/content-delivery-network-cdn-system-design-basics" rel="noopener noreferrer"&gt;CDN System Design Basics&lt;/a&gt; — When a CDN earns its place in your diagram and when it's just resume garnish.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/consistent-hashing-vs-traditional-hashing" rel="noopener noreferrer"&gt;Consistent Hashing vs Traditional Hashing&lt;/a&gt; — The hashing technique that quietly makes horizontal sharding even possible.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-rate-limiters" rel="noopener noreferrer"&gt;Grokking Rate Limiters&lt;/a&gt; — Token buckets, leaky buckets, and how to actually implement one on a whiteboard.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-webhooks" rel="noopener noreferrer"&gt;Grokking Webhooks&lt;/a&gt; — Why webhooks beat polling and how to design them so they don't blow up.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-system-design-events" rel="noopener noreferrer"&gt;Grokking Events in System Design&lt;/a&gt; — What the word "event" really means once you're inside an event-driven architecture.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-idempotency" rel="noopener noreferrer"&gt;Grokking Idempotency&lt;/a&gt; — The single key concept that keeps distributed systems from corrupting themselves.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/concurrency-vs-parallelism" rel="noopener noreferrer"&gt;Concurrency vs Parallelism&lt;/a&gt; — A distinction that more than half my mock candidates get wrong on the first try.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/sync-vs-async" rel="noopener noreferrer"&gt;Synchronous vs Asynchronous Communication&lt;/a&gt; — The hidden operational cost of going async, and when you should pay it anyway.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/stateless-vs-stateful" rel="noopener noreferrer"&gt;Stateless vs Stateful&lt;/a&gt; — The single biggest lever you have for horizontal scale.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/estimation-in-system-design-interviews" rel="noopener noreferrer"&gt;Mastering Estimation in System Design Interviews&lt;/a&gt; — How to do capacity math live without freezing or hand-waving.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/back-of-the-envelope-system-design-interview" rel="noopener noreferrer"&gt;Back-of-the-Envelope Estimation&lt;/a&gt; — The "numbers every programmer should know," updated for modern interviews.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/observer-vs-pub-sub-pattern" rel="noopener noreferrer"&gt;Observer vs Pub-Sub Pattern&lt;/a&gt; — Two patterns that look identical from a distance and behave nothing alike up close.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #3: "Database choice doesn't really matter."
&lt;/h2&gt;

&lt;p&gt;It's the entire interview.&lt;/p&gt;

&lt;p&gt;Walk through any "design X" question that ever gets asked, and you'll find the data layer is where the candidate either earns the offer or loses it. Sharding strategies, replication topology, indexing decisions, the SQL-versus-NoSQL fork — these aren't side topics. &lt;em&gt;They are the conversation.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I've watched too many candidates draw a beautiful service diagram and then wave vaguely at a cylinder labeled "DB" as if the storage layer were beneath their notice. It isn't. Senior interviewers spend half the round on data, and they grade you on how comfortable you are with the trade-offs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/postgresql-vs-mongodb-vs-dynamodb" rel="noopener noreferrer"&gt;PostgreSQL vs MongoDB vs DynamoDB&lt;/a&gt; — The three databases you'll be asked about most, compared honestly.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/no-slq-database" rel="noopener noreferrer"&gt;NoSQL Databases in System Design Interviews&lt;/a&gt; — A principled framework for when reaching for NoSQL is actually the right call.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/graph-database-neo4j" rel="noopener noreferrer"&gt;Graph Databases 101&lt;/a&gt; — The class of problem graph databases solve elegantly that relational ones can't.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/horizontally-scale-sql-databases" rel="noopener noreferrer"&gt;Why Horizontally Scaling SQL Is Hard&lt;/a&gt; — The structural reasons relational systems fight you when you try to scale them out.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/scaling-sql-databases" rel="noopener noreferrer"&gt;Scaling SQL Databases: 8 Challenges&lt;/a&gt; — The specific problems you'll hit when you push SQL past its comfort zone anyway.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/database-sharding-guide-2026" rel="noopener noreferrer"&gt;Complete Database Sharding Guide 2026&lt;/a&gt; — Every sharding strategy worth knowing, plus how each one fails.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/database-replication" rel="noopener noreferrer"&gt;Database Replication Fundamentals&lt;/a&gt; — Master-slave, multi-master, and quorum replication, demystified.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/data-replication-strategies-system-design" rel="noopener noreferrer"&gt;Data Replication Strategies I Wish I'd Known Earlier&lt;/a&gt; — The replication patterns I had to learn the hard way.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/b-tree-vs-hash-tree-vs-r-tree" rel="noopener noreferrer"&gt;B-Tree vs Hash vs R-Tree&lt;/a&gt; — Three index structures and the workloads each is built for.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/database-index-hash-vs-tree-vs-bitmap" rel="noopener noreferrer"&gt;Database Indexing Demystified&lt;/a&gt; — A second take on indexing that brings bitmap indexes into the picture.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/database-indexing" rel="noopener noreferrer"&gt;Grokking Database Indexing&lt;/a&gt; — Why indexes make queries fast, derived from first principles.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/normalization-vs-denormalization" rel="noopener noreferrer"&gt;Normalization vs Denormalization&lt;/a&gt; — The eternal "it depends" question, finally given some actual rules.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/acid-database-transaction" rel="noopener noreferrer"&gt;ACID &amp;amp; Database Transactions 101&lt;/a&gt; — Four letters every candidate should be able to riff on without notice.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/database-fragmentation" rel="noopener noreferrer"&gt;From UUID to Snowflake&lt;/a&gt; — Why distributed ID generation is its own surprisingly deep topic.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/change-data-capture" rel="noopener noreferrer"&gt;Change Data Capture 101&lt;/a&gt; — How CDC pipelines keep downstream systems coherent without dual writes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/redis-guide" rel="noopener noreferrer"&gt;Ultimate Guide to Redis in System Design&lt;/a&gt; — Redis explained through the lens of how it actually shows up in interviews.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #4: "Fast and scalable mean the same thing."
&lt;/h2&gt;

&lt;p&gt;They don't.&lt;/p&gt;

&lt;p&gt;A fast system can be impossible to scale. A scalable system can have terrible per-request latency. They are orthogonal qualities, optimized with different techniques, and conflating them is one of the cleanest tells that a candidate hasn't built distributed systems in production. When an interviewer asks "how would you make this faster?" and you start talking about adding more servers, you've revealed the gap.&lt;/p&gt;

&lt;p&gt;This section covers the trade-off conversations that show up in every senior loop: scale versus latency, availability versus consistency, build versus buy, performance versus cost. Master these and you'll start sounding like an engineer who's actually shipped something at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-system-design-scalability" rel="noopener noreferrer"&gt;Grokking Scalability in System Design&lt;/a&gt; — The core mental models for thinking about scale from day one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/scaling-101-comprehensive-learning-for-large-system-designs" rel="noopener noreferrer"&gt;Scaling 101&lt;/a&gt; — A thorough primer on scaling real-world systems beginning to end.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/large-scale-system-design-questions-guide" rel="noopener noreferrer"&gt;Large-Scale System Design Questions&lt;/a&gt; — Walkthroughs of questions that operate at billion-user scale.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/high-availability-system-design-basics" rel="noopener noreferrer"&gt;High Availability — 15 Strategies&lt;/a&gt; — Fifteen concrete patterns for keeping a system up through failure.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/autoscaling-strategies" rel="noopener noreferrer"&gt;Autoscaling Strategies&lt;/a&gt; — The autoscaling approaches that hold up when traffic actually spikes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/5-best-leader-election-algorithms" rel="noopener noreferrer"&gt;5 Best Leader Election Algorithms&lt;/a&gt; — The leader-election algorithms senior interviewers expect you to know on sight.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/best-5-ways-to-reduce-latency" rel="noopener noreferrer"&gt;Best 5 Ways To Reduce Latency&lt;/a&gt; — Five concrete levers when "make it faster" lands on your desk.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/long-tail-latency" rel="noopener noreferrer"&gt;Demystifying Long-Tail Latency&lt;/a&gt; — Why p99 is the number that matters and how to actually attack it.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/read-heavy-vs-write-heavy" rel="noopener noreferrer"&gt;Read-Heavy vs Write-Heavy Workloads&lt;/a&gt; — How to shape your architecture around your read-write ratio.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/10-system-design-challenges-2025" rel="noopener noreferrer"&gt;Top 10 System Design Challenges&lt;/a&gt; — The hardest problems in modern distributed systems engineering.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/top-12-system-design-trade-offs-every-interviewee-must-master-in-2025" rel="noopener noreferrer"&gt;Top 12 System Design Trade-offs&lt;/a&gt; — The trade-offs that surface in nearly every senior loop.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-trade-offs-in-2025-a-step-by-step-framework-for-faang-interviews" rel="noopener noreferrer"&gt;System Design Trade-offs Framework&lt;/a&gt; — A framework for talking through trade-offs the way a senior engineer would.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/complex-system-design-tradeoffs" rel="noopener noreferrer"&gt;Navigating Complex System Design Trade-Offs&lt;/a&gt; — Advanced trade-off analysis for staff-level conversations.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/buy-vs-build" rel="noopener noreferrer"&gt;The Buy vs Build Decision&lt;/a&gt; — How to frame the off-the-shelf-versus-build-it-yourself question convincingly.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #5: "An API is just an API."
&lt;/h2&gt;

&lt;p&gt;Tell me you haven't done a system design interview without telling me you haven't done a system design interview.&lt;/p&gt;

&lt;p&gt;Modern interviews — especially at companies that ship a lot of services — care a lot about how those services talk to each other. Choosing REST versus GraphQL versus gRPC isn't a stylistic preference; it's a load-bearing architectural decision. The differences between a load balancer, a reverse proxy, and an API gateway aren't trivia; they're three different places to put cross-cutting concerns, and interviewers will probe whether you know the difference.&lt;/p&gt;

&lt;p&gt;If your last meaningful API design conversation was about whether to use PUT or PATCH, this section is for you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/http2-vs-http1" rel="noopener noreferrer"&gt;HTTP/2 vs HTTP/1.1&lt;/a&gt; — The protocol upgrades that genuinely move the needle on performance.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/udp-vs-tcp" rel="noopener noreferrer"&gt;TCP vs UDP&lt;/a&gt; — When UDP is the right call and when TCP is non-negotiable.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/cookies-vs-sessions" rel="noopener noreferrer"&gt;Cookies vs Sessions 101&lt;/a&gt; — Web session management for engineers who never properly learned the basics.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/when-you-type-url" rel="noopener noreferrer"&gt;What Happens When You Type a URL?&lt;/a&gt; — The classic warm-up question, walked through end to end.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/what-is-an-api-application-programming-interface" rel="noopener noreferrer"&gt;What is an API?&lt;/a&gt; — A first-principles definition for engineers who've used APIs without ever defining one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/what-is-restful-api" rel="noopener noreferrer"&gt;Understanding RESTful APIs&lt;/a&gt; — What "RESTful" means in interviews versus how it gets butchered in production.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/10-best-api-design-practices" rel="noopener noreferrer"&gt;10 Best API Design Practices&lt;/a&gt; — Ten habits that mark the difference between a junior and senior API designer.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/api-design-checklist" rel="noopener noreferrer"&gt;The API Design Checklist&lt;/a&gt; — The mental checklist senior engineers run through before writing any endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/rest-graphql-grpc-system-design" rel="noopener noreferrer"&gt;REST vs GraphQL vs gRPC&lt;/a&gt; — A head-to-head on the three API paradigms competing for your design.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/8-rest-api-interview-questions-every-developer-should-know" rel="noopener noreferrer"&gt;8 REST API Interview Questions&lt;/a&gt; — The REST-flavored questions that keep cycling back through interviews.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-the-api-interview-common-questions-and-expert-answers" rel="noopener noreferrer"&gt;Mastering the API Interview&lt;/a&gt; — A deep dive on the API-focused round if your target company runs one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/load-balancer-reverse-proxy-api-gateway" rel="noopener noreferrer"&gt;Load Balancer vs Reverse Proxy vs API Gateway&lt;/a&gt; — Three boxes that look identical and serve very different purposes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/rabbitmq-kafka-activemq-system-design" rel="noopener noreferrer"&gt;RabbitMQ vs Kafka vs ActiveMQ&lt;/a&gt; — The three message brokers you'll be asked about, head-to-head.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/kafka-streams-apache-flink-apache-storm" rel="noopener noreferrer"&gt;Kafka Streams vs Flink vs Storm&lt;/a&gt; — The major stream processing engines, compared by what they're actually good at.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/network-timeouts-and-errors" rel="noopener noreferrer"&gt;Defensive Coding for Network Timeouts&lt;/a&gt; — The defensive patterns that prevent local failures from cascading into outages.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/message-patterns" rel="noopener noreferrer"&gt;Grokking Messaging Patterns&lt;/a&gt; — Queues, Pub/Sub, and event streams — the three workhorses of distributed comms.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #6: "Microservices are obviously the right answer."
&lt;/h2&gt;

&lt;p&gt;They're obviously the right answer the way a chainsaw is obviously the right tool for opening a letter.&lt;/p&gt;

&lt;p&gt;I've lost count of the number of candidates who reach for microservices reflexively when asked to design even modestly sized systems. They name-drop service meshes, mention Kubernetes for no clear reason, and end up with diagrams that have more boxes than the actual product would have users in its first year.&lt;/p&gt;

&lt;p&gt;A senior engineer knows when &lt;em&gt;not&lt;/em&gt; to use microservices. A senior engineer can defend a monolith. A senior engineer can articulate what SOA actually was, what each style's failure modes look like in production, and when "boring" is the right answer. This section will get you there.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/monolithic-service-oriented-microservice-architecture" rel="noopener noreferrer"&gt;Monolithic vs Microservices vs SOA&lt;/a&gt; — A fair comparison of the three major architectural styles.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/understanding-top-10-software-architecture-patterns" rel="noopener noreferrer"&gt;Top 10 Software Architecture Patterns&lt;/a&gt; — The ten patterns every senior engineer should be able to name and apply.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/10-myths-about-microservices-architecture" rel="noopener noreferrer"&gt;10 Myths About Microservices&lt;/a&gt; — The myths that push teams into microservices for all the wrong reasons.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/10-common-microservices-anti-patterns" rel="noopener noreferrer"&gt;10 Common Microservices Anti-Patterns&lt;/a&gt; — The anti-patterns I see most often in real production codebases.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/19-essential-microservices-patterns-for-system-design-interviews" rel="noopener noreferrer"&gt;19 Essential Microservices Patterns&lt;/a&gt; — Nineteen patterns worth keeping in active vocabulary.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/essential-software-design-principles-you-should-know-before-the-interview" rel="noopener noreferrer"&gt;Essential Software Design Principles (SOLID)&lt;/a&gt; — SOLID via real examples instead of canned definitions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/object-oriented-programming-oop" rel="noopener noreferrer"&gt;Beginner's Guide to Object-Oriented Programming&lt;/a&gt; — An OOP refresher for engineers who came up through other paradigms.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/kubernetes-ultimate-guide" rel="noopener noreferrer"&gt;The Ultimate Kubernetes Guide for System Design&lt;/a&gt; — Kubernetes from a system design lens, not a DevOps one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/virtual-machines-vs-containers" rel="noopener noreferrer"&gt;Virtual Machines vs Containers&lt;/a&gt; — VMs and containers, explained without the cloud-vendor marketing.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/a-beginners-guide-to-distributed-systems" rel="noopener noreferrer"&gt;A Beginner's Guide to Distributed Systems&lt;/a&gt; — A friendly on-ramp to thinking distributed-first.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/distributed-system-design-guide-for-beginners" rel="noopener noreferrer"&gt;Distributed System Design Guide for Beginners&lt;/a&gt; — Concepts and patterns for engineers building their first distributed system.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/apache-zookeeper-architecture-system-design" rel="noopener noreferrer"&gt;Apache ZooKeeper's Architecture&lt;/a&gt; — A look at how ZooKeeper holds distributed state together.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/idempotency-in-distributed-systems" rel="noopener noreferrer"&gt;Idempotency 101: Fault-Tolerant Distributed Systems&lt;/a&gt; — A production-grade treatment of idempotency in distributed contexts.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/how-to-use-consistent-hashing-in-a-system-design-interview-33ge"&gt;How to Use Consistent Hashing in a System Design Interview&lt;/a&gt; — Applying consistent hashing live in an interview, walked through.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #7: "I've memorized 'design Twitter,' I'm fine."
&lt;/h2&gt;

&lt;p&gt;You're not.&lt;/p&gt;

&lt;p&gt;The case studies you'll find in this section are not scripts to memorize. They're worked examples of a &lt;em&gt;thinking process&lt;/em&gt; — and the goal is to internalize the process, not the answer. If your interviewer asks you to design Twitter and you regurgitate a memorized solution, a sharp interviewer will immediately pivot — &lt;em&gt;"OK, now make it work for live video instead of text"&lt;/em&gt; — and you'll be flailing again because you never learned to think, only to recite.&lt;/p&gt;

&lt;p&gt;The right way to use this section: read each case study once for ideas, then close the tab and design the same system from scratch on a blank piece of paper. Compare. The gap between your version and mine is your study plan for the next day.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-design-instagram-in-system-design-interview" rel="noopener noreferrer"&gt;How to Design Instagram&lt;/a&gt; — A worked walkthrough of the Instagram design question.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-social-media-news-feed" rel="noopener noreferrer"&gt;How to Design a Social Media News Feed&lt;/a&gt; — Designing a scalable news feed from first principles.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/url-shortening" rel="noopener noreferrer"&gt;How to Design a URL Shortener Service&lt;/a&gt; — The classic URL shortener, solved end to end.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/system-design-interview-question-designing-a-url-shortening-service-4029"&gt;URL Shortener — Dev Community Version&lt;/a&gt; — A second take on the same problem from a slightly different angle.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-web-crawler" rel="noopener noreferrer"&gt;How to Design a Web Crawler&lt;/a&gt; — Designing a distributed crawler the way you'd actually build one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/build-a-search-engine" rel="noopener noreferrer"&gt;How to Build a Search Engine&lt;/a&gt; — How search engines actually get built, from crawler to ranker.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-recommendation-system" rel="noopener noreferrer"&gt;How to Design a Recommendation System&lt;/a&gt; — The architecture behind Netflix-style recommendations.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-cloud-storage-service" rel="noopener noreferrer"&gt;How to Design a Cloud Storage Service&lt;/a&gt; — Designing Dropbox or Google Drive, including the parts most writeups skip.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-chat-application" rel="noopener noreferrer"&gt;How to Design a Real-Time Chat Application&lt;/a&gt; — Designing WhatsApp or Slack from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-real-time-editor" rel="noopener noreferrer"&gt;How to Design a Real-Time Collaborative Editor&lt;/a&gt; — How the Google Docs collaboration model actually works under the hood.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-video-conferencing-system" rel="noopener noreferrer"&gt;How to Design a Video Conferencing System&lt;/a&gt; — The architectural choices behind Zoom-style calls.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/ride-sharing-service" rel="noopener noreferrer"&gt;How to Design a Ride Sharing Service&lt;/a&gt; — Designing Uber end to end without hand-waving over geospatial.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-ticketing-system" rel="noopener noreferrer"&gt;Designing an E-Ticketing System&lt;/a&gt; — A ticketing system that survives flash-sale traffic.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-scalable-e-commerce-platform" rel="noopener noreferrer"&gt;Design a Scalable E-Commerce Platform&lt;/a&gt; — A modern e-commerce architecture built for scale from day one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/design-parking-system" rel="noopener noreferrer"&gt;Designing a Parking System&lt;/a&gt; — The classic OOD parking lot question, answered properly.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/top-10-system-design-interview-questions-and-answers" rel="noopener noreferrer"&gt;10 Must-Do System Design Interview Questions&lt;/a&gt; — My ten must-do questions with full solutions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-questions-to-crack-your-next-faang-interview" rel="noopener noreferrer"&gt;64+ System Design Interview Questions&lt;/a&gt; — The full canonical question list, grouped by theme.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/64-system-design-interview-questions-ranked-from-easiest-to-hardest-260m"&gt;64 Questions Ranked by Difficulty&lt;/a&gt; — The same set, ranked from easiest to hardest.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/50-advanced-system-design-interview-questions" rel="noopener noreferrer"&gt;50 Advanced System Design Questions&lt;/a&gt; — Fifty harder questions calibrated for senior and staff loops.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #8: "An interview is an interview."
&lt;/h2&gt;

&lt;p&gt;Companies vary wildly in what they actually grade.&lt;/p&gt;

&lt;p&gt;Google's bar is mostly about depth and rigor — they want you reasoning from first principles and acknowledging what you don't know. Amazon weaves leadership principles through every technical answer. Meta cares about product judgment alongside system judgment, and actually runs two different design rounds depending on the role. Netflix wants pragmatism and ownership. OpenAI is its own beast right now and changes faster than any blog post can keep up with.&lt;/p&gt;

&lt;p&gt;If you're prepping with a generic curriculum and then walking into a specific company's loop without tuning, you're leaving offers on the table. Pick your target. Study the rubric.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/faang-system-design-interviews-strategies-from-experts" rel="noopener noreferrer"&gt;FAANG System Design Interviews — Strategies from Real Experts&lt;/a&gt; — Strategies straight from people who've sat on both sides.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-the-faang-interview-the-ultimate-guide-for-software-engineers" rel="noopener noreferrer"&gt;Mastering the FAANG Interview&lt;/a&gt; — The complete guide to the entire FAANG loop, not just design.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/whats-the-best-way-to-prepare-for-faang-interviews-in-2025" rel="noopener noreferrer"&gt;FAANG Interviews in 2025: What Changed&lt;/a&gt; — What shifted in FAANG loops last year and how to adapt your prep.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interviews-at-google-meta-amazon" rel="noopener noreferrer"&gt;Google, Amazon, and Meta Compared&lt;/a&gt; — How the three biggest companies differ in how they actually run the design round.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/google-system-design-interview-questions-ultimate-guide" rel="noopener noreferrer"&gt;Google System Design Interview Questions&lt;/a&gt; — Google's favorite questions with sample answers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/google-system-design-interview-prep" rel="noopener noreferrer"&gt;Google System Design Secrets&lt;/a&gt; — Insider notes on Google's specific scoring habits.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-pass-google-system-design-interview" rel="noopener noreferrer"&gt;Pass Google System Design as a Non-Programmer&lt;/a&gt; — Yes, PMs and TPMs can clear this round — here's the playbook.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-amazon" rel="noopener noreferrer"&gt;Amazon System Design Interview: 5 Sample Questions&lt;/a&gt; — Five Amazon-flavored questions worked through.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/amazon-system-design-mock-interview-preparation-guide" rel="noopener noreferrer"&gt;Amazon System Design Mock Interview Prep&lt;/a&gt; — How to run a mock that actually mirrors Amazon's loop.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/amazon-interview-questions-guide" rel="noopener noreferrer"&gt;Amazon Interview Questions: Ultimate Guide&lt;/a&gt; — The complete Amazon prep guide, including leadership principles.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/meta-system-design-interview-questions" rel="noopener noreferrer"&gt;Meta System Design Interview Questions&lt;/a&gt; — Meta's design questions with structured solutions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/meta-system-design-vs-product-design" rel="noopener noreferrer"&gt;Meta System Design vs Product Design&lt;/a&gt; — How to tell Meta's two different design rounds apart.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-metas-product-design-interview" rel="noopener noreferrer"&gt;Mastering Meta's Product Design Interview&lt;/a&gt; — A complete guide to Meta's product architecture round.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/mastering-the-meta-technical-screen-a-comprehensive-guide-for-senior-software-engineers" rel="noopener noreferrer"&gt;Mastering the Meta Technical Screen&lt;/a&gt; — A thorough walkthrough of Meta's screen for senior candidates.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/all-you-need-to-know-about-the-meta-interview" rel="noopener noreferrer"&gt;All You Need to Know About the Meta Interview&lt;/a&gt; — A complete overview of Meta's hiring loop.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-ace-the-meta-engineering-manager-interview-process" rel="noopener noreferrer"&gt;How to Ace the Meta Engineering Manager Interview&lt;/a&gt; — The Meta EM loop, broken down by round.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/netflix-system-design-interview-questions-guide" rel="noopener noreferrer"&gt;Netflix System Design Interview Questions&lt;/a&gt; — Netflix's design questions with the context they're usually asked in.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/microsoft-system-design-interview-questions" rel="noopener noreferrer"&gt;Microsoft System Design Interview Questions&lt;/a&gt; — Microsoft's rubric and most-asked questions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/openai-system-design-interview-questions" rel="noopener noreferrer"&gt;OpenAI System Design Interview Questions&lt;/a&gt; — The questions to expect when interviewing at OpenAI.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/tesla-system-design-interview-questions" rel="noopener noreferrer"&gt;Tesla System Design Interview Questions&lt;/a&gt; — How Tesla's design questions diverge from the FAANG mold.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/salesforce-system-design-mock-interview" rel="noopener noreferrer"&gt;Salesforce System Design Mock Interview&lt;/a&gt; — A mock built around Salesforce's actual loop.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/the-essential-guide-to-acing-the-paypal-software-engineer-interview" rel="noopener noreferrer"&gt;Acing the PayPal Software Engineer Interview&lt;/a&gt; — A deep dive on PayPal's interview process.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Misconception #9: "Coding and behavioral don't matter for senior roles."
&lt;/h2&gt;

&lt;p&gt;They might matter more.&lt;/p&gt;

&lt;p&gt;I have watched far more senior engineers fail FAANG loops on behavioral rounds than on system design. The math is brutal: you can ace four out of five rounds and still get a no-hire because one interviewer didn't believe your "tell me about a time you disagreed with your manager" story. Coding rounds, similarly, do not get easier as you climb the ladder — they get harder, because the bar shifts from "can you solve it" to "can you solve it cleanly while explaining your trade-offs out loud."&lt;/p&gt;

&lt;p&gt;This section is the reminder that the design round is one slice of a longer loop, and the candidates who get offers are the ones who prep all of it. Don't skip these because they aren't "the fun part." They're often the part that decides the offer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/dont-just-leetcode" rel="noopener noreferrer"&gt;Don't Just LeetCode — Follow Coding Patterns&lt;/a&gt; — Why pattern-based prep beats raw LeetCode volume every time.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/coding-patterns-for-tech-interviews" rel="noopener noreferrer"&gt;Ultimate Coding Patterns Cheat Sheet&lt;/a&gt; — The cheat sheet I hand to every candidate I mentor.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/top-lc-patterns" rel="noopener noreferrer"&gt;10 Top LeetCode Patterns for FAANG&lt;/a&gt; — The ten patterns that unlock most FAANG coding questions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/top-leetcode-patterns-for-faang-coding-interviews-1on4"&gt;Top LeetCode Patterns — Dev Community Version&lt;/a&gt; — The same breakdown from a slightly different angle.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/20-essential-coding-patterns-to-ace-your-next-coding-interview-32a3"&gt;20 Essential Coding Patterns&lt;/a&gt; — Twenty patterns that cover the vast majority of coding interview territory.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/5-algorithms-every-developer-should-know-to-clear-coding-interviews-in-2024" rel="noopener noreferrer"&gt;5 Essential Algorithms for Coding Interviews&lt;/a&gt; — The five algorithms worth committing to memory.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/top-20-coding-questions-to-pass-google-interview" rel="noopener noreferrer"&gt;Top 20 Coding Questions for the Google Interview&lt;/a&gt; — Twenty Google-favorite coding questions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/coding-interview-mistakes-to-avoid" rel="noopener noreferrer"&gt;10 Coding Interview Mistakes to Avoid&lt;/a&gt; — The mistakes I see candidates repeat over and over.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/the-ultimate-strategy-to-preparing-for-the-coding-interview-3ace"&gt;The Ultimate Strategy for Coding Interview Prep&lt;/a&gt; — My complete approach to preparing for coding rounds.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/grokking-leetcode-a-smarter-way-to-prepare-for-coding-interviews-5d9d"&gt;Grokking LeetCode — A Smarter Way to Prepare&lt;/a&gt; — A smarter alternative to grinding until you drop.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/arslan_ah/key-steps-to-prepare-for-a-software-engineer-interview-52ll"&gt;Key Steps to Prepare for a Software Engineer Interview&lt;/a&gt; — The core steps to structure your prep from day one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/software-engineer-interview-preparation-complete-guide-tips" rel="noopener noreferrer"&gt;Software Engineer Interview Preparation: Complete Guide&lt;/a&gt; — An end-to-end SE interview prep guide.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/the-roadmap-to-clearing-technical-interview-in-2024" rel="noopener noreferrer"&gt;The Roadmap to Clearing Technical Interviews in 2025&lt;/a&gt; — A full roadmap for technical interview prep.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/tech-interview-preparation-bootcamp" rel="noopener noreferrer"&gt;12 Weeks Tech Interview Preparation Bootcamp&lt;/a&gt; — A structured twelve-week bootcamp plan.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/all-you-need-to-know-about-an-interview-bootcamp" rel="noopener noreferrer"&gt;All You Need to Know About an Interview Bootcamp&lt;/a&gt; — What to expect from a structured bootcamp and who actually benefits.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/behavioral-interviews-at-faang" rel="noopener noreferrer"&gt;Behavioral Interviews at FAANG&lt;/a&gt; — What FAANG interviewers are really listening for in behavioral rounds.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/faang-behavioral-interview-guide" rel="noopener noreferrer"&gt;FAANG Behavioral Interview Guide&lt;/a&gt; — A thorough behavioral prep guide for FAANG loops.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/how-to-craft-compelling-behavioral-interview-stories" rel="noopener noreferrer"&gt;How to Craft Compelling Behavioral Interview Stories&lt;/a&gt; — A storytelling framework that turns flat answers into memorable ones.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/culture-fit-questions" rel="noopener noreferrer"&gt;Culture Fit in Tech Companies&lt;/a&gt; — What "culture fit" actually means to hiring committees.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/soft-skills-for-software-engineering-interview" rel="noopener noreferrer"&gt;Soft Skills for Software Engineering Interviews&lt;/a&gt; — The soft skills that quietly carry the most weight.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/software-engineer-survival-kit-2026" rel="noopener noreferrer"&gt;Software Engineer Survival Kit 2026&lt;/a&gt; — The skills I'd focus on now to stay relevant through the AI era.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/what-skills-should-junior-programmers-have-in-the-ai-period" rel="noopener noreferrer"&gt;Skills Junior Developers Need in the AI Era&lt;/a&gt; — What junior engineers should focus on as the field shifts under them.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/job-hunting-in-2024-is-linkedins-open-to-work-badge-your-secret-weapon" rel="noopener noreferrer"&gt;Job Hunting in 2025: LinkedIn's 'Open to Work' Badge&lt;/a&gt; — Whether the Open to Work badge actually helps your search.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/3-technologies-that-will-shape-the-future" rel="noopener noreferrer"&gt;3 Technologies That Will Shape the Future&lt;/a&gt; — My take on three technologies quietly reshaping the field right now.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Reference Shelf
&lt;/h2&gt;

&lt;p&gt;A handful of pieces that don't fit cleanly into any single misconception but are worth keeping bookmarked. Cheat sheets, course reviews, recommended papers, tools, and meta-essays on the discipline.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-cheat-sheet" rel="noopener noreferrer"&gt;The Ultimate System Design Cheat Sheet (2026)&lt;/a&gt; — The current version of the most-saved cheat sheet on the site.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-cheat-sheet-for-senior-engineer" rel="noopener noreferrer"&gt;System Design Cheat Sheet for Senior Engineers&lt;/a&gt; — A one-page reference tuned specifically for senior-level expectations.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-pdf" rel="noopener noreferrer"&gt;System Design Interview PDF&lt;/a&gt; — A downloadable roadmap and checklist for offline prep.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-primer-the-ultimate-guide" rel="noopener noreferrer"&gt;System Design Primer: The Ultimate Guide&lt;/a&gt; — A reference primer on every term you'll need to know.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-tutorial-for-beginners" rel="noopener noreferrer"&gt;System Design Tutorial for Beginners (2025)&lt;/a&gt; — A tutorial that builds intuition through worked examples.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-concepts-for-beginners" rel="noopener noreferrer"&gt;System Design 101 — Beginner's Guide&lt;/a&gt; — The absolute first-timer introduction to the vocabulary.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-guide-for-beginners" rel="noopener noreferrer"&gt;System Design Interview Guide for Beginners&lt;/a&gt; — A gentler ramp for engineers with no distributed systems background.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-guide-2025" rel="noopener noreferrer"&gt;System Design Interview Guide 2025&lt;/a&gt; — A current top-to-bottom guide for FAANG-style design rounds.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/system-design-interview-faqs" rel="noopener noreferrer"&gt;Top System Design Interview FAQs&lt;/a&gt; — Straight answers to the questions candidates ask me on repeat.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/sys-design-papers" rel="noopener noreferrer"&gt;7 Must-Read System Design Papers&lt;/a&gt; — The foundational papers every senior candidate should have read.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/top-7-tools-for-creating-system-design-diagrams" rel="noopener noreferrer"&gt;Top 7 Tools for Creating System Design Diagrams&lt;/a&gt; — The diagramming tools I actually use when teaching.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/best-system-design-courses-for-beginners" rel="noopener noreferrer"&gt;Best System Design Courses for Beginners&lt;/a&gt; — A comparison of the entry-level options on the market.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/navigating-the-best-system-design-courses-for-coding-interviews" rel="noopener noreferrer"&gt;Navigating the Best System Design Courses&lt;/a&gt; — How to pick a course that actually matches your level and target.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/what-is-grokking-the-system-design-interview-a-complete-guide" rel="noopener noreferrer"&gt;What Is Grokking the System Design Interview?&lt;/a&gt; — A full tour of the flagship course for readers deciding if it fits them.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-system-design-interview-to-ace-faang" rel="noopener noreferrer"&gt;How to Use Grokking System Design Interview to Ace FAANG&lt;/a&gt; — Tactics for getting maximum value out of the course.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/is-grokking-system-design-course-worth-it" rel="noopener noreferrer"&gt;Is Grokking the System Design Interview Worth It?&lt;/a&gt; — An honest self-review for readers weighing the decision.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/grokking-the-system-design-interview-5-lessons" rel="noopener noreferrer"&gt;Grokking the System Design Interview — 5 Lessons&lt;/a&gt; — Five hard-won lessons from years of teaching this material.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/highscalability-vs-designgurus" rel="noopener noreferrer"&gt;HighScalability.com vs DesignGurus.io&lt;/a&gt; — A fair comparison of two popular resources and how they complement each other.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/why-practicing-system-design-is-crucial-for-software-engineers" rel="noopener noreferrer"&gt;Why Practicing System Design Is Crucial&lt;/a&gt; — Why this is a long-term career skill, not just interview theater.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/blog/sys-design-for-data-scientists" rel="noopener noreferrer"&gt;Is System Design Important for Data Scientists?&lt;/a&gt; — Why data folks should care about system design too.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How to Actually Use This Guide
&lt;/h2&gt;

&lt;p&gt;A few last notes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One misconception at a time.&lt;/strong&gt; Don't open all nine sections at once. Pick the one that bites you hardest, work through those articles in sequence, do the exercises in your head as you go, and only then move on. Engineers who spread their attention across all nine misconceptions in parallel make about a third of the progress they'd make working serially.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practice harder than you read.&lt;/strong&gt; The single biggest mistake in interview prep is consuming material instead of producing it. After every case study, close the tab and design the same system on paper. After every fundamentals article, try to explain the concept to an imaginary junior engineer in three sentences. Your gaps will show up almost immediately, and they'll be far more useful than another article would have been.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trust the misconception framing.&lt;/strong&gt; I organized this post around mistakes rather than topics deliberately. Engineers who frame their prep around weaknesses improve faster than engineers who frame it around coverage. &lt;em&gt;"Read every database article"&lt;/em&gt; is a tempting goal because it's measurable, but it doesn't actually correct what's broken in your performance. &lt;em&gt;"I freeze when asked about consistency, so I'm spending three days on Section 2 until I can talk about it cold"&lt;/em&gt; — that does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Come back when you've cleared the loop.&lt;/strong&gt; I've kept this list updated for years specifically because engineers who land offers write to tell me which articles helped and which were missing. If you make it through and break in, please send me that note. Those messages are why I keep writing this stuff in the first place.&lt;/p&gt;

&lt;p&gt;Good luck. You've got this.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>interview</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>64 System Design Interview Questions, Ranked From Easiest to Hardest</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Sun, 12 Apr 2026 02:28:29 +0000</pubDate>
      <link>https://dev.to/arslan_ah/64-system-design-interview-questions-ranked-from-easiest-to-hardest-260m</link>
      <guid>https://dev.to/arslan_ah/64-system-design-interview-questions-ranked-from-easiest-to-hardest-260m</guid>
      <description>&lt;p&gt;If you've ever stared at a list of 200 system design interview questions and felt your motivation drain out through your shoes, this article is for you.&lt;/p&gt;

&lt;p&gt;Here's the uncomfortable truth about preparing for system design interviews: most curated lists you'll find online are useless not because the problems are bad, but because they're presented as a flat soup. Designing TinyURL and designing a stock exchange are not the same kind of challenge. They don't take the same amount of preparation. They don't test the same skills. And lumping them together makes you feel like you have an impossibly long road ahead, when really the road is much shorter than it looks — you just need to walk it in the right order.&lt;/p&gt;

&lt;p&gt;So I sat down with the four most respected system design courses on the internet — the original Grokking series, its Volume II successor, the advanced case-studies course, and the newer crash course — and pulled out every single design question. I ended up with 64 of them. Then I did something nobody else seems willing to do: I ranked them from easiest to hardest, in five clean tiers.&lt;/p&gt;

&lt;p&gt;The result is a roadmap. Start at Tier 1, work your way up, stop when you hit the level your interview demands. No more drowning in a sea of equally-weighted problems. Let's go.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to read this tier list
&lt;/h2&gt;

&lt;p&gt;A few ground rules before you dive in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Difficulty here means interview difficulty, not real-world difficulty.&lt;/strong&gt; A problem like "design Amazon S3" is genuinely terrifying to build in real life, but as an interview question it's well-trodden territory and a strong candidate can navigate it with relatively few surprises. By contrast, "design a flash sale" sounds simple until your interviewer starts asking about fairness and you realize there are no easy answers. I've ranked by how hard the &lt;em&gt;interview conversation&lt;/em&gt; tends to go, not by lines of code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You don't need to finish every tier.&lt;/strong&gt; If you're a junior engineer interviewing for a backend role, mastering Tiers 1 and 2 will get you a long way. Mid-level and senior candidates should be comfortable through Tier 3. Staff and principal candidates need Tier 4 in their bones, and Tier 5 — the real-world case studies — is where they go to win the room.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repetition is intentional.&lt;/strong&gt; A few problems appear twice across the four source courses (there are two YouTube questions, two Uber questions, two typeahead questions). I've kept all 64 because the alternate treatments often emphasize different angles, and reading both is genuinely educational.&lt;/p&gt;

&lt;p&gt;With that out of the way, here are the 64 system design interview questions you should know in 2026, ranked.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tier 1 — Warm-ups (8 questions)
&lt;/h2&gt;

&lt;p&gt;These are the gentlest problems on the list. They typically focus on a single core idea — generating IDs, limiting throughput, building a simple lookup — and they're where every system design beginner should start. If you can't comfortably whiteboard these, no amount of advanced material will save you. Get fluent here first.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-a-url-shortening-service-like-" rel="noopener noreferrer"&gt;Design TinyURL&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The first problem nearly everyone tackles. The whole exercise is about turning a long URL into a six-character code, but along the way you'll bump into hash collisions, base62 encoding, read amplification, and your first taste of when to introduce a cache. A perfect on-ramp.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-pastebin" rel="noopener noreferrer"&gt;Design Pastebin&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A natural follow-up. Now your "value" is a multi-kilobyte text blob instead of a URL, which forces you to think about where blobs actually live (hint: not your relational database) and how to expire content gracefully without scanning the entire dataset.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-an-api-rate-limiter" rel="noopener noreferrer"&gt;Design an API rate limiter&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Every backend engineer should be able to draw a token bucket from memory by the end of this one. The single-machine version is short and sweet — the perfect place to learn the algorithms before facing their distributed cousin.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ad3ac6f7bbe9ec20838e" rel="noopener noreferrer"&gt;Design a distributed rate limiter&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Now imagine the same rate limiter, except enforced consistently across fifty edge servers in different regions. Suddenly the simple counter becomes a real distributed systems problem. This is your introduction to "consistency costs latency."&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-unique-id-generator" rel="noopener noreferrer"&gt;Design a unique ID generator&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Why isn't auto-increment good enough? Spend twenty minutes on this question and you'll learn about Twitter's Snowflake, the role of clock skew, and why ordering identifiers by time is sometimes worth more than uniqueness alone.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-typeahead-suggestion" rel="noopener noreferrer"&gt;Design typeahead suggestion&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Your first encounter with the trie data structure in an interview context. The fun part isn't the trie — it's the constraint: you have under 100 milliseconds to return ranked suggestions, and your dictionary has tens of millions of entries.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949af57c75bc82e6c4739d5" rel="noopener noreferrer"&gt;Design typeahead/autocomplete&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The crash course's modernized take on the same problem, with extra emphasis on personalization, fuzzy matching, and how trending queries get added to the suggestion pool in near-real-time. Worth doing both versions back-to-back.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ae6ad5c46f6c243bd24f" rel="noopener noreferrer"&gt;Design an API gateway&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The component everyone nods at and few can describe in detail. Authentication, throttling, request routing, and response transformation all live here. Designing one is the fastest way to understand what your microservice architecture is actually missing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tier 2 — The classics (15 questions)
&lt;/h2&gt;

&lt;p&gt;This is the meat of the list — the system design interview questions that have been asked at FAANG companies for over a decade and remain in heavy rotation. If your interview is in two weeks, this is the tier where you should be spending most of your time. Every problem here exercises at least two non-trivial design dimensions, and most have a famous "right answer" that interviewers expect you to at least be aware of.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-twitter" rel="noopener noreferrer"&gt;Design Twitter&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The single most asked system design interview question, full stop. The conversation will inevitably arrive at the question of when to materialize a user's home timeline — at write time, at read time, or some hybrid — and your answer reveals more about your seniority than almost anything else you'll say.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/69444aaf444d0494b7366140" rel="noopener noreferrer"&gt;Design Twitter timeline&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A laser-focused version of the previous question that strips away everything except the timeline-generation problem. If you struggled with the broad version, this is the one to drill until your fan-out reasoning becomes second nature.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-instagram" rel="noopener noreferrer"&gt;Design Instagram&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Twitter, but the payload is photos and videos instead of text. That single change pulls in CDN strategy, image transformation pipelines, and a much more complicated story about storage tiers — hot, warm, and cold — than text-based systems require.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-facebooks-newsfeed" rel="noopener noreferrer"&gt;Design Facebook's newsfeed&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Twitter, but ranked. The presence of a ranking layer changes everything: now you need a feature store, an ML serving layer, and a way to score thousands of candidate posts in milliseconds. A great problem to learn what production ML infrastructure actually looks like.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-reddit-new" rel="noopener noreferrer"&gt;Design Reddit&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Threaded comments are the technical highlight here, but the more interesting story is the time-decaying score function that powers Reddit's "hot" sort. Implementing it once gives you a tool you can apply to dozens of other ranking problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-facebook-messenger" rel="noopener noreferrer"&gt;Design Facebook Messenger&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A messaging system that has to handle billions of users, millions of concurrent connections, and the merciless requirement that messages arrive in order, without duplicates, and even when the recipient is offline. Long-polling vs. WebSockets is the appetizer; the main course is delivery semantics.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949acb8c6f7bbe9ec207e11" rel="noopener noreferrer"&gt;Design WhatsApp&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Take Facebook Messenger and add end-to-end encryption, multi-device support, and the operational reality that most users are on bandwidth-constrained mobile networks. The cryptography rabbit hole is optional but rewarding.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-dropbox" rel="noopener noreferrer"&gt;Design Dropbox&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The first problem on this list where the &lt;em&gt;client&lt;/em&gt; matters as much as the server. Chunking, deduplication, delta sync, and conflict resolution turn a simple file upload service into a surprisingly intricate distributed systems problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-yelp-or-nearby-friends" rel="noopener noreferrer"&gt;Design Yelp or Nearby Friends&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The geospatial indexing primer everyone needs at least once. Geohashes, quadtrees, and S2 cells all make appearances. Once you've internalized them, every other "find things near me" problem feels like a minor variation.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-uber-backend" rel="noopener noreferrer"&gt;Design the Uber backend&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Yelp's geospatial indexing meets a real-time matching engine. The dispatch algorithm — which driver gets which rider — is where most candidates either shine or stumble. Have a concrete answer ready.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949aebf9d4b0fee5874a44f" rel="noopener noreferrer"&gt;Design Uber/Lyft&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The crash course's updated treatment, with more attention to surge pricing economics, ETA prediction, and the subtle differences between batched and continuous matching. Read after the original Uber question for maximum effect.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-a-web-crawler" rel="noopener noreferrer"&gt;Design a web crawler&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The front-end of any search engine. The crawler itself is mostly a queue and a politeness budget — the hard parts are URL deduplication at scale, dealing with infinite URL spaces, and not getting your IPs banned from the entire internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-twitter-search" rel="noopener noreferrer"&gt;Design Twitter search&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The first system design interview question that forces you to confront inverted indexes. You'll learn how documents become postings lists, why sharding by term is harder than it sounds, and how to keep an index fresh when new documents arrive every millisecond.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-ticketmaster" rel="noopener noreferrer"&gt;Design Ticketmaster&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The poster child for "strong consistency is expensive but sometimes necessary." Two people cannot buy the same seat. Period. Get this question wrong and you've burned a sold-out concert; get it right and you've demonstrated you understand distributed locking.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-google-calendar" rel="noopener noreferrer"&gt;Design Google Calendar&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Looks like a CRUD app, behaves like a logic puzzle. Recurring events, time zones, daylight saving time, and invitation propagation conspire to create one of the most underrated data modeling questions in the entire list.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tier 3 — Modern systems (16 questions)
&lt;/h2&gt;

&lt;p&gt;Tier 3 problems show up disproportionately in interviews at companies founded in the last decade or two. They tend to involve real-time collaboration, AI/ML, or operational concerns that older problems don't surface. If you're targeting modern infrastructure-heavy roles or AI-first companies, this is the tier that separates "competent" from "current."&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949accf12526d454709e31c" rel="noopener noreferrer"&gt;Design Discord&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Chat plus voice plus the unique pain of supporting servers with hundreds of thousands of members in a single channel. The naive fan-out approach explodes; the right answer involves hierarchical message distribution and very careful state management.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ae459e786057b2628ef0" rel="noopener noreferrer"&gt;Design a live comment streaming service like Twitch chat&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A million viewers, a few thousand chatters, and a chat that has to feel instantaneous. The trick is realizing that perfect delivery to every viewer is neither possible nor desirable — and architecting accordingly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6943aba2eb7a4d6fa49c42e8" rel="noopener noreferrer"&gt;Design Google Docs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The system design interview question that introduces most engineers to operational transforms (or, more recently, CRDTs). Have at least a basic mental model of one of these algorithms before you sit down for this interview — bluffing is obvious.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ae149d4b0fee58749b89" rel="noopener noreferrer"&gt;Design a collaborative whiteboard like Miro&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Google Docs, but the data model is a 2D plane of arbitrary objects and the latency budget is even tighter. The CRDT discussion gets weirder. The infrastructure discussion gets harder. A favorite at companies building real-time tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6948052cc35010a6cc20b162" rel="noopener noreferrer"&gt;Design ChatGPT&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The newest entry on the list and rising fast. The infrastructure conversation centers on GPU scheduling, KV cache reuse, streaming token responses, and conversational state management — none of which appear in any other interview question. Essential for AI infrastructure roles.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/designing-a-notification-system" rel="noopener noreferrer"&gt;Design a notification system&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Push, email, SMS, and in-app, all flowing through one pipeline. The interesting part isn't sending notifications — it's managing user preferences, channel-specific rate limits, and retries when downstream providers fail.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-a-recommendation-system-for-netflix" rel="noopener noreferrer"&gt;Design a Netflix-style recommendation system&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A whirlwind tour of production ML: candidate generation, feature pipelines, batch model training, online serving, A/B testing infrastructure. Each piece is its own interview-worthy problem in disguise.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-gmail-rafay" rel="noopener noreferrer"&gt;Design Gmail&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Not just mailbox storage, but search-over-personal-data, threading, labels, spam filtering, and attachment handling. The variety of subsystems makes this a deceptively rich question.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-global-news-aggregator-system-like-google-news" rel="noopener noreferrer"&gt;Design Google News as a global aggregator&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Crawling, deduplication, story clustering, and personalized ranking — all running continuously over a firehose of new articles. A great test of whether you can think in pipelines instead of in request-response.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-code-judging-system-like-leetcode" rel="noopener noreferrer"&gt;Design a code judging system like LeetCode&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Running untrusted code at scale is harder than it sounds. The architecture revolves around sandboxing, time and memory isolation, queue-based job dispatch, and aggressive result caching. A fun problem because every developer has used the system being designed.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ae5612526d454709fe4a" rel="noopener noreferrer"&gt;Design a code deployment system&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;How do you ship code from a git push to a thousand production servers without anyone noticing? Blue-green deploys, canary releases, automated rollback triggers, and the orchestration layer that ties them together.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ad569e786057b26267c2" rel="noopener noreferrer"&gt;Design a metrics and monitoring system like Datadog&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Time-series data has very different access patterns than general-purpose data, and the storage engines that handle it well — TSDB, columnar formats, hierarchical aggregation — are worth understanding even if you never build one yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949adc69e786057b2628579" rel="noopener noreferrer"&gt;Design LinkedIn connections&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Computing whether two users are connected through one, two, or three intermediate hops sounds easy. Doing it for a billion-user graph in under 100 milliseconds is one of the more elegant graph-precomputation problems on this list.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949adb09e786057b262829f" rel="noopener noreferrer"&gt;Design Facebook "People You May Know"&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The graph problem with a recommendation twist. You're not just finding friends-of-friends — you're ranking them by signals that have little to do with the graph itself, which means an offline pipeline lurks behind the scenes.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6945ac95716135e82b1744d4" rel="noopener noreferrer"&gt;Design Airbnb&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A two-sided marketplace with search, availability calendars, reservations, payments, and reviews. Each subsystem could be its own interview, but the value of doing it as a single problem is learning how the pieces fit together.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-a-reminder-alert-system" rel="noopener noreferrer"&gt;Design a reminder alert system&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Scheduling a billion future tasks efficiently is a problem nobody thinks about until they have to. The answer involves timing wheels, priority queues, and a careful consideration of what happens when a server hosting upcoming reminders crashes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tier 4 — Heavy hitters (18 questions)
&lt;/h2&gt;

&lt;p&gt;Now we're in deep water. These are the system design interview questions that demand real depth — in distributed systems, in storage internals, in financial correctness, or in the economics of moving petabytes around. Senior and staff candidates should be able to handle these confidently. Junior candidates can absolutely study them, but don't beat yourself up if the conversations feel slippery on a first pass.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/designing-youtube-or-netflix" rel="noopener noreferrer"&gt;Design YouTube or Netflix&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The original combined treatment of video streaming. Transcoding pipelines, adaptive bitrate streaming, and CDN economics dominate the conversation. This is where you learn that video is mostly a bandwidth problem dressed up as a software problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949abf9d5c46f6c243b8b1d" rel="noopener noreferrer"&gt;Design YouTube&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A standalone, modernized YouTube design with extra weight on live streaming, viewer engagement metrics, and recommendation serving. Use this to deepen the parts the original glossed over.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6945783f4e4ddd18faf08d17" rel="noopener noreferrer"&gt;Design Netflix&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Pure focus on Netflix-specific challenges: the Open Connect appliance program, the microservices tangle that powers the product, and the chaos engineering ethos that keeps the whole thing running during a Friday night peak.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6945b7f0d82e4a9c39a896b1" rel="noopener noreferrer"&gt;Design Google Search&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Crawling, indexing, ranking, serving, and personalization — the whole stack behind the world's most-used query bar. Few candidates can do this question full justice in 45 minutes, but having attempted it gives you a framework for any search-related problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ac567c4334fbab1661c6" rel="noopener noreferrer"&gt;Design a distributed cache like Redis&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Building a cache from scratch — sharding, replication, eviction, persistence, hot keys, and the nasty edge cases like cache stampedes. Mid-tier on the surface, but the conversation gets deep fast if your interviewer cares about durability.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ac6d12526d454709c9ac" rel="noopener noreferrer"&gt;Design a key-value store like DynamoDB&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The cache's grown-up sibling, with full durability requirements. Quorum reads and writes, anti-entropy mechanisms, vector clocks, hinted handoff — all the concepts the Dynamo paper introduced and that every NoSQL store has had to grapple with since.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/69444a9ce4092f77ed73eadf" rel="noopener noreferrer"&gt;Design Amazon S3&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The most durable storage system humans have ever built. Erasure coding, multi-region replication, the bucket-versus-key abstraction, and the strong-read-after-write semantics that make S3 such a reliable foundation for everything above it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/69444b86a565e7abd4231903" rel="noopener noreferrer"&gt;Design Amazon Lambda&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Container pools, predictive warming, multi-tenant isolation, and the per-millisecond billing math that makes serverless economically viable. A surprisingly complex system hiding behind a simple programming model.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949af90c75bc82e6c473d65" rel="noopener noreferrer"&gt;Design a distributed lock manager like Chubby&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Coordination primitives for distributed systems, done right. Paxos or Raft, lease management, fencing tokens, and the corrosive realization that "implementing distributed locks with Redis" is full of bugs nobody warned you about.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949afa57c4334fbab16d05b" rel="noopener noreferrer"&gt;Design a distributed job scheduler like cron&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A cron daemon is trivial. A globally distributed cron that fires each scheduled job exactly once, even when machines die mid-execution, is one of the hardest exactly-once problems in the canon.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-payment-system" rel="noopener noreferrer"&gt;Design a payment system&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Idempotency, double-entry bookkeeping, reconciliation, and the unforgiving truth that monetary correctness has zero tolerance for "eventually consistent." Get this right and you immediately sound like a senior engineer.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6943ab87368df96ed76edf35" rel="noopener noreferrer"&gt;Design the Stripe payment gateway&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The API-first cousin of the payment system question, with extra attention to webhooks, retries, idempotency keys, and the specific guarantees a payment processor offers to its merchants. Surprisingly hard if you've never thought about it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ad757c4334fbab16895b" rel="noopener noreferrer"&gt;Design Amazon shopping cart&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The original use case for Amazon Dynamo. The interesting question isn't how to store items in a cart — it's how to merge two carts that diverged on different devices, and why the answer involves accepting eventual consistency.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/design-a-flash-sale-for-an-ecommerce-site" rel="noopener noreferrer"&gt;Design a flash sale for an e-commerce site&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Inventory of 100 items. A million users hitting "buy" at the same instant. How do you protect the database, allocate items fairly, handle the inevitable losers gracefully, and not crash the entire site? One of the most operationally interesting questions on the list.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6943ab6677063849d7ec3733" rel="noopener noreferrer"&gt;Design Google Ads&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Real-time auctions, bid optimization, budget pacing, click tracking, and ad fraud detection. Easily the largest "design X" problem on this list by surface area, and the one most candidates underprepare for.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/6949ae2f9e786057b2628bba" rel="noopener noreferrer"&gt;Design an ad click aggregator&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A focused drill on the click-counting and deduplication piece of an ad system. Pure stream-processing territory, with all the exactly-once and late-arriving-data fun that implies.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/system-design-interview-crash-course/doc/69480903853d222b88ec9a10" rel="noopener noreferrer"&gt;Design a stock exchange&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Microsecond latency, deterministic ordering, and a regulator looking over your shoulder. The matching engine is the centerpiece, and even thinking about it for an hour will recalibrate your sense of what "fast" means in software.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-system-design-interview-ii/doc/youtube-counter" rel="noopener noreferrer"&gt;Design a YouTube likes counter&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A whole question about counting. Sounds dumb until you try to count millions of likes per second on a single video without losing data and without creating a single hot row that takes down your database. The answer is sharded counters, and it's beautiful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tier 5 — Real-world case studies (7 papers)
&lt;/h2&gt;

&lt;p&gt;The final tier is different from everything above it. These aren't open-ended "design X" questions — they're guided tours through real, production-scale systems whose papers and source code shaped modern infrastructure. At staff and principal interviews, an interviewer might casually ask, "How does Cassandra handle replication?" or "Why did Kafka choose a log-based design?" These case studies prepare you for exactly those moments.&lt;/p&gt;

&lt;p&gt;Treat them like papers, not like problems. Read slowly. Take notes. Come back to them.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/dynamo-introduction" rel="noopener noreferrer"&gt;Amazon Dynamo&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The paper that launched the NoSQL era. Consistent hashing, vector clocks, sloppy quorums, and Merkle-tree anti-entropy — every modern key-value store traces its lineage back to the ideas in this paper.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/cassandra-introduction" rel="noopener noreferrer"&gt;Apache Cassandra&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Dynamo's open-source descendant, reimagined with a wide-column data model and an LSM-tree storage engine. The case study walks you through gossip-based cluster management, tunable consistency, and the compaction process that keeps everything tidy.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/kafka-introduction" rel="noopener noreferrer"&gt;Apache Kafka&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The distributed log that became the spine of every modern event-driven architecture. Understand partitions, consumer groups, leader election, and the precise meaning of each delivery semantic — at-most-once, at-least-once, and the elusive exactly-once.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/chubby-introduction" rel="noopener noreferrer"&gt;Google Chubby&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The original distributed lock service that inspired ZooKeeper, etcd, and every coordination system built since. The most valuable lesson here isn't the Paxos implementation — it's the design philosophy behind preferring coarse-grained locking to fine-grained.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/google-file-system-introduction" rel="noopener noreferrer"&gt;Google File System&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A 2003 paper that made everyone reconsider what a filesystem had to be. Single master, 64MB chunks, weak consistency, optimization for append-heavy workloads — every design choice in GFS is a teaching moment.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/hadoop-distributed-file-system-introduction" rel="noopener noreferrer"&gt;Hadoop Distributed File System&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The open-source response to GFS. The interesting exercise is comparing the two side by side and noticing where the open-source community made different trade-offs than Google's internal team — and why.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.io/course-play/grokking-the-advanced-system-design-interview/doc/bigtable-introduction" rel="noopener noreferrer"&gt;Google BigTable&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The wide-column data model that influenced HBase, Cassandra, and the entire wave of column-family databases that followed. Beyond the data model, BigTable is a stunning example of system composition: it's built on top of GFS for storage and Chubby for coordination, and the architecture only makes sense when you understand both.&lt;/p&gt;




&lt;h2&gt;
  
  
  A final word: study tier by tier, not problem by problem
&lt;/h2&gt;

&lt;p&gt;Here's my advice if you do nothing else with this list:&lt;/p&gt;

&lt;p&gt;Pick one problem from each tier you need to master. Whiteboard it from scratch — no notes, no peeking. Then read the linked solution. Compare your design to theirs. Note every place you missed something, and write the missed concept on a separate sheet. That sheet, after a dozen problems, becomes your personal study guide. It's better than any list a stranger on the internet can give you, because it tells you exactly where &lt;em&gt;your&lt;/em&gt; gaps are.&lt;/p&gt;

&lt;p&gt;Repeat the process. Move up the tiers. By the time you've worked through 15 to 20 of the 64 system design interview questions on this list, you'll notice something strange: the new ones start to feel familiar before you even read the prompt. That's not memorization. That's the patterns clicking into place.&lt;/p&gt;

&lt;p&gt;And when the patterns click, the interview stops being scary. It becomes a conversation — one where you're the person with the toolbox, calmly picking the right tool for the problem in front of you.&lt;/p&gt;

&lt;p&gt;That's the goal. Good luck out there.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>softwaredevelopment</category>
      <category>interview</category>
      <category>ai</category>
    </item>
    <item>
      <title>20 Essential Coding Patterns to Ace Your Next Coding Interview</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Thu, 02 Nov 2023 00:41:53 +0000</pubDate>
      <link>https://dev.to/arslan_ah/20-essential-coding-patterns-to-ace-your-next-coding-interview-32a3</link>
      <guid>https://dev.to/arslan_ah/20-essential-coding-patterns-to-ace-your-next-coding-interview-32a3</guid>
      <description>&lt;p&gt;Navigating through coding interviews requires more than just a good grasp of algorithms and data structures; it demands a strategic approach and a keen eye for patterns. In todays competitive world of tech job interviews, understanding and mastering coding patterns can significantly enhance your problem-solving skills and boost your performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coding patterns, or as we like to call them, are recurring techniques that provide a structured approach to solving complex problems&lt;/strong&gt;. Think of them as the building blocks of algorithms, helping you to break down problems into more manageable parts.&lt;/p&gt;

&lt;p&gt;In this blog, we will explore 20 essential coding patterns that are pivotal for acing coding interviews. We will delve into the pros and cons of each pattern, providing you with a balanced view to help you make informed decisions during your interviews. And to top it off, we will equip you with real problem examples from the &lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt; course. I'm the author of this course, feel free to reach out to me if you have questions. &lt;/p&gt;

&lt;p&gt;Let's go through each pattern one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Two Pointers
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Two Pointers technique is a clever strategy used in algorithm design, particularly when dealing with arrays or linked lists. Imagine you have two fingers, and you place each at different ends or positions of an array. These ‘fingers’ or pointers then traverse through the array, helping you to compare, search, or even manipulate the data efficiently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn00zc8hdrzchlnllby5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn00zc8hdrzchlnllby5a.png" alt="Two Pointers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ordered Data Structures&lt;/strong&gt;: This pattern shines when applied to ordered arrays or lists, allowing for intelligent, position-based decisions that can significantly optimize the algorithm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt;: By reducing the need for nested loops, the Two Pointers technique helps in achieving linear time complexity, making your algorithm faster and more efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Achieves O(n) time complexity for problems that might otherwise require O(n^2).&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Simplicity&lt;/em&gt;: Once mastered, it provides a straightforward and elegant solution.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Applicability&lt;/em&gt;: Mainly beneficial for problems involving sequences or intervals.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Initial Complexity&lt;/em&gt;: It might take some time to get the hang of this pattern and understand where and how to move the pointers.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/638ca0aa5b41522e8a2e3395" rel="noopener noreferrer"&gt;Pair with Target Sum&lt;/a&gt;: Find a pair in an array that adds up to a specific target sum.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/638e39bd1756319ef156bebc" rel="noopener noreferrer"&gt;Squaring a Sorted Array&lt;/a&gt;: Given a sorted array, create a new array containing squares of all the numbers of the input array in the sorted order.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddad0980798b625e14ef14" rel="noopener noreferrer"&gt;Triplet Sum to Zero&lt;/a&gt;: Given an array of unsorted numbers, find all unique triplets in it that add up to zero.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2. Island (Matrix Traversal) Pattern
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Island pattern, also known as Matrix Traversal, is a technique used to navigate through a 2D array or matrix. The primary goal is to identify and process contiguous groups of elements, often referred to as ‘islands’. This pattern is particularly useful when you need to explore and manipulate grid-based data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfw3hf3mh5qp071cynkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfw3hf3mh5qp071cynkw.png" alt="Island (Matrix Traversal) Pattern"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Grid-Based Problems&lt;/strong&gt;: Excelling in problems where you need to traverse a grid to find connected components or regions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contiguous Elements&lt;/strong&gt;: Ideal for situations where you need to group together adjacent elements that share a common property.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Comprehensive&lt;/em&gt;: Provides a thorough way to explore all the elements in a grid.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatile&lt;/em&gt;: Can be used to solve a variety of problems related to 2D arrays.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Complexity&lt;/em&gt;: Can be more complex to implement compared to linear data structure traversal.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Overhead&lt;/em&gt;: May require additional space for recursion or queue/stack for breadth-first/depth-first traversal.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda29dee94a9f69d1cbef3" rel="noopener noreferrer"&gt;Number of Islands&lt;/a&gt;: Count the number of islands in a given 2D matrix.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda2d09bb0342f49ed249a" rel="noopener noreferrer"&gt;Biggest Island&lt;/a&gt;: Find the largest island in terms of area or number of cells.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda305ee94a9f69d1cd835" rel="noopener noreferrer"&gt;Flood Fill&lt;/a&gt;: Change the color of an image represented by a 2D array.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  3. Fast &amp;amp; Slow Pointers
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Fast &amp;amp; Slow Pointers technique involves two pointers traversing through a data structure at different speeds. This ingenious approach is particularly useful in identifying cycles, finding middle elements, and solving various other problems related to linked lists and arrays.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjucjsawtcnpyz85j08l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjucjsawtcnpyz85j08l.png" alt="Fast &amp;amp; Slow Pointers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cycle Detection&lt;/strong&gt;: Perfect for identifying cycles in a linked list or array, which is a common interview question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finding Middle Elements&lt;/strong&gt;: Efficiently find the middle element of a linked list without knowing the length beforehand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem-Specific Solutions&lt;/strong&gt;: Solve specific problems like finding the start of a cycle in a linked list.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Achieves solutions without the need for extra space, adhering to O(1) space complexity.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatility&lt;/em&gt;: Applicable to a variety of problems, making it a versatile pattern to know.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Initial Complexity&lt;/em&gt;: Understanding how to move the pointers and at what speed can be tricky at first.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Specificity&lt;/em&gt;: While versatile, it is mostly beneficial for problems related to linked lists and certain array problems.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda065488110f74a930ebc" rel="noopener noreferrer"&gt;LinkedList Cycle&lt;/a&gt;: Determine if a linked list has a cycle.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda1feee94a9f69d1cb026" rel="noopener noreferrer"&gt;Middle of the LinkedList&lt;/a&gt;: Find the middle node of a linked list.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda22b2f02a9827daaa00a" rel="noopener noreferrer"&gt;Palindrome LinkedList&lt;/a&gt;: Check if a linked list is a palindrome.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4. Sliding Window
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Sliding Window pattern involves creating a ‘window’ over a portion of data and sliding it across to solve problems efficiently. This technique is particularly useful for array or list-based problems where you need to find or calculate something among all the contiguous subarrays or sublists of a given size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvavb10griy4mja7tbsg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvavb10griy4mja7tbsg.png" alt="Sliding Window"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Contiguous Subarrays&lt;/strong&gt;: Ideal for problems that require you to deal with contiguous subarrays or sublists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variable Sized Window&lt;/strong&gt;: Can be adapted for problems where the window size is not fixed and needs to be adjusted based on certain conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a way to reduce time complexity from O(n^2) to O(n) for specific problems.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatility&lt;/em&gt;: Can be used for a variety of problems, including maximum sum subarray, smallest subarray with a given sum, and longest substring with K distinct characters.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Initial Complexity&lt;/em&gt;: Understanding how to adjust the window size and when to slide the window can be challenging initially.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Specificity&lt;/em&gt;: Mainly beneficial for problems involving contiguous subarrays or sublists.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd98d73b437c425266aa11" rel="noopener noreferrer"&gt;Maximum Sum Subarray of Size K&lt;/a&gt;: Given an array of positive numbers and a positive number ‘k’, find the maximum sum of any contiguous subarray of size ‘k’.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd9abf488110f74a92a47d" rel="noopener noreferrer"&gt;Fruits Into Baskets&lt;/a&gt;: Given an array of characters where each character represents a fruit tree, you are given two baskets, and your goal is to put maximum number of fruits in each basket.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd9a7261dc5307bdb7918a" rel="noopener noreferrer"&gt;Longest Substring with K Distinct Characters&lt;/a&gt;: Given a string, find the length of the longest substring in it with no more than K distinct characters.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  5. Merge Intervals
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Merge Intervals pattern is a powerful technique used to deal with overlapping intervals or ranges. It involves sorting and then merging intervals based on specific conditions. This pattern is incredibly useful for time-based problems, scheduling, and range manipulation.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Overlapping Intervals&lt;/strong&gt;: Perfect for problems where you need to merge overlapping intervals or find if an interval overlaps with any other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interval Scheduling&lt;/strong&gt;: Useful for problems that involve scheduling based on time intervals.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Clarity&lt;/em&gt;: Provides a clear and systematic way to deal with overlapping intervals.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Helps in reducing the problem complexity and achieving optimal solutions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Sorting Overhead&lt;/em&gt;: Requires the intervals to be sorted beforehand, which could add to the time complexity.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Specificity&lt;/em&gt;: Mainly beneficial for problems involving intervals and ranges.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd974b61dc5307bdb78545" rel="noopener noreferrer"&gt;Merge Intervals&lt;/a&gt;: Given a list of intervals, merge all the overlapping intervals to produce a list that has only mutually exclusive intervals.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd97a861dc5307bdb7890e" rel="noopener noreferrer"&gt;Insert Interval&lt;/a&gt;: Given a list of non-overlapping intervals sorted by their start time, insert a given interval at the correct position and merge all necessary intervals to produce a list that has only mutually exclusive intervals.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dd97e13b437c4252668d2a" rel="noopener noreferrer"&gt;Intervals Intersection&lt;/a&gt;: Given two lists of intervals, find the intersection of these two lists. Each list consists of disjoint intervals sorted on their start time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  6. Cyclic Sort
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;Cyclic Sort is a unique and intuitive sorting algorithm, particularly well-suited for problems where you are given a range of numbers and asked to sort them. The beauty of this pattern lies in its ability to sort the numbers in-place, utilizing the fact that the numbers are consecutive or have a specific range.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consecutive Numbers&lt;/strong&gt;: Ideal for scenarios where you have an array of numbers in a specific range, and you need to sort them or find missing/duplicate numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In-Place Sorting&lt;/strong&gt;: Provides a way to sort the numbers without using any extra space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Achieves sorting without the need for additional space, adhering to O(1) space complexity.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Time Efficiency&lt;/em&gt;: Offers a linear time complexity solution for specific range-based sorting problems.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Limited Applicability&lt;/em&gt;: Best suited for problems involving numbers in a specific range and may not be applicable for other types of sorting problems.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Initial Learning Curve&lt;/em&gt;: Understanding the cyclic sort pattern and knowing when to apply it can take some time.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Find the Missing Number&lt;/a&gt;: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Find all Duplicates&lt;/a&gt;: Find all the duplicate numbers (without using extra space and in O(n) runtime).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Duplicates In Array&lt;/a&gt;: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  7. In-place Reversal of a Linked List
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The In-place Reversal of a Linked List pattern is a technique used to reverse the elements of a linked list without using additional memory. This is achieved by manipulating the pointers of the nodes in the linked list to reverse their direction.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Memory Efficiency&lt;/strong&gt;: Since no additional data structures are used, this pattern is memory efficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reversing Sub-lists&lt;/strong&gt;: Can be extended to reverse sub-lists within a linked list, providing versatility in solving more complex problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Achieves in-place reversal, ensuring O(1) space complexity.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatility&lt;/em&gt;: Can be used to solve various problems related to linked lists, including reversing sub-lists and finding palindromes.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Pointer Manipulation&lt;/em&gt;: Requires careful manipulation of pointers, which can be error-prone.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Initial Learning Curve&lt;/em&gt;: Understanding how to reverse the pointers without losing the rest of the linked list can be challenging initially.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Reverse a LinkedList&lt;/a&gt;: Given the head of a Singly LinkedList, reverse the LinkedList.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Reverse a Sub-list&lt;/a&gt;: Given the head of a LinkedList and two positions ‘p’ and ‘q’, reverse the LinkedList from position ‘p’ to ‘q’.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Reverse Every K-element Sub-list&lt;/a&gt;: Given the head of a LinkedList and a number ‘k’, reverse every ‘k’ sized sub-list starting from the head.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  8. Tree Breadth First Search
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Tree Breadth First Search (BFS) pattern involves traversing a tree level by level, ensuring that you visit all the nodes at the current depth before moving on to the nodes at the next depth level. This is usually implemented using a queue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nc0kcs56yc0mp7s4jev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nc0kcs56yc0mp7s4jev.png" alt="Tree Breadth First Search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Level Order Traversal&lt;/strong&gt;: Ideal for problems that require you to traverse a tree in level order or when you need to perform operations on nodes at the same depth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimum Depth&lt;/strong&gt;: Useful for finding the minimum depth of a tree, as you can stop the traversal once you find the first leaf node.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Complete Traversal&lt;/em&gt;: Ensures that every node in the tree is visited.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Level Order Information&lt;/em&gt;: Provides information about the depth or level of each node.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Overhead&lt;/em&gt;: Requires additional space for the queue, which can be as large as the number of nodes at the largest level.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Not as Efficient for Depth-Related Queries&lt;/em&gt;: For problems that depend on depth information, a depth-first search might be more efficient.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Binary Tree Level Order Traversal&lt;/a&gt;: Traverse a tree in level order and return the values of the nodes at each level.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Reverse Level Order Traversal&lt;/a&gt;: Traverse a tree in reverse level order.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Zigzag Traversal&lt;/a&gt;: Traverse a tree in a zigzag order.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  9. Tree Depth First Search
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Tree Depth First Search (DFS) pattern involves traversing a tree in a depth-first manner, meaning you go as deep as possible down one branch before backing up and exploring other branches. This is typically implemented using recursion or a stack.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Path Finding&lt;/strong&gt;: Ideal for problems where you need to find a path or check the existence of a path with certain properties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex Tree Traversals&lt;/strong&gt;: Useful for more complex tree traversal problems where you need to maintain state or perform operations as you traverse.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: For a balanced tree, DFS uses less space than BFS.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Simplicity&lt;/em&gt;: Recursive implementations can be more straightforward and concise.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Can Be Less Efficient for Wide Trees&lt;/em&gt;: For very wide trees, DFS can use more space than BFS.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;May Not Find the Shortest Path&lt;/em&gt;: If you're looking for the shortest path in an unweighted tree, BFS is generally a better choice.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Binary Tree Path Sum&lt;/a&gt;: Given a binary tree and a number ‘S’, find if the tree has a path from root-to-leaf such that the sum of all the node values of that path equals ‘S’.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;All Paths for a Sum&lt;/a&gt;: Find all root-to-leaf paths in a binary tree that have a sum equal to a given number.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Count Paths for a Sum&lt;/a&gt;: Find the number of paths in a tree that sum up to a given value.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  10. Two Heaps
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Two Heaps pattern involves using two priority queues (heaps) to maintain a running balance or median of a set of numbers. One heap keeps track of the smaller half of the numbers, and the other keeps track of the larger half.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Running Median&lt;/strong&gt;: Perfect for problems where you need to find the median of a set of numbers as new numbers are added.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balanced Partition&lt;/strong&gt;: Useful for problems where you need to maintain a balanced partition of numbers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a way to efficiently find the median or maintain balance in O(log N) time.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Dynamic&lt;/em&gt;: Can handle dynamic datasets where numbers are added over time.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Complexity&lt;/em&gt;: Implementation can be more complex due to the need to balance the two heaps.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Overhead&lt;/em&gt;: Requires additional space to store the numbers in the heaps.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Find the Median of a Number Stream&lt;/a&gt;: Design a class to calculate the median of a number stream.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Sliding Window Median&lt;/a&gt;: Find the median of all subarrays of size ‘K’ in the array.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Maximize Capital&lt;/a&gt;: Given a set of investment projects with their respective profits, we need to find the most profitable projects. We are given an initial capital and are allowed to invest only in a fixed number of projects. Our goal is to choose projects that give us the maximum profit.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  11. Subsets
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Subsets pattern involves dealing with problems that require generating all possible combinations or subsets of a set. This pattern is particularly useful when you need to explore all the different ways to combine elements, which is a common scenario in many coding problems.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Combinatorial Problems&lt;/strong&gt;: Ideal for problems where you need to generate all possible combinations of elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exhaustive Search&lt;/strong&gt;: Useful when you need to perform an exhaustive search over all possible subsets of a set.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Comprehensive&lt;/em&gt;: Ensures that you consider all possible combinations of elements.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatile&lt;/em&gt;: Can be used to solve a variety of problems, including generating power sets, combinations, and permutations.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Time Complexity&lt;/em&gt;: Can lead to exponential time complexity, as the number of subsets of a set is 2^N.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Complexity&lt;/em&gt;: Requires additional space to store all the subsets.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Subsets&lt;/a&gt;: Given a set with distinct elements, find all of its distinct subsets.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Subsets With Duplicates&lt;/a&gt;: Given a set of numbers that might contain duplicates, find all of its distinct subsets.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Permutations&lt;/a&gt;: Given a set of distinct numbers, find all of its permutations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  12. Modified Binary Search
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Modified Binary Search pattern involves adapting the classic binary search algorithm to solve various problems, often related to searching in a sorted array or finding the boundary of a condition.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sorted Arrays&lt;/strong&gt;: Perfect for problems involving searching or making decisions based on sorted arrays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finding Boundaries&lt;/strong&gt;: Useful for finding the start or end of a condition in a sorted array.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a logarithmic time complexity solution for searching problems, making it highly efficient.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Versatility&lt;/em&gt;: Can be adapted to solve a wide range of problems beyond simple searching.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Applicability&lt;/em&gt;: Mainly beneficial for problems involving sorted arrays or conditions with clear boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Implementation Nuances&lt;/em&gt;: Requires careful implementation to handle edge cases and avoid infinite loops.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Order-agnostic Binary Search&lt;/a&gt;: Given a sorted array of numbers, find the index of a given number. The array could be sorted in ascending or descending order.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Ceiling of a Number&lt;/a&gt;: Given an array of numbers sorted in ascending order, find the ceiling of a given number. The ceiling of a number is the smallest number in the given array greater than or equal to the given number.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Next Letter&lt;/a&gt;: Given an array of lowercase letters sorted in ascending order, find the smallest letter in the given array greater than a given ‘key’.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  13. Bitwise XOR
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Bitwise XOR pattern involves using the XOR bitwise operator to solve problems, often related to finding missing numbers or duplicate numbers in an array. XOR is a binary operator that returns 1 when the two bits are different and 0 when they are the same.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Finding Missing or Duplicate Numbers&lt;/strong&gt;: Ideal for problems where you need to find a missing number or duplicate numbers in an array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bit Manipulation&lt;/strong&gt;: Useful for problems that require manipulation of bits to achieve the desired result.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a constant space solution for certain problems, making it highly efficient.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Simplicity&lt;/em&gt;: Once understood, the XOR operator can be used to create elegant and simple solutions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Specificity&lt;/em&gt;: Mainly beneficial for problems involving finding missing or duplicate numbers.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Learning Curve&lt;/em&gt;: Understanding how the XOR operator works and when to use it can take some time.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Single Number&lt;/a&gt;: In a non-empty array of integers, every number appears twice except for one, find that single number.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Two Single Numbers&lt;/a&gt;: In a non-empty array of numbers, every number appears exactly twice except two numbers that appear only once. Find the two numbers that appear only once.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Complement of Base 10 Number&lt;/a&gt;: For a given positive number N in base-10, return the complement of its binary representation as a base-10 integer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  14. Top 'K' Elements
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The Top 'K' Elements pattern involves finding the 'K' largest or smallest elements in an array or stream of data. This pattern is particularly useful when dealing with large datasets and you need to maintain a subset of the data based on certain criteria.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Priority Queue&lt;/strong&gt;: Utilizes a min-heap or max-heap to efficiently keep track of the 'K' largest or smallest elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming Data&lt;/strong&gt;: Ideal for scenarios where the data is streaming in, and you need to maintain the 'K' largest or smallest elements at any given time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a way to find the 'K' largest or smallest elements in O(N log K) time.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Only requires O(K) space, regardless of the size of the dataset.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Limited to 'K' Elements&lt;/em&gt;: Only maintains information about the top 'K' elements, not the entire dataset.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Heap Maintenance&lt;/em&gt;: Requires careful maintenance of the heap to ensure efficiency.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Top 'K' Numbers&lt;/a&gt;: Given an unsorted array of numbers, find the ‘K’ largest numbers in it.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Kth Smallest Number&lt;/a&gt;: Given an unsorted array of numbers, find the Kth smallest number in it.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;‘K’ Closest Points to the Origin&lt;/a&gt;: Given an array of points in the a 2D plane, find ‘K’ closest points to the origin.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  15. K-way Merge
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The K-way Merge pattern involves merging multiple sorted arrays or lists into a single sorted list. This pattern is highly useful in scenarios where you have multiple sorted datasets that you need to combine and maintain the sorted order.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Sorted Arrays&lt;/strong&gt;: Ideal for merging multiple sorted arrays or lists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;External Sorting&lt;/strong&gt;: Useful in external sorting, where the data to be sorted does not fit into memory and is stored in sorted chunks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a way to merge multiple sorted arrays in O(N log K) time, where ‘N’ is the total number of elements across all arrays, and ‘K’ is the number of arrays.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Only requires O(K) space for the priority queue.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Dependent on Sorting&lt;/em&gt;: The efficiency of this pattern depends on the arrays being sorted.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Priority Queue Overhead&lt;/em&gt;: Requires maintenance of a priority queue, which adds to the complexity.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Merge K Sorted Lists&lt;/a&gt;: Given an array of ‘K’ sorted LinkedLists, merge them into one sorted list.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Kth Smallest Number in M Sorted Lists&lt;/a&gt;: Given ‘M’ sorted arrays, find the K’th smallest number among all the arrays.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Find the Smallest Range Covering Elements from K Lists&lt;/a&gt;: Given ‘M’ sorted arrays, find the smallest range that includes at least one number from each of the ‘M’ lists.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  16. Topological Sort
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;Topological Sort is a pattern used for linearly ordering the vertices of a directed graph in such a way that for every directed edge (U, V), vertex U comes before V. This pattern is particularly useful in scenarios where you have a set of tasks and some tasks depend on others.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Task Scheduling&lt;/strong&gt;: Ideal for problems where tasks need to be scheduled in a specific order, respecting their dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Course Scheduling&lt;/strong&gt;: Useful in scenarios like course scheduling where some courses have prerequisites.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Clarity&lt;/em&gt;: Provides a clear and systematic way to order tasks or vertices.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Detecting Cycles&lt;/em&gt;: Helps in detecting cycles in a directed graph, which is important for understanding if a valid ordering is possible.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Applicability&lt;/em&gt;: Mainly beneficial for problems involving directed graphs and ordering of vertices.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Complexity&lt;/em&gt;: Implementation can be complex, especially for beginners.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Topological Sort&lt;/a&gt;: Given a directed graph, find the topological ordering of its vertices.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Tasks Scheduling&lt;/a&gt;: Find if it is possible to schedule all the tasks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Tasks Scheduling Order&lt;/a&gt;: Find the order of tasks we should pick to finish all tasks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  17. Trie
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;A Trie, also known as a prefix tree, is a tree-like data structure used to store a dynamic set of strings, where the keys are usually strings. It is particularly useful for retrieval of a key in a dataset of strings, which makes it highly efficient for solving word-based problems.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autocomplete&lt;/strong&gt;: Ideal for implementing autocomplete functionality in search engines or text editors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spell Checker&lt;/strong&gt;: Useful for building spell checkers in word processors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Routing&lt;/strong&gt;: Used in IP routing to store and search routes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides fast retrieval of strings and is more efficient than hash tables or sets when it comes to string keys.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Prefix Searching&lt;/em&gt;: Excellent for problems that require prefix searching or matching.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Space Overhead&lt;/em&gt;: Can use more space compared to other data structures when the dataset is sparse.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Complexity&lt;/em&gt;: Implementation can be complex, especially when handling deletion of words from the Trie.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Insert into and Search in a Trie&lt;/a&gt;: Implement insertion and search in a Trie.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Longest Common Prefix&lt;/a&gt;: Find the longest common prefix of a set of strings.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Word Search&lt;/a&gt;: Given a 2D board and a word, find if the word exists in the grid.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  18. Backtracking
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;Backtracking is a general algorithmic technique that considers searching through all the possible configurations of a search space in order to solve computational problems. It is particularly useful for optimization problems and when a complete search of the solution space is required. The main idea is to explore each possibility until the solution is found or all possibilities have been exhausted.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Combinatorial Problems&lt;/strong&gt;: Ideal for solving problems that require generating all possible configurations like permutations, combinations, and subsets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Puzzle Solving&lt;/strong&gt;: Useful for solving puzzles such as Sudoku, crossword puzzles, and the N-Queens problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Completeness&lt;/em&gt;: Ensures that the entire solution space is explored, guaranteeing that the optimal solution will be found if it exists.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Space Efficiency&lt;/em&gt;: Uses less memory as it only needs to store the current state and the decision stack.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Time Complexity&lt;/em&gt;: Can lead to exponential time complexity, as it explores all possible configurations.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Optimization Required&lt;/em&gt;: May require additional optimizations like pruning to be practical for larger instances.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Subsets&lt;/a&gt;: Given a set of numbers, find all of its subsets.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Permutations&lt;/a&gt;: Given a set of distinct numbers, find all of its permutations.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;N-Queens&lt;/a&gt;: Place N queens on an N×N chessboard so that no two queens threaten each other.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  19. Monotonic Stack
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;A Monotonic Stack is a specialized data structure that maintains elements in a sorted order while supporting stack operations. It is particularly useful for problems where you need to find the next greater or smaller element in an array or when you need to maintain a running maximum or minimum value efficiently.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next Greater Element&lt;/strong&gt;: Ideal for finding the next greater element for each element in an array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maximum Area Histogram&lt;/strong&gt;: Useful for problems like finding the largest rectangular area under a histogram.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Efficiency&lt;/em&gt;: Provides a way to solve certain problems in linear time, making it highly efficient.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Simplicity&lt;/em&gt;: Once understood, the monotonic stack can lead to concise and elegant solutions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Specificity&lt;/em&gt;: Mainly beneficial for problems involving finding the next greater or smaller element and related problems.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Learning Curve&lt;/em&gt;: Understanding how and when to use a monotonic stack can take some time.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Next Greater Element&lt;/strong&gt;: Given an array, find the next greater element for each element in the array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maximum Area Histogram&lt;/strong&gt;: Given a histogram, find the largest rectangular area under the histogram.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Largest Rectangle in Histogram&lt;/strong&gt;: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  20. 0/1 Knapsack (Dynamic Programming)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Description
&lt;/h4&gt;

&lt;p&gt;The 0/1 Knapsack problem is a classic optimization problem that falls under the category of Dynamic Programming. In this problem, you are given a set of items, each with a weight and a value, and a knapsack with a maximum capacity. The goal is to determine the maximum value that can be accommodated in the knapsack without exceeding its capacity. The "0/1" part of the name reflects the fact that you can't break an item, you either take it or leave it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resource Allocation&lt;/strong&gt;: Ideal for problems where you need to optimally allocate limited resources to maximize profit or minimize cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budgeting&lt;/strong&gt;: Useful for budgeting scenarios where you need to choose a subset of projects or investments to maximize return.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Pros and Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Optimality&lt;/em&gt;: Ensures that the optimal solution is found, provided that the problem satisfies the principle of optimality.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Generality&lt;/em&gt;: Can be adapted to solve a wide variety of optimization problems.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cons&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Time and Space Complexity&lt;/em&gt;: The naive implementation has a time and space complexity of O(nW), where n is the number of items and W is the capacity of the knapsack. This can be prohibitive for large inputs.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Requires Integer Weights and Values&lt;/em&gt;: The classic 0/1 Knapsack problem requires weights and values to be integers.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example Problems from Grokking the Coding Interview
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;0/1 Knapsack&lt;/a&gt;: Given the weights and profits of ‘N’ items, put these items in a knapsack which has a capacity ‘C’. The goal is to get the maximum profit out of the items in the knapsack.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Equal Subset Sum Partition&lt;/a&gt;: Given a set of positive numbers, find if we can partition it into two subsets such that the sum of elements in both subsets is equal.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63ddacd4fcc4ca873d5fbfbc" rel="noopener noreferrer"&gt;Subset Sum&lt;/a&gt;: Given a set of positive numbers, determine if there exists a subset in the set whose sum is equal to a given number ‘S’.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Mastering these patterns is definitely not about memorizing solutions; it’s about understanding the underlying principles and learning how to apply them to a wide array of problems. The versatility of these &lt;a href="https://medium.com/javascript-in-plain-english/unlocking-the-secrets-of-leetcode-coding-patterns-5cec7b32438b" rel="noopener noreferrer"&gt;patterns&lt;/a&gt; ensures that you are well-equipped to handle different challenges, making you a formidable candidate in any coding interview.&lt;/p&gt;

&lt;p&gt;Remember, practice is key. The more problems you solve using these patterns, the more proficient you will become in recognizing problem types and applying the appropriate patterns. So, keep practicing, stay persistent, and you will find yourself excelling in coding interviews, ready to tackle any problem that comes your way.&lt;/p&gt;

&lt;p&gt;Want to read more about coding patterns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://medium.com/gitconnected/dont-just-leetcode-follow-the-coding-patterns-instead-4beb6a197fdb" rel="noopener noreferrer"&gt;Don’t Just LeetCode; Follow the Coding Patterns Instead&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/blog/top-lc-patterns" rel="noopener noreferrer"&gt;Top LeetCode Patterns for FAANG Coding Interviews&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/course/grokking-dynamic-programming" rel="noopener noreferrer"&gt;Grokking Dynamic Programming Patterns for Coding Interviews&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>coding</category>
      <category>interview</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
    <item>
      <title>Key Steps to Prepare for a Software Engineer Interview</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Fri, 25 Aug 2023 23:23:17 +0000</pubDate>
      <link>https://dev.to/arslan_ah/key-steps-to-prepare-for-a-software-engineer-interview-52ll</link>
      <guid>https://dev.to/arslan_ah/key-steps-to-prepare-for-a-software-engineer-interview-52ll</guid>
      <description>&lt;h2&gt;
  
  
  1. Deciphering Software Engineering Interviews
&lt;/h2&gt;

&lt;p&gt;Before diving deep into coding exercises or system design preparation, it's vital to understand the essence of a software engineering interview. It’s not just about testing your coding skills, but also about understanding if you fit the company's culture and can contribute to its objectives.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are Hiring Managers Looking For in a Software Engineer?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem-solving skills:&lt;/strong&gt; The crux of any software engineering role is to solve problems. Hiring managers are on the lookout for individuals who can break down a complex problem, approach it logically, and find a suitable solution. A 2020 survey conducted by LinkedIn highlighted that problem-solving topped the list of soft skills desired by employers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical prowess:&lt;/strong&gt; Employers wish to see a good command over programming languages and tools. They want candidates who can adapt to new technologies, as the tech landscape is ever-evolving. In a Stack Overflow Developer Survey, more than 75% of developers believed that learning new technologies is an essential part of their job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Team Collaboration:&lt;/strong&gt; Software development is rarely a solo endeavor. Engineers frequently collaborate with different teams, from UI/UX designers to product managers. Hence, your ability to work in a team and communicate effectively can make you stand out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cultural fit:&lt;/strong&gt; Every company has its own culture and values. Hiring managers often gauge whether a candidate would fit into their work environment and resonate with the company’s ethos. &lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Software Engineer Interviews
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Coding Interviews:&lt;/strong&gt; These assess your technical coding skills. You may be asked to write a piece of code, debug, or solve algorithms. Websites like &lt;a href="//leetcode.com"&gt;LeetCode&lt;/a&gt; and &lt;a href="//designgurus.io"&gt;Design Gurus&lt;/a&gt; have popularized such problems, preparing aspirants for FAANG and other top tech company interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Design Interviews:&lt;/strong&gt; Here, you're usually posed with designing a system or architecture. It tests your broader understanding of system components and how they interact. Check the following article for a detailed discussion on system design interview: &lt;a href="https://www.designgurus.io/blog/system-design-interview-guide"&gt;Demystifying System Design Interviews: A Guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Behavioral Interviews:&lt;/strong&gt; This focuses on your past experiences, behavior in certain scenarios, and how you deal with challenges or conflicts. They gauge your soft skills and are a predictor of how you'd fit into the company's culture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical Screening:&lt;/strong&gt; Before an in-depth interview, many companies have a technical screening round, usually over the phone or through platforms like Codility. This is a preliminary check to see if you possess the basic technical skills required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take-home Assignments:&lt;/strong&gt; Some companies provide assignments that you must complete at home. These give a more extended window (like a week) and are beneficial for employers to see how you approach real-world tasks.&lt;/p&gt;

&lt;p&gt;To conclude, while strong technical skills are a necessity, soft skills and a keen understanding of what hiring managers are looking for can provide the edge you need to stand out.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Preparing for the Technical Aspects of the Interview
&lt;/h2&gt;

&lt;p&gt;Understanding the technical intricacies is pivotal for any software engineer. The coding interview can be a battleground, and the right preparation is your armor. Let's simplify how to tackle this.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Long It Takes to Prepare For a Technical Engineering Interview
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Time is subjective:&lt;/strong&gt; On average, dedicated aspirants spend 2-4 months preparing for technical interviews at top-tier companies. However, remember, it's not about the number of hours but the quality of your preparation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistency is key:&lt;/strong&gt; Like any skill, consistent practice hones your coding acumen. Spending even an hour daily on platforms like LeetCode can help you grasp patterns and improve speed. A survey from 2019 on CodeSignal revealed that candidates who practiced regularly, even for short durations, had a 20% higher success rate in interviews compared to intermittent learners.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choosing a Programming Language
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Stick to what you know:&lt;/strong&gt; For coding interviews, it's advisable to pick a language you’re most comfortable with. Most companies are language-agnostic in interviews, prioritizing logic and problem-solving over syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular choices:&lt;/strong&gt; While it's about comfort, languages like Python, Java, and JavaScript often emerge as favorites. Python's readability and simplicity make it a go-to choice for many. In fact, according to the PYPL (PopularitY of Programming Language) Index, Python's popularity grew by 18.9% in 2020, showcasing its rising prominence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Key Concepts: Arrays, Linked Lists, Hash Tables, etc.
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Arrays:&lt;/strong&gt; They are fundamental data structures that store elements of the same type. Understanding their operations, such as insertion, deletion, and traversal, is critical. Did you know? Almost 25% of problems on LeetCode are array-based!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linked Lists:&lt;/strong&gt; Unlike arrays, linked lists have nodes connected by pointers. Mastering their types (singly, doubly) and operations can set you on the right track.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hash Tables:&lt;/strong&gt; This data structure is vital for optimizing solutions. They store key-value pairs and provide quick access, making them indispensable for problems involving frequencies or grouping. A fun fact – Hash tables are so versatile that their use-cases span from database indexing to caching!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regular Practice:&lt;/strong&gt; These are just a few key concepts, and the realm of data structures and algorithms is vast. Regularly practicing and internalizing these structures can dramatically improve your problem-solving skills. According to GeeksforGeeks, understanding these basic data structures can help in solving around 70% of the coding problems in interviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. System Design and Behavioral Interview Preparation
&lt;/h2&gt;

&lt;p&gt;Beyond algorithms and code, a comprehensive interview prep must address &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview"&gt;system design&lt;/a&gt; and &lt;a href="https://www.designgurus.io/course/grokking-behavioral-interview"&gt;behavioral questions&lt;/a&gt;. Let's unpack these aspects to ensure you present a holistic version of yourself in the interview.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparing for Behavioral Questions: The STAR Format
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why Behavioral Questions Matter:&lt;/strong&gt; &lt;a href="https://medium.com/javascript-in-plain-english/acing-behavioral-questions-in-tech-interviews-tips-and-techniques-a9d19cf76a06"&gt;Behavioral questions&lt;/a&gt; might feel less technical, but they're just as vital. Companies are keen on understanding your experiences, decision-making process, and how you handle challenges. After all, a great coder with poor interpersonal skills might not be an asset in team projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The STAR Technique:&lt;/strong&gt; This is your &lt;a href="https://www.designgurus.io/course-play/grokking-behavioral-interview/doc/6415b5807671427224ce4d1c"&gt;secret weapon&lt;/a&gt; to nail behavioral questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0paoSld5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slsjco21uuoqpefh0ou9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0paoSld5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slsjco21uuoqpefh0ou9.png" alt="STAR method" width="645" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Situation:&lt;/strong&gt; Begin by describing the context or backdrop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task:&lt;/strong&gt; What were you responsible for?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Detail the specific steps you took to address the task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; Conclude with the outcome of your actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, when asked about a time you faced a tight deadline, you could discuss a project, explain your responsibility, describe how you prioritized tasks, and finally, share the successful completion or lessons learned. &lt;a href="https://www.designgurus.io/course-play/grokking-behavioral-interview/doc/6415b8187671427224ce4fdf"&gt;solution&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A CareerBuilder survey highlighted that 62% of employers are looking for candidates who can effectively communicate – and using the STAR format is an excellent method to demonstrate this ability.&lt;/p&gt;

&lt;h3&gt;
  
  
  On-Site Interview: Personality Questions and Skill Tests
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The All-Encompassing On-Site:&lt;/strong&gt; After initial rounds, many companies invite candidates for an on-site interview. This comprehensive round aims to assess both your technical prowess and personality fit. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Personality Questions:&lt;/strong&gt; Here, interviewers want to gauge how well you'd mesh with the company culture. They might ask about your preferred work environment, teamwork experiences, or how you handle criticism. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skill Tests:&lt;/strong&gt; While earlier rounds test foundational skills, on-site rounds might involve deeper dives into specialized areas. For instance, if you're applying for a web developer role, you might be asked to critique a website's design or pinpoint performance bottlenecks.&lt;/p&gt;

&lt;p&gt;A tip to remember: on-site interviews can be draining. A study by Glassdoor indicated that software engineer interviews, especially at top tech companies, can last more than two hours. So, ensure you’re well-rested and hydrated!&lt;/p&gt;

&lt;p&gt;To sum up this section, while technical skills can get your foot in the door, your behavioral responses and on-site performance can seal the deal. Approach them with the same rigor as you would a coding challenge. The more holistic your preparation, the better equipped you are to impress potential employers!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Commonly Asked Interview Questions for Software Engineers
&lt;/h2&gt;

&lt;p&gt;Cracking a software engineering interview often requires familiarity with frequently asked questions. While each interview can be unique, several core questions test foundational skills and thought processes. Let's unravel some of these typical questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm Challenges:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Given an array of integers, find two numbers such that they add up to a specific target number." &lt;a href="https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63dda46a2f02a9827daabd4c"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Given a positive integer, check if it is a prime number or not." &lt;a href="https://www.designgurus.io/course-play/grokking-recursion/doc/64ab9a845bc16cae75bee262"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Given a stair with 'n' steps, implement a method to count how many possible ways are there to reach the top of the staircase, given that, at every step you can either take 1 step, 2 steps, or 3 steps." &lt;a href="https://www.designgurus.io/course-play/grokking-dynamic-programming/doc/64c39bef6d1933f7dbc98177"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why they're asked:&lt;/strong&gt; These gauge your algorithmic thinking and problem-solving prowess. Such questions assess if you can develop efficient solutions to common coding challenges.&lt;/p&gt;

&lt;p&gt;Check &lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview"&gt;Grokking the Coding Interview&lt;/a&gt; for top coding patterns for interviews.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sBkVHmf6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8iaewjxgp9xy5p5po5zu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sBkVHmf6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8iaewjxgp9xy5p5po5zu.png" alt="Grokking the Coding Interview" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Structures:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Explain the difference between a stack and a queue."&lt;/li&gt;
&lt;li&gt;"How would you implement a hash table?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Insight:&lt;/strong&gt; Data structures are the backbone of software engineering. Employers want to ensure you have a firm grip on these concepts, as they play a pivotal role in real-world applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Databases:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Can you explain the difference between SQL and NoSQL?"&lt;/li&gt;
&lt;li&gt;"How would you optimize a slow-performing query?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; As data drives decisions in today's digital age, knowledge of databases is imperative. These questions assess your understanding of data storage, retrieval, and optimization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conceptual and Design Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Software Design Patterns:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"Can you explain the Singleton pattern and its use cases?"&lt;/li&gt;
&lt;li&gt;"What’s the difference between MVC and MVVM patterns?"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; These questions aim to understand if you're aware of established patterns that streamline software development, ensuring consistency and efficiency.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;System Design:&lt;/strong&gt; 

&lt;ul&gt;
&lt;li&gt;"How would you design a scalable global chat system like WhatsApp or Facebook Messenger?" &lt;a href="https://www.designgurus.io/course-play/grokking-the-system-design-interview/doc/638c0b65ac93e7ae59a1afe5"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;"Describe the architecture you'd suggest for an e-commerce platform." &lt;a href="https://www.designgurus.io/course-play/grokking-the-object-oriented-design-interview/doc/637e7b54a29bb837e0c029d6"&gt;solution&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Understanding:&lt;/strong&gt; &lt;a href="https://medium.com/gitconnected/10-system-design-interview-questions-with-answers-i-wished-i-knew-before-the-interview-31dcfc3cddef"&gt;System design questions&lt;/a&gt; evaluate your broader perspective on software. They're not just about writing code but about how different components interact in a system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Soft Skill and Behavioral Questions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Teamwork and Collaboration:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Describe a time when you disagreed with a team member. How did you resolve it?"&lt;/li&gt;
&lt;li&gt;"Tell me about a challenging team project and your role in it."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Rationale:&lt;/strong&gt; Companies are keen on team players. These questions gauge your ability to collaborate, communicate, and sometimes, compromise for the greater good.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Motivation and Passion:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Why did you choose a career in software engineering?"&lt;/li&gt;
&lt;li&gt;"What coding project are you most proud of, and why?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Reason:&lt;/strong&gt; Passion often drives excellence. Interviewers want to see if you're genuinely enthusiastic about coding and if you'll bring that zest to the workplace.&lt;/p&gt;

&lt;p&gt;To sum up, while technical prowess is vital, a holistic approach to these questions can set you apart. It's not always about the right answer but the journey you take to arrive there. Stay informed, practice regularly, and always approach questions with a problem-solving mindset. Remember, each question is an opportunity to showcase your expertise and passion!&lt;/p&gt;

&lt;h2&gt;
  
  
  Acing the Coding and Whiteboard Exercises
&lt;/h2&gt;

&lt;p&gt;In the realm of software engineering interviews, coding challenges and whiteboard exercises are the ultimate proving ground. These hands-on tests assess your ability to translate abstract problems into tangible solutions. Let's delve into strategies to shine in these exercises.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conquering the Whiteboard Exercise
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Understand Before You Write:&lt;/strong&gt; Before diving in, clarify any ambiguities. Asking questions not only showcases your thoroughness but ensures you're on the right track. As stated by TechCrunch, nearly 45% of interviewers are impressed when candidates ask insightful questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start with a Brute Force Solution:&lt;/strong&gt; It's okay to begin with a simple solution. Once outlined, you can then refine for better efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Explain Your Thought Process:&lt;/strong&gt; Articulation is crucial. The whiteboard isn't just about the final solution, but the journey to get there. A LinkedIn survey emphasized that 92% of hiring professionals value soft skills, like communication, equally or more than technical abilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Test with Real-World Examples:&lt;/strong&gt; After jotting down your approach, walk through a real-world example. This checks the feasibility of your solution and potentially uncovers any oversights.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Embrace Feedback:&lt;/strong&gt; Sometimes, interviewers might play devil's advocate or suggest modifications. Rather than being defensive, adapt and iterate. This shows resilience and a willingness to learn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigating Coding Challenges
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Optimize Your Workspace:&lt;/strong&gt; Whether it's an online IDE or a platform specified by the company, ensure you're familiar with the environment. A clutter-free, familiar workspace can significantly reduce unnecessary stress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Time Management:&lt;/strong&gt; Most coding challenges are timed. Break down your total time – a fraction for understanding, a chunk for coding, and the remainder for testing. According to a report by HackerRank, 70% of employers zero in on problem-solving skills during coding tests. Being systematic can help manifest this skill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Edge Cases are Crucial:&lt;/strong&gt; It's not enough to just solve the problem. Ensure your solution caters to edge cases. This demonstrates thoroughness and deep understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Maintain Clean Code:&lt;/strong&gt; Remember, it's not just about getting the solution but the quality of your code. Consistent naming conventions, comments, and modular code reflect professionalism and attention to detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Stay Calm and Debug:&lt;/strong&gt; Bugs are inevitable. If something goes awry, stay composed. A structured approach to debugging showcases your problem-solving aptitude under pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Your Next Steps for Software Engineer Interview Success
&lt;/h2&gt;

&lt;p&gt;You've traversed the depths of interview preparation, from understanding the intricacies of the process to nailing whiteboard challenges. Yet, as we wrap up this guide, it's pivotal to remember that preparation is an evolving journey, not a destination. So, what should be your subsequent steps for ensuring success?&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Learning
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Tech Landscape is Dynamic:&lt;/strong&gt; Software engineering is perpetually evolving. Stay updated with emerging technologies, languages, and industry trends. A survey by Stack Overflow emphasizes that 75% of developers learn a new technology every year. Be part of that proactive majority.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mock Interviews
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Practice Makes Perfect:&lt;/strong&gt; Beyond solitary preparation, engage in mock interviews. Platforms like Pramp or &lt;a href="https://www.designgurus.io/mock-interviews"&gt;Design Gurus&lt;/a&gt; offer real-time practice with peers or industry professionals. This not only sharpens your skills but offers invaluable feedback from a third-person perspective.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build and Reflect
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Your Portfolio Speaks Volumes:&lt;/strong&gt; Regularly update your GitHub or portfolio with projects that you're passionate about. But don't just build – reflect on what you've created. Understand the 'why' behind your choices. This introspection aids in articulating your decisions during interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Network and Engage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;You're Not Alone:&lt;/strong&gt; Join local or online tech communities. Engage in discussions, attend webinars, or even participate in hackathons. A study by LinkedIn suggests that 85% of jobs are filled via networking. So, don't underestimate the power of genuine connections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-care
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Healthy Mind in a Healthy Body:&lt;/strong&gt; While technical prowess is vital, mental and physical well-being is paramount. Regular breaks, hobbies, and even meditation can significantly reduce stress. After all, a relaxed mind can think clearer and innovate better.&lt;/p&gt;

&lt;p&gt;In essence, your journey towards software engineering interview success is a blend of technical mastery, continuous learning, and holistic well-being. It's not about memorizing solutions but understanding and enjoying the process. So, embrace the journey, celebrate small victories, and remember that every interview, whether successful or not, is a stepping stone to your ultimate goal. Keep coding, keep learning, and most importantly, keep believing in yourself!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;a href="https://www.linkedin.com/in/arslanahmad/"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://arslan-ahmad.medium.com/"&gt;medium&lt;/a&gt; to get more insights on tech interviews.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>systemdesign</category>
      <category>leetcode</category>
      <category>programming</category>
    </item>
    <item>
      <title>Top LeetCode Patterns for FAANG Coding Interviews</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Fri, 29 Jul 2022 11:29:00 +0000</pubDate>
      <link>https://dev.to/arslan_ah/top-leetcode-patterns-for-faang-coding-interviews-1on4</link>
      <guid>https://dev.to/arslan_ah/top-leetcode-patterns-for-faang-coding-interviews-1on4</guid>
      <description>&lt;p&gt;Preparing for coding interviews can be made easier by focusing on coding patterns. Every software engineer should learn coding patterns such as Sliding Window, Two Pointers, Two Heaps, etc. By doing so, software engineers will be able to develop the skill of “mapping a new problem to an existing one.” In this post, we will learn which coding patterns have the highest return on investment for software engineers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt; came up with a list of 18 patterns for coding questions based on the similarities in the techniques needed to solve them. The course’s idea is to teach famous coding patterns so that once someone is familiar with a pattern, they will be able to solve dozens of problems with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  LeetCode Problems Distribution
&lt;/h2&gt;

&lt;p&gt;LeetCode (LC), being the largest repository of coding problems, contains more than 2k+ questions. Each question on LC can be tagged with one or more topics. These topics are either data structures like Array, HashTable, Tree, etc., or algorithmic techniques like Greedy, Divide and Conquer, Sorting, etc., or coding patterns like Sliding Window, Depth First Search, Topological Sort, etc. Here is the topic distribution for LC questions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffizcdcifvso1s9ysh0pu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffizcdcifvso1s9ysh0pu.png" alt="LeetCode Topic Distribution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The top topic is Array with 1142 problems, followed by String with 549 problems, and so on. Let’s take a closer look at each category of topics, namely Data Structures, Algorithms, and Coding Patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Top Data Structures with Best ROI
&lt;/h2&gt;

&lt;p&gt;Here are the top Data Structures with the highest return on investment:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Array (1142 problems)&lt;/li&gt;
&lt;li&gt;String (549)&lt;/li&gt;
&lt;li&gt;Hash Table (392)&lt;/li&gt;
&lt;li&gt;Tree (191)&lt;/li&gt;
&lt;li&gt;Matrix (171)&lt;/li&gt;
&lt;li&gt;Stack (128)&lt;/li&gt;
&lt;li&gt;Heap or Priority Queue (107)&lt;/li&gt;
&lt;li&gt;Graph (102)&lt;/li&gt;
&lt;li&gt;Linked List (69)&lt;/li&gt;
&lt;li&gt;Trie (44)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Top Algorithmic Techniques with Best ROI
&lt;/h2&gt;

&lt;p&gt;Here are the top algorithmic techniques with the highest return on investment:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dynamic Programming (383)&lt;/li&gt;
&lt;li&gt;Sorting (253)&lt;/li&gt;
&lt;li&gt;Greedy (248)&lt;/li&gt;
&lt;li&gt;Binary Search (186)&lt;/li&gt;
&lt;li&gt;Backtracking (91)&lt;/li&gt;
&lt;li&gt;Recursion (44)&lt;/li&gt;
&lt;li&gt;Divide and Conquer (38)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Top Coding Patterns with Best ROI
&lt;/h2&gt;

&lt;p&gt;Here are the top coding patterns with the highest return on investment:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Depth First Search (250)&lt;/li&gt;
&lt;li&gt;Breadth First Search(198)&lt;/li&gt;
&lt;li&gt;Binary Search (186)&lt;/li&gt;
&lt;li&gt;Two Pointers (147)&lt;/li&gt;
&lt;li&gt;Sliding Window (72)&lt;/li&gt;
&lt;li&gt;Monotonic Stack (44)&lt;/li&gt;
&lt;li&gt;Union Find (63)&lt;/li&gt;
&lt;li&gt;Memoization (32)&lt;/li&gt;
&lt;li&gt;Topological Sort (28)&lt;/li&gt;
&lt;li&gt;Segment Tree (27)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Best Coding Patterns with Highest ROI
&lt;/h2&gt;

&lt;p&gt;Combining all categories from the above data, here is the list of best coding patterns/techniques with the highest ROI:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743404181_0Unit" rel="noopener noreferrer"&gt;Two Pointers&lt;/a&gt; (Arrays, Strings, &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743539397_12Unit" rel="noopener noreferrer"&gt;Fast &amp;amp; Slow Pointer&lt;/a&gt;)&lt;/strong&gt;&lt;br&gt;
This pattern covers a huge set of questions related to Arrays and Strings, which are the highest tagged data structures. Fast &amp;amp; Slow Pointer can be easily understood as a variation of the Two Pointers pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1627871350324_0Unit" rel="noopener noreferrer"&gt;Sliding Window&lt;/a&gt; (Arrays, Strings, Hash Tables)&lt;/strong&gt;&lt;br&gt;
Sliding Window covers most of the problems related to top data structures like Arrays, Strings, and HashTables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743917257_53Unit" rel="noopener noreferrer"&gt;Tree and Graph Depth First Search&lt;/a&gt; (&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_62d7d2809d90bUnit" rel="noopener noreferrer"&gt;Matrix Traversal&lt;/a&gt;)&lt;/strong&gt;&lt;br&gt;
Most Trees and Graphs problems can be solved using Depth First Search (DFS). Matrix Traversal, which is also DFS based pattern, covers most of the matrix-related problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743839113_43Unit" rel="noopener noreferrer"&gt;Tree and Graph Breadth First Search&lt;/a&gt; (Queue, &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744031780_66Unit" rel="noopener noreferrer"&gt;Subsets&lt;/a&gt;, &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_62d7d2809d90bUnit" rel="noopener noreferrer"&gt;Matrix Traversal&lt;/a&gt;, &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744523199_120Unit" rel="noopener noreferrer"&gt;Topological Sort&lt;/a&gt;)&lt;/strong&gt;&lt;br&gt;
Breadth First Search (BFS) is a very handy pattern. BFS’s patterns like Subsets, Matrix Traversal, and Topological Sort cover a good number of problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744125571_76Unit" rel="noopener noreferrer"&gt;Binary Search&lt;/a&gt; (Arrays)&lt;/strong&gt;&lt;br&gt;
Binary Search and its variants are used to solve a huge number of coding questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. &lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743615987_20Unit" rel="noopener noreferrer"&gt;Interval Merge&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Although there are not many problems related to Interval Merge, these problems frequently appear in coding interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Recursion/Backtracking&lt;/strong&gt;&lt;br&gt;
Backtracking and recursion are used to solve a wide range of problems. Mastering these techniques is highly recommended.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Most programming interviews include LeetCode-type questions. Software engineers practice such coding problems before interviews. The highest return on investment is achieved by preparing smartly and focusing on the problem patterns. You can learn more about these patterns and related problems in &lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt; and &lt;a href="https://designgurus.io/course/grokking-dynamic-programming" rel="noopener noreferrer"&gt;Grokking Dynamic Programming for Coding Interviews&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Preparing for system design interviews, see this: &lt;a href="https://designgurus.io/blog/complete-guide-sys-design" rel="noopener noreferrer"&gt;The Complete Guide to Ace the System Design Interview&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>career</category>
      <category>leetcode</category>
      <category>python</category>
    </item>
    <item>
      <title>System Design Interview Question: Designing a URL Shortening Service</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Sun, 02 Jan 2022 01:25:00 +0000</pubDate>
      <link>https://dev.to/arslan_ah/system-design-interview-question-designing-a-url-shortening-service-4029</link>
      <guid>https://dev.to/arslan_ah/system-design-interview-question-designing-a-url-shortening-service-4029</guid>
      <description>&lt;p&gt;&lt;em&gt;How to design a URL shortening service like TinyURL?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Software engineers usually struggle with &lt;a href="https://www.designgurus.io/system-design-interview" rel="noopener noreferrer"&gt;system design interviews&lt;/a&gt; partly due to their lack of experience developing large-scale systems and partly due to the unstructured nature of system design interviews. Even advanced and experienced developers find system design interviews challenging since the design questions are open-ended and have no standard answer. To help with that, in my previous &lt;a href="https://www.designgurus.io/blog/step-by-step-guide" rel="noopener noreferrer"&gt;post&lt;/a&gt;, we discussed a step-by-step approach for solving system design interview questions. Let’s follow that approach to solve a classical system design question: Designing a URL shortening service like TinyURL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question Statement:&lt;/strong&gt; Let’s design a URL shortening service like TinyURL. This service will provide short aliases redirecting to long URLs.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why do we need URL shortening?
&lt;/h2&gt;

&lt;p&gt;URL shortening is used to create shorter aliases for long URLs. Let’s call these shortened aliases “short links.” Users are redirected to the original URL when they hit these short links. Short links save a lot of space when displayed, printed, messaged, or tweeted. Additionally, users are less likely to mistype shorter URLs.&lt;br&gt;
For example, when we shortened this page through TinyURL:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview" rel="noopener noreferrer"&gt;https://www.designgurus.io/course/grokking-the-system-design-interview&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We got:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://tinyurl.com/vzet59pa" rel="noopener noreferrer"&gt;https://tinyurl.com/vzet59pa&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The shortened URL is nearly one-third the size of the actual URL.&lt;/p&gt;

&lt;p&gt;URL shortening is used to optimize links across devices, track individual links to analyze audience, measure ad campaigns’ performance, or hide affiliated original URLs.&lt;br&gt;
If you haven’t used tinyurl.com before, please try creating a new shortened URL and spend some time going through the various options their service offers. This will help you a lot in understanding this chapter.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Requirements and Goals of the System
&lt;/h2&gt;

&lt;p&gt;Our URL shortening system should meet the following requirements:&lt;/p&gt;
&lt;h3&gt;
  
  
  Functional Requirements:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Given a URL, our service should generate a shorter and unique alias of it. This is called a short link. This link should be short enough to be easily copied and pasted into applications.&lt;/li&gt;
&lt;li&gt;When users access a short link, our service should redirect them to the original link.&lt;/li&gt;
&lt;li&gt;Users should optionally be able to pick a custom short link for their URL.&lt;/li&gt;
&lt;li&gt;Links will expire after a standard default timespan. Users should be able to specify the expiration time.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Non-Functional Requirements:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Such a system should be highly available. This is required because, if our service is down, all the URL redirections will start failing.&lt;/li&gt;
&lt;li&gt;URL redirection should happen in real-time with minimal latency.&lt;/li&gt;
&lt;li&gt;Shortened links should not be guessable (not predictable).&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Extended Requirements:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Analytics; e.g., how many times a redirection happened?&lt;/li&gt;
&lt;li&gt;Our service should also be accessible through REST APIs by 
other services.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  3. Capacity Estimation and Constraints
&lt;/h2&gt;

&lt;p&gt;Our system will be read-heavy. There will be lots of redirection requests compared to new URL shortenings. Let’s assume a 100:1 ratio between read and write.&lt;/p&gt;
&lt;h3&gt;
  
  
  Traffic estimates
&lt;/h3&gt;

&lt;p&gt;Assuming, we will have 500M new URL shortenings per month, with 100:1 read/write ratio, we can expect 50B redirections during the same period: &lt;strong&gt;100 * 500M =&amp;gt; 50B&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What would be Queries Per Second (QPS) for our system? New URLs shortenings per second: &lt;strong&gt;500 million / (30 days * 24 hours * 3600 seconds) = ~200 URLs/s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Considering 100:1 read/write ratio, URLs redirections per second will be: &lt;strong&gt;100 * 200 URLs/s = 20K/s&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Storage estimates
&lt;/h3&gt;

&lt;p&gt;Let’s assume we store every URL shortening request (and associated shortened link) for 5 years. Since we expect to have 500M new URLs every month, the total number of objects we expect to store will be 30 billion: &lt;strong&gt;500 million * 5 years * 12 months = 30 billion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s assume that each stored object will be approximately 500 bytes (just a ballpark estimate–we will dig into it later). We will need 15TB of total storage: &lt;strong&gt;30 billion * 500 bytes = 15 TB&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Bandwidth estimates
&lt;/h3&gt;

&lt;p&gt;For write requests, since we expect 200 new URLs every second, total incoming data for our service will be 100KB per second: &lt;strong&gt;200 * 500 bytes = 100 KB/s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For read requests, since every second we expect ~20K URLs redirections, total outgoing data for our service would be 10MB per second: &lt;strong&gt;20K * 500 bytes = ~10 MB/s&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Memory estimates
&lt;/h3&gt;

&lt;p&gt;If we want to cache some of the hot URLs that are frequently accessed, how much memory will we need to store them? If we follow the 80–20 rule, meaning 20% of URLs generate 80% of traffic, we would like to cache these 20% hot URLs.&lt;/p&gt;

&lt;p&gt;Since we have 20K requests per second, we will be getting 1.7 billion requests per day: &lt;strong&gt;20K * 3600 seconds * 24 hours = ~1.7 billion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To cache 20% of these requests, we will need 170GB of memory: &lt;strong&gt;0.2 * 1.7 billion * 500 bytes = ~170GB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing to note here is that since there will be many duplicate requests (of the same URL), our actual memory usage will be less than 170GB.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. System APIs
&lt;/h2&gt;

&lt;p&gt;We can have SOAP or REST APIs to expose the functionality of our service. Following could be the definitions of the APIs for creating and deleting URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createURL(api_dev_key, original_url, custom_alias=None, 
user_name=None, expire_date=None)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;br&gt;
api_dev_key (string): The API developer key of a registered account. This will be used to, among other things, throttle users based on their allocated quota.&lt;br&gt;
original_url (string): Original URL to be shortened.&lt;br&gt;
custom_alias (string): Optional custom key for the URL.&lt;br&gt;
user_name (string): Optional user name to be used in the encoding.&lt;br&gt;
expire_date (string): Optional expiration date for the shortened URL.&lt;br&gt;
&lt;strong&gt;Returns: (string)&lt;/strong&gt;&lt;br&gt;
A successful insertion returns the shortened URL; otherwise, it returns an error code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deleteURL(api_dev_key, url_key)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where “url_key” is a string representing the shortened URL to be retrieved; a successful deletion returns ‘URL Removed’.&lt;/p&gt;

&lt;p&gt;How do we detect and prevent abuse? A malicious user can put us out of business by consuming all URL keys in the current design. To prevent abuse, we can limit users via their api_dev_key. Each api_dev_key can be limited to a certain number of URL creations and redirections per some time period (which may be set to a different duration per developer key).&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Database Design
&lt;/h2&gt;

&lt;p&gt;A few observations about the nature of the data we will store:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We need to store billions of records.&lt;/li&gt;
&lt;li&gt;Each object we store is small (less than 1K).&lt;/li&gt;
&lt;li&gt;There are no relationships between records — other than storing which user created a URL.&lt;/li&gt;
&lt;li&gt;Our service is read-heavy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Database Schema:&lt;/strong&gt;&lt;br&gt;
We would need two tables: one for storing information about the URL mappings and one for the user’s data who created the short link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flyu1fxdyksvkwlavo811.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flyu1fxdyksvkwlavo811.png" alt="URL Shortening DB Schema" width="463" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What kind of database should we use? Since we anticipate storing billions of rows, and we don’t need to use relationships between objects — a NoSQL store like DynamoDB, Cassandra, or Riak is a better choice. A NoSQL choice would also be easier to scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Basic System Design and Algorithm
&lt;/h2&gt;

&lt;p&gt;The problem we are solving here is how to generate a short and unique key for a given URL.&lt;/p&gt;

&lt;p&gt;In the TinyURL example in Section 1, the shortened URL is “&lt;a href="https://tinyurl.com/vzet59pa%E2%80%9D" rel="noopener noreferrer"&gt;https://tinyurl.com/vzet59pa”&lt;/a&gt;. The last eight characters of this URL constitute the short key we want to generate. We’ll explore two solutions here:&lt;/p&gt;

&lt;h3&gt;
  
  
  a. Encoding actual URL
&lt;/h3&gt;

&lt;p&gt;We can compute a unique hash (e.g., MD5 or SHA256, etc.) of the given URL. The hash can then be encoded for display. This encoding could be base36 ([a-z ,0–9]) or base62 ([A-Z, a-z, 0–9]) and if we add ‘+’ and ‘/’ we can use Base64 encoding. A reasonable question would be, what should be the length of the short key? 6, 8, or 10 characters?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using base64 encoding, a 6 letters long key would result in 64⁶ = ~68.7 billion possible strings.&lt;br&gt;
Using base64 encoding, an 8 letters long key would result in 64⁸ = ~281 trillion possible strings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With 68.7B unique strings, let’s assume six letter keys would suffice for our system.&lt;/p&gt;

&lt;p&gt;If we use the MD5 algorithm as our hash function, it will produce a 128-bit hash value. After base64 encoding, we’ll get a string having more than 21 characters (since each base64 character encodes 6 bits of the hash value). Now we only have space for 6 (or 8) characters per short key; how will we choose our key then? We can take the first 6 (or 8) letters for the key. This could result in key duplication; to resolve that, we can choose some other characters out of the encoding string or swap some characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the different issues with our solution?&lt;/strong&gt; We have the following couple of problems with our encoding scheme:&lt;br&gt;
If multiple users enter the same URL, they can get the same shortened URL, which is not acceptable.&lt;/p&gt;

&lt;p&gt;What if parts of the URL are URL-encoded? e.g., &lt;a href="http://www.designgurus.org/distributed.php?id=design" rel="noopener noreferrer"&gt;http://www.designgurus.org/distributed.php?id=design&lt;/a&gt;, and &lt;a href="http://www.designgurus.org/distributed.php%3Fid%3Ddesign" rel="noopener noreferrer"&gt;http://www.designgurus.org/distributed.php%3Fid%3Ddesign&lt;/a&gt; are identical except for the URL encoding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Workaround for the issues:&lt;/strong&gt; We can append an increasing sequence number to each input URL to make it unique and then generate its hash. We don’t need to store this sequence number in the database. Possible problems with this approach could be an ever-increasing sequence number. Can it overflow? Appending an increasing sequence number will also impact the performance of the service.&lt;/p&gt;

&lt;p&gt;Another solution could be to append the user id (which should be unique) to the input URL. However, if the user has not signed in, we would have to ask the user to choose a uniqueness key. Even after this, if we have a conflict, we have to keep generating a key until we get a unique one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frah0j50hq8nbu4skj623.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frah0j50hq8nbu4skj623.png" alt=" " width="558" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  b. Generating keys offline
&lt;/h3&gt;

&lt;p&gt;We can have a standalone Key Generation Service (KGS) that generates random six-letter strings beforehand and stores them in a database (let’s call it key-DB). Whenever we want to shorten a URL, we will take one of the already-generated keys and use it. This approach will make things quite simple and fast. Not only are we not encoding the URL, but we won’t have to worry about duplications or collisions. KGS will make sure all the keys inserted into key-DB are unique&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can concurrency cause problems?&lt;/strong&gt; As soon as a key is used, it should be marked in the database to ensure that it is not used again. If there are multiple servers reading keys concurrently, we might get a scenario where two or more servers try to read the same key from the database. How can we solve this concurrency problem?&lt;/p&gt;

&lt;p&gt;Servers can use KGS to read/mark keys in the database. KGS can use two tables to store keys: one for keys that are not used yet, and one for all the used keys. As soon as KGS gives keys to one of the servers, it can move them to the used keys table. KGS can always keep some keys in memory to quickly provide them whenever a server needs them.&lt;/p&gt;

&lt;p&gt;For simplicity, as soon as KGS loads some keys in memory, it can move them to the used keys table. This ensures each server gets unique keys. If KGS dies before assigning all the loaded keys to some server, we will be wasting those keys–which could be acceptable, given the huge number of keys we have.&lt;/p&gt;

&lt;p&gt;KGS also has to make sure not to give the same key to multiple servers. For that, it must synchronize (or get a lock on) the data structure holding the keys before removing keys from it and giving them to a server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What would be the key-DB size?&lt;/strong&gt; With base64 encoding, we can generate 68.7B unique six letters keys. If we need one byte to store one alpha-numeric character, we can store all these keys in:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;6 (characters per key) * 68.7B (unique keys) = 412 GB.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Isn’t KGS a single point of failure?&lt;/strong&gt; Yes, it is. To solve this, we can have a standby replica of KGS. Whenever the primary server dies, the standby server can take over to generate and provide keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can each app server cache some keys from key-DB?&lt;/strong&gt; Yes, this can surely speed things up. Although, in this case, if the application server dies before consuming all the keys, we will end up losing those keys. This can be acceptable since we have 68B unique six-letter keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How would we perform a key lookup?&lt;/strong&gt; We can look up the key in our database to get the full URL. If it’s present in the DB, issue an “HTTP 302 Redirect” status back to the browser, passing the stored URL in the “Location” field of the request. If that key is not present in our system, issue an “HTTP 404 Not Found” status or redirect the user back to the homepage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should we impose size limits on custom aliases?&lt;/strong&gt; Our service supports custom aliases. Users can pick any ‘key’ they like, but providing a custom alias is not mandatory. However, it is reasonable (and often desirable) to impose a size limit on a custom alias to ensure we have a consistent URL database. Let’s assume users can specify a maximum of 16 characters per customer key (as reflected in the above database schema).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7f329cjancoewwr92x7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7f329cjancoewwr92x7.png" alt=" " width="611" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Data Partitioning and Replication
&lt;/h2&gt;

&lt;p&gt;To scale out our DB, we need to partition it so that it can store information about billions of URLs. Therefore, we need to develop a partitioning scheme that would divide and store our data into different DB servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  a. Range Based Partitioning
&lt;/h3&gt;

&lt;p&gt;We can store URLs in separate partitions based on the hash key’s first letter. Hence we save all the URL hash keys starting with the letter ‘A’ (and ‘a’) in one partition, save those that start with the letter ‘B’ in another partition, and so on. This approach is called range-based partitioning. We can even combine certain less frequently occurring letters into one database partition. Thus, we should develop a static partitioning scheme to always store/find a URL in a predictable manner.&lt;/p&gt;

&lt;p&gt;The main problem with this approach is that it can lead to unbalanced DB servers. For example, we decide to put all URLs starting with the letter ‘E’ into a DB partition, but later we realize that we have too many URLs that start with the letter ‘E.’&lt;/p&gt;

&lt;h3&gt;
  
  
  b. Hash-Based Partitioning
&lt;/h3&gt;

&lt;p&gt;In this scheme, we take a hash of the object we are storing. We then calculate which partition to use based upon the hash. In our case, we can take the hash of the ‘key’ or the short link to determine the partition in which we store the data object.&lt;/p&gt;

&lt;p&gt;Our hashing function will randomly distribute URLs into different partitions (e.g., our hashing function can always map any ‘key’ to a number between [1…256]). This number would represent the partition in which we store our object.&lt;/p&gt;

&lt;p&gt;This approach can still lead to overloaded partitions, which can be solved using &lt;a href="https://medium.com/interviewnoodle/how-to-use-consistent-hashing-in-a-system-design-interview-b738be3a1ae3" rel="noopener noreferrer"&gt;Consistent Hashing&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Cache
&lt;/h2&gt;

&lt;p&gt;We can cache URLs that are frequently accessed. We can use any off-the-shelf solution like Memcached, which can store full URLs with their respective hashes. Thus, the application servers, before hitting the backend storage, can quickly check if the cache has the desired URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much cache memory should we have?&lt;/strong&gt; We can start with 20% of daily traffic and, based on clients’ usage patterns, we can adjust how many cache servers we need. As estimated above, we need 170GB of memory to cache 20% of daily traffic. Since a modern-day server can have 256GB of memory, we can easily fit all the cache into one machine. Alternatively, we can use a couple of smaller servers to store all these hot URLs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which cache eviction policy would best fit our needs?&lt;/strong&gt; When the cache is full, and we want to replace a link with a newer/hotter URL, how would we choose? Least Recently Used (LRU) can be a reasonable policy for our system. Under this policy, we discard the least recently used URL first. We can use a Linked Hash Map or a similar data structure to store our URLs and Hashes, which will also keep track of the URLs that have been accessed recently.&lt;/p&gt;

&lt;p&gt;To further increase the efficiency, we can replicate our caching servers to distribute the load between them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can each cache replica be updated?&lt;/strong&gt; Whenever there is a cache miss, our servers would be hitting a backend database. Whenever this happens, we can update the cache and pass the new entry to all the cache replicas. Each replica can update its cache by adding the new entry. If a replica already has that entry, it can simply ignore it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v1xri3msy5hn0zbb58g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v1xri3msy5hn0zbb58g.png" alt=" " width="700" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Load Balancer (LB)
&lt;/h2&gt;

&lt;p&gt;We can add a Load balancing layer at three places in our system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Between Clients and Application servers&lt;/li&gt;
&lt;li&gt;Between Application Servers and database servers&lt;/li&gt;
&lt;li&gt;Between Application Servers and Cache servers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Initially, we could use a simple Round Robin load balancer that distributes incoming requests equally among backend servers. This LB is simple to implement and does not introduce any overhead. Another benefit is that if a server is dead, LB will take it out of the rotation and stop sending any traffic to it.&lt;/p&gt;

&lt;p&gt;A problem with Round Robin LB is that we do not consider the server load. As a result, if a server is overloaded or slow, the LB will not stop sending new requests to that server. To handle this, a more intelligent LB solution can be placed that periodically queries the backend server about its load and adjusts traffic based on that.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Purging or DB cleanup
&lt;/h2&gt;

&lt;p&gt;Should entries stick around forever, or should they be purged? If a user-specified expiration time is reached, what should happen to the link?&lt;/p&gt;

&lt;p&gt;If we chose to continuously search for expired links to remove them, it would put a lot of pressure on our database. Instead, we can slowly remove expired links and do a lazy cleanup. Our service will ensure that only expired links will be deleted, although some expired links can live longer but will never be returned to users.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whenever a user tries to access an expired link, we can delete the link and return an error to the user.&lt;/li&gt;
&lt;li&gt;A separate Cleanup service can run periodically to remove expired links from our storage and cache. This service should be very lightweight and scheduled to run only when the user traffic is expected to be low.&lt;/li&gt;
&lt;li&gt;We can have a default expiration time for each link (e.g., two years).&lt;/li&gt;
&lt;li&gt;After removing an expired link, we can put the key back in the key-DB to be reused.&lt;/li&gt;
&lt;li&gt;Should we remove links that haven’t been visited in some length of time, say six months? This could be tricky. Since storage is getting cheap, we can decide to keep links forever. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx2nqo85loq0kup8l36a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx2nqo85loq0kup8l36a.png" alt=" " width="700" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Security and Permissions
&lt;/h2&gt;

&lt;p&gt;Can users create private URLs or allow a particular set of users to access a URL?&lt;/p&gt;

&lt;p&gt;We can store the permission level (public/private) with each URL in the database. We can also create a separate table to store UserIDs that have permission to see a specific URL. If a user does not have permission and tries to access a URL, we can send an error (HTTP 401) back. Given that we are storing our data in a NoSQL wide-column database like Cassandra, the key for the table storing permissions would be the ‘Hash’ (or the KGS generated ‘key’). The columns will store the UserIDs of those users that have permission to see the URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Summary
&lt;/h2&gt;

&lt;p&gt;In my experience, every successful software developer has followed a systematic approach to solve a system design question during an interview. The current interview process requires us to present a reasonable solution within 45 minutes and the key to success is being organized during the system design interview. Hopefully, this step-by-step approach will help you stay on track during the interview.&lt;/p&gt;

&lt;p&gt;Please take a look at &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview" rel="noopener noreferrer"&gt;Grokking the System Design Interview&lt;/a&gt; for more system design interview questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Designing a file sharing service like Google Drive or Dropbox.&lt;/li&gt;
&lt;li&gt;Designing a popular messaging service like Facebook Messenger.&lt;/li&gt;
&lt;li&gt;Designing popular social network sites like Twitter or Facebook.&lt;/li&gt;
&lt;li&gt;Designing a global video streaming service like Youtube.&lt;/li&gt;
&lt;li&gt;Designing a global ride hailing service like Uber.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To learn software architecture and practice advanced system design interview questions take a look at &lt;a href="https://www.designgurus.io/course/grokking-the-advanced-system-design-interview" rel="noopener noreferrer"&gt;Grokking the Advanced System Design Interview&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>career</category>
      <category>distributedsystems</category>
      <category>beginners</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>System Design Interviews: A Step-By-Step Guide</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Sun, 26 Dec 2021 17:41:00 +0000</pubDate>
      <link>https://dev.to/arslan_ah/system-design-interviews-a-step-by-step-guide-39am</link>
      <guid>https://dev.to/arslan_ah/system-design-interviews-a-step-by-step-guide-39am</guid>
      <description>&lt;p&gt;How to efficiently manage a 45 minutes system design interview?&lt;/p&gt;

&lt;p&gt;System design interviews (SDIs) have gained a lot of focus in the past few years. Now a standard part of every software engineering interview, these interviews assess a candidate’s ability to handle complex systems. &lt;strong&gt;Performance in these interviews determines the position and salary offered by the interviewing company.&lt;/strong&gt; Engineers usually struggle with SDIs partly due to their lack of experience developing large-scale systems and partly due to the unstructured nature of SDIs. Engineers who have experience building such systems still find these interviews uncomfortable, mainly because the design problems are open-ended and have no standard answer.&lt;/p&gt;

&lt;p&gt;Generally, software engineers have difficulty with system design interviews for three primary reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SDIs are &lt;strong&gt;unstructured&lt;/strong&gt;, where candidates are asked to take on an open-ended design problem that doesn’t have a standard solution.&lt;/li&gt;
&lt;li&gt;Candidates &lt;strong&gt;lack experience&lt;/strong&gt; in developing complex and large-scale systems.&lt;/li&gt;
&lt;li&gt;Candidates did not &lt;strong&gt;spend enough time&lt;/strong&gt; preparing for SDIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like coding interviews, candidates who have not put a deliberate effort to prepare for SDIs, mostly perform poorly, especially at top companies like Google, Facebook, Amazon, Microsoft, etc. In these companies, candidates who do not perform above average have a limited chance to get an offer. &lt;strong&gt;On the other hand, a good performance always results in a better offer (a higher position and salary) since it proves the candidate’s ability to handle a complex system.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During my professional career, I have taken more than 200 &lt;a href="https://www.designgurus.io/system-design-interview" rel="noopener noreferrer"&gt;system design interviews&lt;/a&gt;. My goal in this post is to provide a step-by-step guide on how to approach system design questions during an interview; it will assist with overcoming the problems highlighted above.&lt;/p&gt;

&lt;p&gt;Check &lt;strong&gt;&lt;a href="https://www.designgurus.org/course/grokking-the-system-design-interview" rel="noopener noreferrer"&gt;Grokking the System Design Interview&lt;/a&gt;&lt;/strong&gt; to learn about important distributed system concepts.&lt;/p&gt;

&lt;p&gt;In my experience, candidates who have performed better tend to follow these seven steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Requirements clarifications:&lt;/strong&gt; Always ask questions to find the exact scope of the problem you are solving.&lt;br&gt;
&lt;strong&gt;2. Back-of-the-envelope estimation:&lt;/strong&gt; It’s always a good idea to estimate the scale of the system you are going to design. This will also help later, when you will be focusing on scaling, partitioning, load balancing, caching, etc.&lt;br&gt;
&lt;strong&gt;3. System interface definition:&lt;/strong&gt; Define what APIs are expected from the system. This will not only establish the exact contract expected from the system but also ensure that you have not gotten any requirements wrong.&lt;br&gt;
&lt;strong&gt;4. Define data model:&lt;/strong&gt; Defining the system data model early on will clarify how data will flow among different components of the system and later will also guide towards the data partitioning and management.&lt;br&gt;
&lt;strong&gt;5. High-level design:&lt;/strong&gt; Draw a block diagram with 5–6 boxes representing the core components of your system. You should identify enough components that are needed to solve the actual problem from end to end.&lt;br&gt;
&lt;strong&gt;6. Detailed design:&lt;/strong&gt; Dig deeper into 2–3 components; interviewer’s feedback should always guide you towards which parts of the system she wants you to explain further. You should be able to provide different options, their pros and cons, and why are you choosing them?&lt;br&gt;
&lt;strong&gt;7. Identifying and resolving bottlenecks:&lt;/strong&gt; Try to discuss as many bottlenecks (and different approaches to mitigate them) as possible.&lt;/p&gt;

&lt;p&gt;Let’s discuss each step in detail with a real case study:&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Requirements clarifications
&lt;/h2&gt;

&lt;p&gt;It is always a good idea to ask questions about the exact scope of the problem we are solving. Design questions are mostly open-ended, and they don’t have ONE correct answer; that’s why clarifying ambiguities early in the interview becomes critical. Candidates who spend enough time defining the end goals of the system always have a better chance to be successful in the interview. Also, since we only have 35–40 minutes to design a (supposedly) large system, we should clarify what parts of the system we will be focusing on.&lt;/p&gt;

&lt;p&gt;Let’s expand this with an actual example of designing a Twitter-like service. Here are some questions for designing Twitter that should be answered before moving on to the next steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Will users of our service be able to post tweets and follow other people?&lt;/li&gt;
&lt;li&gt;Should we also design to create and display the user’s timeline?&lt;/li&gt;
&lt;li&gt;Will tweets contain photos and videos?&lt;/li&gt;
&lt;li&gt;Are we focusing on the backend only, or are we developing the front-end too?&lt;/li&gt;
&lt;li&gt;Will users be able to search tweets?&lt;/li&gt;
&lt;li&gt;Do we need to display hot trending topics?&lt;/li&gt;
&lt;li&gt;Will there be any push notification for new (or important) tweets?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All such questions will determine how our end design will look like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vla8mnczr2if415r27d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vla8mnczr2if415r27d.png" alt="Photo by Malcolm Lightbody on Unsplash" width="700" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Back-of-the-envelope estimation
&lt;/h2&gt;

&lt;p&gt;It is always a good idea to estimate the scale of the system we’re going to design. This will also help later when we will be focusing on scaling, partitioning, load balancing, and caching.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What scale is expected from the system (e.g., number of new tweets, number of tweet views, number of timeline generations per sec., etc.)?&lt;/li&gt;
&lt;li&gt;How much storage will we need? We will have different storage requirements if users can have photos and videos in their tweets.&lt;/li&gt;
&lt;li&gt;What network bandwidth usage are we expecting? This will be crucial in deciding how we will manage traffic and balance load between servers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Step 3: System interface definition
&lt;/h2&gt;

&lt;p&gt;Define what APIs are expected from the system. This will not only establish the exact contract expected from the system but will also ensure that we haven’t gotten any requirements wrong. Some examples of APIs for our Twitter-like service will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;postTweet(user_id, tweet_data, tweet_location, timestamp, …)
generateTimeline(user_id, current_time, user_location, …)
markTweetFavorite(user_id, tweet_id, timestamp, …)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Defining data model
&lt;/h2&gt;

&lt;p&gt;Defining the data model in the early part of the interview will clarify how data will flow between different components of the system. Later, it will guide for data partitioning and management. The candidate should be able to identify various entities of the system, how they will interact with each other, and different aspects of data management like storage, transportation, encryption, etc. Here are some entities for our Twitter-like service:&lt;br&gt;
&lt;strong&gt;User:&lt;/strong&gt; UserID, Name, Email, DoB, CreationData, LastLogin, etc.&lt;br&gt;
&lt;strong&gt;Tweet:&lt;/strong&gt; TweetID, Content, TweetLocation, NumberOfLikes, TimeStamp, etc.&lt;br&gt;
&lt;strong&gt;UserFollowo:&lt;/strong&gt; UserdID1, UserID2&lt;br&gt;
&lt;strong&gt;FavoriteTweets:&lt;/strong&gt; UserID, TweetID, TimeStamp&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecmfllged09ajdjnf9v5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecmfllged09ajdjnf9v5.png" alt=" " width="700" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which database system should we use? Will NoSQL like &lt;a href="https://en.wikipedia.org/wiki/Apache_Cassandra" rel="noopener noreferrer"&gt;Cassandra&lt;/a&gt; best fit our needs, or should we use a MySQL-like solution? What kind of block storage should we use to store photos and videos? &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: High-level design
&lt;/h2&gt;

&lt;p&gt;Draw a block diagram with 5–6 boxes representing the core components of our system. We should identify enough components that are needed to solve the actual problem from end to end.&lt;/p&gt;

&lt;p&gt;For Twitter, at a high level, we will need multiple application servers to serve all the read/write requests with load balancers in front of them for traffic distributions. If we’re assuming that we will have a lot more read traffic (as compared to write), we can decide to have separate servers for handling these scenarios. On the backend, we need an efficient database that can store all the tweets and can support a huge number of reads. We will also need a distributed file storage system for storing photos and videos.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkn39faxmx8muxfs0nlvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkn39faxmx8muxfs0nlvg.png" alt=" " width="369" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Detailed design
&lt;/h2&gt;

&lt;p&gt;Dig deeper into two or three major components; the interviewer’s feedback should always guide us to what parts of the system need further discussion. We should be able to present different approaches, their pros and cons, and explain why we will prefer one approach over the other. Remember, there is no single answer; the only important thing is to consider tradeoffs between different options while keeping system constraints in mind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since we will be storing a massive amount of data, how should we partition our data to distribute it to multiple databases? Should we try to store all the data of a user on the same database? What issue could it cause?&lt;/li&gt;
&lt;li&gt;How will we handle hot users who tweet a lot or follow lots of people?&lt;/li&gt;
&lt;li&gt;Since users’ timelines will contain the most recent (and relevant) tweets, should we try to store our data in such a way that is optimized for scanning the latest tweets?&lt;/li&gt;
&lt;li&gt;How much and at which layer should we introduce cache to speed things up?&lt;/li&gt;
&lt;li&gt;What components need better load balancing?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnikdbd64s8dywl0fkvm6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnikdbd64s8dywl0fkvm6.png" alt=" " width="700" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Identifying and resolving bottlenecks
&lt;/h2&gt;

&lt;p&gt;Try to discuss as many bottlenecks as possible and different approaches to mitigate them.&lt;br&gt;
Is there any single point of failure in our system? What are we doing to mitigate it?&lt;br&gt;
Do we have enough replicas of the data so that if we lose a few servers, we can still serve our users?&lt;br&gt;
Similarly, do we have enough copies of different services running such that a few failures will not cause a total system shutdown?&lt;br&gt;
How are we monitoring the performance of our service? Do we get alerts whenever critical components fail, or their performance degrades?&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;To sum up, preparing well and being organized during the interview is key to success in a system design interview. The steps mentioned above should guide you to stay on track and cover all the different aspects while designing a system.&lt;/p&gt;

&lt;p&gt;Please take a look at &lt;strong&gt;&lt;a href="https://www.designgurus.org/course/grokking-the-system-design-interview" rel="noopener noreferrer"&gt;Grokking the System Design Interview&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href="https://www.designgurus.org/course/grokking-the-advanced-system-design-interview" rel="noopener noreferrer"&gt;Grokking the Advanced System Design Interview&lt;/a&gt;&lt;/strong&gt; for some good examples of system design interview questions and their answers.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>distributedsystems</category>
      <category>career</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Grokking LeetCode: A Smarter Way to Prepare for Coding Interviews</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Thu, 25 Nov 2021 12:17:00 +0000</pubDate>
      <link>https://dev.to/arslan_ah/grokking-leetcode-a-smarter-way-to-prepare-for-coding-interviews-5d9d</link>
      <guid>https://dev.to/arslan_ah/grokking-leetcode-a-smarter-way-to-prepare-for-coding-interviews-5d9d</guid>
      <description>&lt;p&gt;&lt;em&gt;To LeetCode or not to LeetCode? What if you don’t want to practice 100s of coding questions before your next coding interview?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There is a part of me that dislikes coding interviews, primarily because it requires me to spend a lot of time preparing for coding questions. Moreover, during an interview, I have to present a reasonable (if not optimal) solution to someone who is evaluating me, something I don’t have to deal with in my everyday life as a software engineer.&lt;/p&gt;

&lt;p&gt;Having said that, I do love algorithms and solving coding problems. It is a fun activity for me, it gives me good mental exercise, and I love to spend time on it. &lt;strong&gt;In this post, I would like to share some of my learnings and the techniques that I’ve developed over time which makes preparing for coding interviews an exciting and fun activity.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A little about me; my software engineering career spans around 20 years, in which I’ve switched jobs five times. I’ve given around 30 interview loops containing 120+ interviews. I have some experience sitting on the other side of the table too. I’ve taken 300+ coding interviews and 200+ &lt;a href="https://medium.com/gitconnected/system-design-interview-survival-guide-2023-preparation-strategies-and-practical-tips-ba9314e6b9e3" rel="noopener noreferrer"&gt;system design interviews&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;If you are looking to switch jobs and preparing for coding interviews, you will definitely know LeetCode. It is probably the biggest online repository for coding interview questions and also contains a vibrant community to discuss algorithms with other fellow engineers. Whenever I’m free, I love spending time on LeetCode, trying to solve a new coding question, or learning from other smart solutions that people have developed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problems with LeetCode
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One of the biggest challenges with LeetCode is that it lacks organization; it has a huge set of coding problems, and one feels lost on where to start or what to focus on.&lt;/strong&gt; What is an ample amount of questions one should go through before considering themselves prepared for their coding interview? I would love to see a streamlined process that can guide me and teach me enough algorithmic techniques to feel confident for the interview. &lt;strong&gt;Being a lazy person myself, I wouldn’t say I like to go through 500+ questions.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;One technique that people often follow is to solve questions related to the same data structure; for example, focusing on questions related to Arrays, then LinkedList, HashMap, Heap, Tree, or Trie, etc. Although this does provide some organization, it still lacks coherence. For example, many questions can be solved using HashMaps but still require different algorithmic techniques. I would love to see question sets that follow not only the same data structure but also similar algorithmic techniques. The best thing I came across was the problem-solving patterns like &lt;strong&gt;Sliding Window&lt;/strong&gt;, &lt;strong&gt;Fast and Slow Pointers&lt;/strong&gt;, or &lt;strong&gt;Topological Sort&lt;/strong&gt;, etc. Following these patterns helped me nurture my ability to map a new problem to an already known problem. This not only made this whole coding-interview-preparation process fun but also a lot more organized.&lt;/p&gt;

&lt;p&gt;I have gathered around 25 of these coding problem patterns, which I believe can help anyone learn these beautiful algorithmic techniques and make a real difference in the coding interviews. The idea behind these patterns is, once you’re familiar with a pattern, you’ll be able to solve dozens of problems with it. For a detailed discussion of these patterns and related problems with solutions, take a look at &lt;strong&gt;&lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjku4w4s0d9dmqqk4cq8w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjku4w4s0d9dmqqk4cq8w.jpg" alt="Photo by Kelly Sikkema on Unsplash"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, without further ado, let me list all these patterns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sliding Window&lt;/li&gt;
&lt;li&gt;Two Pointers&lt;/li&gt;
&lt;li&gt;Fast &amp;amp; Slow Pointers&lt;/li&gt;
&lt;li&gt;Merge Intervals&lt;/li&gt;
&lt;li&gt;Cyclic Sort&lt;/li&gt;
&lt;li&gt;In-place Reversal of a LinkedList&lt;/li&gt;
&lt;li&gt;Tree Breadth-First Search&lt;/li&gt;
&lt;li&gt;Tree Depth First Search&lt;/li&gt;
&lt;li&gt;Two Heaps&lt;/li&gt;
&lt;li&gt;Subsets&lt;/li&gt;
&lt;li&gt;Modified Binary Search&lt;/li&gt;
&lt;li&gt;Bitwise XOR&lt;/li&gt;
&lt;li&gt;Top 'K' Elements&lt;/li&gt;
&lt;li&gt;K-way Merge&lt;/li&gt;
&lt;li&gt;0/1 Knapsack&lt;/li&gt;
&lt;li&gt;Unbounded Knapsack&lt;/li&gt;
&lt;li&gt;Fibonacci Numbers&lt;/li&gt;
&lt;li&gt;Palindromic Subsequence&lt;/li&gt;
&lt;li&gt;Longest Common Substring&lt;/li&gt;
&lt;li&gt;Topological Sort&lt;/li&gt;
&lt;li&gt;Trie Traversal&lt;/li&gt;
&lt;li&gt;Number of Island&lt;/li&gt;
&lt;li&gt;Trial &amp;amp; Error&lt;/li&gt;
&lt;li&gt;Union Find&lt;/li&gt;
&lt;li&gt;Unique Paths&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Following is a small intro of each of these patterns with sample problems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Sliding Window
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This algorithm ic technique is used when we need to handle the input data in specific window size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbn1rg55idymns15af7w8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbn1rg55idymns15af7w8.png" alt="Sliding Window Pattern"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628541009794_1Unit" rel="noopener noreferrer"&gt;Longest Substring with K Distinct Characters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628541018393_2Unit" rel="noopener noreferrer"&gt;Fruits into Baskets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628541055153_6Unit" rel="noopener noreferrer"&gt;Permutation in a String&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  2. Two Pointers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; In this technique, we use two pointers to iterate the input data. Generally, both pointers move in the opposite direction at a constant interval.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53mrza4l8p5gjjm99o5u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53mrza4l8p5gjjm99o5u.png" alt="Two Pointers Pattern"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743435284_3Unit" rel="noopener noreferrer"&gt;Squaring a Sorted Array&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743488620_8Unit" rel="noopener noreferrer"&gt;Dutch National Flag Problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743511885_11Unit" rel="noopener noreferrer"&gt;Minimum Window Sort&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  3. Fast &amp;amp; Slow Pointers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Also known as Hare &amp;amp; Tortoise algorithm. In this technique, we use two pointers that traverse the input data at a different speed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuw2is3ce1nimrmstl2jh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuw2is3ce1nimrmstl2jh.png" alt="Fast &amp;amp; Slow Pointers Pattern"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743569684_16Unit" rel="noopener noreferrer"&gt;Middle of the LinkedList&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743560700_15Unit" rel="noopener noreferrer"&gt;Happy Number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743595805_19Unit" rel="noopener noreferrer"&gt;Cycle in a Circular Array&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  4. Merge Intervals
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique is used to deal with overlapping intervals. Given two intervals ('a' and 'b'), there will be six different ways the two intervals can relate to each other:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F25coju9i2lq5j7bclegm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F25coju9i2lq5j7bclegm.png" alt="Intervals Overlapping"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;(Intervals Intersection)[&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743634893_23Unit" rel="noopener noreferrer"&gt;https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743634893_23Unit&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743642980_24Unit" rel="noopener noreferrer"&gt;Conflicting Appointments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743654901_25Unit" rel="noopener noreferrer"&gt;Minimum Meeting Rooms&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  5. Cyclic Sort
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to solve array problems where the input data lies within a fixed range.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743711992_31Unit" rel="noopener noreferrer"&gt;Find all Missing Numbers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743734011_33Unit" rel="noopener noreferrer"&gt;Find all Duplicate Numbers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743754602_36Unit" rel="noopener noreferrer"&gt;Find the First K Missing Positive Numbers&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  6. In-place Reversal of a LinkedList
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique describes an efficient way to reverse the links between a set of nodes of a LinkedList. Often, the constraint is that we need to do this in-place, i.e., using the existing node objects and without using extra memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmtuqq41d92jcvffuexb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmtuqq41d92jcvffuexb.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F685etmm20eh7xiuig2f6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F685etmm20eh7xiuig2f6.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4y0heocbw3l4c861lpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4y0heocbw3l4c861lpn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743796880_40Unit" rel="noopener noreferrer"&gt;Reverse every K-element Sub-list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743812259_42Unit" rel="noopener noreferrer"&gt;Rotate a LinkedList&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  7. Tree Breadth-First Search
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; As the name suggests, this technique is used to solve problems involving traversing trees in a breadth-first search manner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx6mw4xmkj96hbr4arnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx6mw4xmkj96hbr4arnr.png" alt="Binary Tree Breadth-First Search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743844952_44Unit" rel="noopener noreferrer"&gt;Binary Tree Level Order Traversal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743873257_48Unit" rel="noopener noreferrer"&gt;Minimum Depth of a Binary Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743890075_50Unit" rel="noopener noreferrer"&gt;Connect Level Order Siblings&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  8. Tree Depth First Search
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; As the name suggests, this technique is used to solve problems involving traversing trees in depth-first search manner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743947562_57Unit" rel="noopener noreferrer"&gt;Path With Given Sequence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743955693_58Unit" rel="noopener noreferrer"&gt;Count Paths for a Sum&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  9. Two Heaps
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; In many problems, where we are given a set of elements such that we can divide them into two parts. We are interested in knowing the smallest element in one part and the biggest element in the other part. As the name suggests, this technique uses a Min-Heap to find the smallest element and a Max-Heap to find the biggest element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;br&gt;
1.&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743994867_62Unit" rel="noopener noreferrer"&gt;Find the Median of a Number Stream&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744015026_65Unit" rel="noopener noreferrer"&gt;Next Interval&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  10. Subsets
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique when the problem asks to deal with permutations or combinations of a set of elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744066603_70Unit" rel="noopener noreferrer"&gt;String Permutations by changing case&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744084164_72Unit" rel="noopener noreferrer"&gt;Unique Generalized Abbreviations&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  11. Modified Binary Search
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to search a sorted set of elements efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744141988_78Unit" rel="noopener noreferrer"&gt;Ceiling of a Number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744182053_83Unit" rel="noopener noreferrer"&gt;Bitonic Array Maximum&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  12. Bitwise XOR
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique uses the XOR operator to manipulate bits to solve problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744240302_89Unit" rel="noopener noreferrer"&gt;Two Single Numbers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744253956_91Unit" rel="noopener noreferrer"&gt;Flip and Invert an Image&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;ol&gt;
&lt;li&gt;Top 'K' Elements
&lt;strong&gt;Usage:&lt;/strong&gt; This technique is used to find top/smallest/frequently occurring 'K' elements in a set.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744290707_95Unit" rel="noopener noreferrer"&gt;'K' Closest Points to the Origin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744333663_101Unit" rel="noopener noreferrer"&gt;Maximum Distinct Elements&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  14. K-way Merge
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique helps us solve problems that involve a list of sorted arrays.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744417564_109Unit" rel="noopener noreferrer"&gt;Kth Smallest Number in M Sorted Lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744424045_110Unit" rel="noopener noreferrer"&gt;Kth Smallest Number in a Sorted Matrix&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  15. 0/1 Knapsack
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique is used to solve optimization problems. Use this technique to select elements that give maximum profit from a given set with a limitation on capacity and that each element can only be picked once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744468342_115Unit" rel="noopener noreferrer"&gt;Equal Subset Sum Partition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744485888_117Unit" rel="noopener noreferrer"&gt;Minimum Subset Sum Difference&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  16. Unbounded Knapsack
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to select elements that give maximum profit from a given set with a limitation on capacity and that each element can be picked multiple times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940224549_1Unit" rel="noopener noreferrer"&gt;Rod Cutting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940234373_2Unit" rel="noopener noreferrer"&gt;Coin Change&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  17. Fibonacci Numbers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to solve problems that follow the Fibonacci numbers sequence, i.e., every subsequent number is calculated from the last few numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940375183_1Unit" rel="noopener noreferrer"&gt;Staircase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940440291_0Unit" rel="noopener noreferrer"&gt;House Thief&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  18. Palindromic Subsequence
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; This technique is used to solve optimization problems related to palindromic sequences or strings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940453874_1Unit" rel="noopener noreferrer"&gt;Longest Palindromic Subsequence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940499419_0Unit" rel="noopener noreferrer"&gt;Minimum Deletions in a String to make it a Palindrome&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  19. Longest Common Substring
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to find the optimal part of a string/sequence or set of strings/sequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940565491_6Unit" rel="noopener noreferrer"&gt;Maximum Sum Increasing Subsequence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-dynamic-programming&amp;amp;unit=grokking-dynamic-programming_1629940637763_13Unit" rel="noopener noreferrer"&gt;Edit Distance&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  20. Topological Sort
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to find a linear ordering of elements that have dependencies on each other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744536717_122Unit" rel="noopener noreferrer"&gt;Tasks Scheduling&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744560693_125Unit" rel="noopener noreferrer"&gt;Alien Dictionary&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  21. Trie Traversal
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique that involves creating or traversing of Trie data structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Longest Word in Dictionary&lt;/li&gt;
&lt;li&gt;Palindrome Pairs&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  22. Number of Island
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to traverse a two-dimensional array and find a set of connected elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Number of Distinct Islands&lt;/li&gt;
&lt;li&gt;Maximum Area of Island&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  23. Trial &amp;amp; Error
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to traverse an array to find a required optimal element. The traversal process runs in a trial &amp;amp; error manner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find Kth Smallest Pair Distance&lt;/li&gt;
&lt;li&gt;Minimize Max Distance to Gas Station&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  24. Union Find
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to solve problems that require maintaining a given set of elements partitioned into multiple non-overlapping subsets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Number of Provinces&lt;/li&gt;
&lt;li&gt;Bipartite Graph&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  25. Unique Paths
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Use this technique to find different/optimal ways to traverse a multi-dimensional array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find Unique Paths&lt;/li&gt;
&lt;li&gt;Dungeon Game&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Like it or not, LeetCode-type questions are a part of almost every programming interview, so every software developer should practice them before an interview. Their only option is to prepare smartly and learn problem-solving by focusing on the underlying problem patterns. Learn more about these patterns and sample problems in &lt;a href="https://www.designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt; and &lt;a href="https://designgurus.io/course/grokking-dynamic-programming" rel="noopener noreferrer"&gt;Grokking Dynamic Programming for Coding Interviews&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Check &lt;a href="http://www.designgurus.io/" rel="noopener noreferrer"&gt;Design Gurus&lt;/a&gt; for some interesting courses on Coding and &lt;a href="https://designgurus.io/course/grokking-the-system-design-interview" rel="noopener noreferrer"&gt;System Design interviews&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Read more about system design coding interviews:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/blog/Mastering-the-System-Design-Interview-Complete-Guide" rel="noopener noreferrer"&gt;Mastering the System Design Interview: A Complete Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/blog/sys-design-papers" rel="noopener noreferrer"&gt;Ace Your System Design Interview with 7 Must-Read Papers in 2023&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/gitconnected/system-design-interview-survival-guide-2023-preparation-strategies-and-practical-tips-ba9314e6b9e3" rel="noopener noreferrer"&gt;System Design Interview Survival Guide (2023): Preparation Strategies and Practical Tips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/blog/grokking-leetcode" rel="noopener noreferrer"&gt;Grokking LeetCode: A Smarter Way to Prepare for Coding Interviews&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.designgurus.io/blog/amazon-14-question" rel="noopener noreferrer"&gt;14 Most Popular Amazon Coding Interview Questions&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>How to Use Consistent Hashing in a System Design Interview?</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Sat, 19 Jun 2021 23:25:03 +0000</pubDate>
      <link>https://dev.to/arslan_ah/how-to-use-consistent-hashing-in-a-system-design-interview-33ge</link>
      <guid>https://dev.to/arslan_ah/how-to-use-consistent-hashing-in-a-system-design-interview-33ge</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakcu5t3nf8xrpybgpysl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fakcu5t3nf8xrpybgpysl.png" alt="Consistent Hashing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While designing a scalable system, one of the most important aspects is defining how the data will be partitioned and replicated across servers.&lt;/p&gt;

&lt;p&gt;Let's first define partitioning and replication so that we are on the same page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data partitioning:&lt;/strong&gt; It is the process of distributing data across a set of servers. It improves the scalability and performance of the system.&lt;br&gt;
&lt;strong&gt;Data replication:&lt;/strong&gt; It is the process of making multiple copies of data and storing them on different servers. It improves the availability and durability of the data across the system.&lt;/p&gt;

&lt;p&gt;Data partition and replication strategies lie at the core of any distributed system. A carefully designed scheme for partitioning and replicating the data &lt;strong&gt;enhances the performance, availability, and reliability of the system&lt;/strong&gt; and also defines how efficiently the system will be scaled and managed.&lt;/p&gt;

&lt;p&gt;David Karger et al. first introduced Consistent Hashing in their &lt;a href="https://dl.acm.org/doi/10.1145/258533.258660" rel="noopener noreferrer"&gt;1997 paper&lt;/a&gt; and suggested its use in distributed caching. Later, Consistent Hashing was adopted and enhanced to be used across many distributed systems. In this lesson we will see how Consistent Hashing efficiently solves the problem of data partitioning and replication.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is data partitioning?
&lt;/h2&gt;

&lt;p&gt;As stated above, the act of distributing data across a set of nodes is called data partitioning. There are two challenges when we try to distribute data:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;How do we know on which node a particular piece of data will be stored?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we add or remove nodes, how do we know what data will be moved from existing nodes to the new nodes? Additionally, how can we minimize data movement when nodes join or leave?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A naive approach will use a suitable hash function to map the data key to a number. Then, find the server by applying modulo on this number and the total number of servers. For example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5a9urexl2nbwgbhoud5x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5a9urexl2nbwgbhoud5x.jpg" alt="Data partitioning using simple hashing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scheme described in the above diagram solves the problem of finding a server for storing/retrieving the data. But when we add or remove a server, all our existing mappings will be broken. This is because the total number of servers will be changed, which was used to find the actual server storing the data. So to get things working again, we have to &lt;strong&gt;remap all the keys&lt;/strong&gt; and move our data based on the new server count, which will be a &lt;strong&gt;complete mess!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Consistent Hashing to the rescue
&lt;/h2&gt;

&lt;p&gt;Distributed systems can use Consistent Hashing to distribute data across nodes. Consistent Hashing maps data to physical nodes and ensures that &lt;strong&gt;only a small set of keys move when servers are added or removed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consistent Hashing stores the data managed by a distributed system in a ring. Each node in the ring is assigned a range of data. Here is an example of the consistent hash ring:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk63qezdvk3cbqjmhlkby.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk63qezdvk3cbqjmhlkby.jpg" alt="Consistent Hashing ring"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With consistent hashing, the ring is divided into smaller, predefined ranges. Each node is assigned one of these ranges. The start of the range is called a &lt;strong&gt;token&lt;/strong&gt;. This means that each node will be assigned one token. The range assigned to each node is computed as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Range start:&lt;/strong&gt;  Token value&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Range end:&lt;/strong&gt;    Next token value - 1&lt;/p&gt;

&lt;p&gt;Here are the tokens and data ranges of the four nodes described in the above diagram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlw4s0wghomgxl8lifoe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlw4s0wghomgxl8lifoe.png" alt="Token ranges"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever the system needs to read or write data, the first step it performs is to apply the MD5 hashing algorithm to the key. The output of this hashing algorithm determines within which range the data lies and hence, on which node the data will be stored. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The MD5 (aka MD5 Message-Digest Algorithm) is a hashing function that accepts a message of any length as input and returns as output a fixed-length digest value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As we saw above, each node is supposed to store data for a fixed range. Thus, the hash generated from the key tells us the node where the data will be stored. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrnufz3hguss1vt01p09.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrnufz3hguss1vt01p09.jpg" alt="Distributing data on the Consistent Hashing ring&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Consistent Hashing scheme described above works great when a node is added or removed from the ring, as in these cases, since only the next node is affected. For example, when a node is removed, the next node becomes responsible for all of the keys stored on the outgoing node. However, this scheme can &lt;strong&gt;result in non-uniform data and load distribution&lt;/strong&gt;. This problem can be solved with the help of Virtual nodes.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual nodes
&lt;/h2&gt;

&lt;p&gt;Adding and removing nodes in any distributed system is quite common. Existing nodes can die and may need to be decommissioned. Similarly, new nodes may be added to an existing cluster to meet growing demands. To efficiently handle these scenarios, Consistent Hashing makes use of virtual nodes (or Vnodes).&lt;/p&gt;

&lt;p&gt;As we saw above, the basic Consistent Hashing algorithm assigns a single token (or a consecutive hash range) to each physical node. This was a static division of ranges that requires calculating tokens based on a given number of nodes. This scheme made adding or replacing a node an expensive operation, as, in this case, we would like to rebalance and distribute the data to all other nodes, resulting in moving a lot of data. Here are a few potential issues associated with a manual and fixed division of the ranges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adding or removing nodes&lt;/strong&gt;: Adding or removing nodes will result in recomputing the tokens causing a significant administrative overhead for a large cluster.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hotspots&lt;/strong&gt;: Since each node is assigned one large range, if the data is not evenly distributed, some nodes can become hotspots&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In a distributed system, any server responsible for a huge partition of data can become a bottleneck for the system. A large share of data storage and retrieval requests will go to that node which can effectively bring the performance of the whole system down. Such loaded servers are called hotspots. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Node rebuilding&lt;/strong&gt;: Since each node's data might be replicated (for fault-tolerance) on a fixed number of other nodes, when we need to rebuild a node, only its replica nodes can provide the data. This puts a lot of pressure on the replica nodes and can lead to service degradation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To handle these issues, Consistent Hashing introduces a new scheme of distributing the tokens to physical nodes. Instead of assigning a single token to a node, the hash range is divided into multiple smaller ranges, and each physical node is assigned several of these smaller ranges. Each of these subranges is considered a Vnode. With Vnodes, instead of a node being responsible for just one token, it is responsible for many tokens (or subranges). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxq07w772atiqe0z4fsb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxq07w772atiqe0z4fsb.jpg" alt="Comparing Consistent Hashing ring with and without Vnodes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Practically, Vnodes are &lt;strong&gt;randomly distributed&lt;/strong&gt; across the cluster and are generally &lt;strong&gt;non-contiguous&lt;/strong&gt; so that no two neighboring Vnodes are assigned to the same physical node or rack. Additionally, nodes do carry replicas of other nodes for fault tolerance. Also, since there can be heterogeneous machines in the clusters, some servers might hold more Vnodes than others. The figure below shows how physical nodes A, B, C, D, &amp;amp; E use Vnodes of the Consistent Hash ring. Each physical node is assigned a set of Vnodes and each Vnode is replicated once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyko0g3uleqv3ew9iql7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyko0g3uleqv3ew9iql7.jpg" alt="Mapping Vnodes to physical nodes on a Consistent Hashing ring"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of Vnodes
&lt;/h3&gt;

&lt;p&gt;Vnodes gives the following advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; As Vnodes help spread the load more evenly across the physical nodes on the cluster by dividing the hash ranges into smaller subranges, this speeds up the rebalancing process after adding or removing nodes. When a new node is added, it receives many Vnodes from the existing nodes to maintain a balanced cluster. Similarly, when a node needs to be rebuilt, instead of getting data from a fixed number of replicas, many nodes participate in the rebuild process. &lt;/li&gt;
&lt;li&gt; Vnodes make it easier to maintain a cluster containing heterogeneous machines. This means, with Vnodes, we can assign a high number of sub-ranges to a powerful server and a lower number of sub-ranges to a less powerful server.&lt;/li&gt;
&lt;li&gt; In contrast to one big range, since Vnodes help assign smaller ranges to each physical node, this decreases the probability of hotspots.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Data replication using Consistent Hashing
&lt;/h2&gt;

&lt;p&gt;To ensure highly available and durability, Consistent Hashing replicates each data item on multiple N nodes in the system where the value N is equivalent to the replication factor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The replication factor is the number of nodes that will receive the copy of the same data. For example, a replication factor of two means there are two copies of each data item, where each copy is stored on a different node.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each key is assigned to a &lt;strong&gt;coordinator node&lt;/strong&gt; (generally the first node that falls in the hash range), which first stores the data locally and then replicates it to 'N-1' clockwise successor nodes on the ring. This results in each node owning the region on the ring between it and its 'Nth' predecessor. In an &lt;strong&gt;eventually consistent&lt;/strong&gt; system, this replication is done asynchronously (in the background).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In eventually consistent systems, copies of data don't always have to be identical as long as they are designed to eventually become consistent. In distributed systems, eventual consistency is used to achieve high availability.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwpqwzenp3bb164vwz4m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwpqwzenp3bb164vwz4m.jpg" alt="Data replication in Consistent Hashing&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Consistent Hashing in System Design Interviews
&lt;/h2&gt;

&lt;p&gt;As we saw above, Consistent Hashing helps with efficiently partitioning and replicating data; therefore, any distributed system that needs to scale up or down or wants to achieve high availability through data replication can utilize Consistent Hashing. A few such examples could be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any system working with a set of storage (or database) servers and needs to scale up or down based on the usage, e.g., the system could need more storage during Christmas because of high traffic.&lt;/li&gt;
&lt;li&gt;Any distributed system that needs dynamic adjustment of its cache usage by adding or removing cache servers based on the traffic load.&lt;/li&gt;
&lt;li&gt;Any system that wants to replicate its data shards to achieve high availability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Consistent Hashing use cases
&lt;/h2&gt;

&lt;p&gt;Amazon’s &lt;a href="https://www.allthingsdistributed.com/2007/10/amazons_dynamo.html" rel="noopener noreferrer"&gt;Dynamo&lt;/a&gt; and Apache &lt;a href="https://en.wikipedia.org/wiki/Apache_Cassandra" rel="noopener noreferrer"&gt;Cassandra&lt;/a&gt; use Consistent Hashing to distribute and replicate data across nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  References and further reading
&lt;/h2&gt;

&lt;p&gt;Have a look at &lt;a href="https://www.designgurus.org/course/grokking-the-advanced-system-design-interview" rel="noopener noreferrer"&gt;Grokking the Advanced System Design Interview &lt;/a&gt; for some good examples of how distributed systems use Consistent Hashing.&lt;/p&gt;

&lt;p&gt;Check &lt;a href="https://www.designgurus.org/" rel="noopener noreferrer"&gt;Design Gurus&lt;/a&gt; for some good courses on Programming and System Design interviews.&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>bigdata</category>
      <category>career</category>
      <category>architecture</category>
    </item>
    <item>
      <title>The Ultimate Strategy to Preparing for the Coding Interview</title>
      <dc:creator>Arslan Ahmad</dc:creator>
      <pubDate>Tue, 13 Aug 2019 09:50:58 +0000</pubDate>
      <link>https://dev.to/arslan_ah/the-ultimate-strategy-to-preparing-for-the-coding-interview-3ace</link>
      <guid>https://dev.to/arslan_ah/the-ultimate-strategy-to-preparing-for-the-coding-interview-3ace</guid>
      <description>&lt;h3&gt;
  
  
  How to prepare more quickly for coding interviews
&lt;/h3&gt;

&lt;p&gt;Coding interviews are getting harder every day. A few years back, brushing up on key data structures and going through 50–75 practice coding interview questions was more than enough prep for an interview. Today, everyone has access to massive sets of coding problems, and they’ve gotten more difficult as well. The overall interview process has gotten more competitive.&lt;br&gt;
In this post, I’d like to share a strategy I follow to prepare for coding interviews. My software engineering career spans around 15 years, in which I’ve switched jobs five times. I’ve given around 30 interview loops containing 120+ interviews. I have some experience sitting on the other side of the table too. I’ve taken 200+ coding interviews and 100+ system design interviews.&lt;/p&gt;

&lt;p&gt;I consider myself a reasonably smart engineer, but I had my challenges solving coding problems on a whiteboard, especially in an interview setting with someone evaluating me. To tackle this, I’d spend a reasonable time for preparation and practice. One thing I didn’t realize was that while doing my preparation, I was following a systematic approach. I would go through 12–15 questions, practicing two hours every day. This meant that I could solve 350+ questions within one month. Using this routine, I was able to crack my interviews for FAANGs (Facebook, Apple, Amazon, Netflix, Google).&lt;/p&gt;

&lt;p&gt;How was I able to practice 12+ coding questions every day with a fulltime job? Well, I wasn’t solving coding problems but practicing to map problems onto problems that I’d already solved. I used to read a problem and spend a few minutes to map it to a similar problem I’d seen before. If I could map it, I’d focus only on the different constraints this problem had compared to the parent problem. If it was a new problem, then I’d try to solve it and also read around to find smart ways other people used to devise its algorithm. Over time, I developed a set of problem-patterns that helped me quickly map a problem to an already-known one. Here are some examples of these patterns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If the given input is sorted (array, list, or matrix), then we will use a variation of &lt;strong&gt;Binary Search&lt;/strong&gt; or a &lt;strong&gt;Two Pointers&lt;/strong&gt; strategy.&lt;/li&gt;
&lt;li&gt;If we’re dealing with top/maximum/minimum/closest &lt;code&gt;k&lt;/code&gt; elements among &lt;code&gt;n&lt;/code&gt; elements, we will use a &lt;strong&gt;Heap&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If we need to try all combinations (or permutations) of the input, we can either use recursive &lt;strong&gt;Backtracking&lt;/strong&gt; or iterative &lt;strong&gt;Breadth-First Search&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Following this pattern-based approach helped me save a lot of preparation time. Once you’re familiar with a pattern, you’ll be able to solve dozens of problems with it. In addition, this strategy made me confident to tackle unknown problems, as I’ve been practicing mapping unknown problems to known ones.&lt;/p&gt;

&lt;p&gt;In the remaining post, I will share all the patterns I’ve collected and present sample problems for a few. For a detailed discussion of these and related problems with solutions take a look at &lt;a href="https://designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt;.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzaawqdbj8t4km3sxlzau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fzaawqdbj8t4km3sxlzau.png" alt="Pattern 1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Sample Problem for Binary Search
&lt;/h2&gt;
&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744182053_83Unit" rel="noopener noreferrer"&gt;Bitonic array maximum&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem statement&lt;/strong&gt;&lt;br&gt;
Find the maximum value in a given Bitonic array. An array is considered bitonic if it is monotonically increasing and then monotonically decreasing. Monotonically increasing or decreasing means that for any index &lt;code&gt;i&lt;/code&gt; in the array, &lt;code&gt;arr[i] != arr[i+1]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example: Input: [1, 3, 8, 12, 4, 2], Output: 12&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
A bitonic array is a sorted array; the only difference is that its first part is sorted in ascending order, and the second part is sorted in descending order. We can use a variation of Binary Search to solve this problem. Remember that in Binary Search we have &lt;code&gt;start&lt;/code&gt;, &lt;code&gt;end&lt;/code&gt;, and &lt;code&gt;middle&lt;/code&gt; indices and in each step we reduce our search space by moving start or end. Since no two consecutive numbers are the same (as the array is monotonically increasing or decreasing), whenever we calculate the &lt;code&gt;middle&lt;/code&gt; index for Binary Search, we can compare the numbers pointed out by the index &lt;code&gt;middle&lt;/code&gt; and &lt;code&gt;middle+1&lt;/code&gt; to find if we are in the ascending or the descending part. So:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If &lt;code&gt;arr[middle] &amp;gt; arr[middle + 1]&lt;/code&gt;, we are in the second (descending) part of the bitonic array. Therefore, our required number could either be pointed out by middle or will be before &lt;code&gt;middle&lt;/code&gt;. This means we will do &lt;code&gt;end = middle&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;arr[middle] &amp;lt;= arr[middle + 1]&lt;/code&gt;, we are in the first (ascending) part of the bitonic array. Therefore, the required number will be after &lt;code&gt;middle&lt;/code&gt;. This means we do &lt;code&gt;start = middle + 1&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can break when &lt;code&gt;start == end&lt;/code&gt;. Due to the above two points, both &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; will point at the maximum number of the Bitonic array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
Here is the Java code to solve this problem:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;h2&gt;
  
  
  Sample Problem for Two Pointers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743417172_1Unit" rel="noopener noreferrer"&gt;Pair with target sum&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem statement&lt;/strong&gt;&lt;br&gt;
Given an array of sorted numbers and a target sum, find a pair in the array whose sum is equal to the given target.&lt;/p&gt;

&lt;p&gt;Write a function to return the indices of the two numbers (i.e., the pair) such that they add up to the given target.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example: Input: [1, 2, 3, 4, 6], target = 6, Output: [1, 3] (The numbers at index 1 and 3 add up to 6: 2+4=6)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
Since the given array is sorted, a brute-force solution could be to iterate through the array, taking one number at a time and searching for the second number through Binary Search. The time complexity of this algorithm will be O(N*logN). Can we do better than this?&lt;/p&gt;

&lt;p&gt;We can follow the Two Pointers approach. We will start with one pointer pointing to the beginning of the array and another pointing at the end. At every step, we will see if the numbers pointed by the two pointers add up to the target sum. If they do, we’ve found our pair. Otherwise, we’ll do one of two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If the sum of the two numbers pointed by the two pointers is greater than the target sum, we need a pair with a smaller sum. So, to try more pairs, we can decrement the end-pointer.&lt;/li&gt;
&lt;li&gt;If the sum of the two numbers pointed by the two pointers is smaller than the target sum, this means that we need a pair with a larger sum. So, to try more pairs, we can increment the start-pointer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the visual representation of this algorithm for the example mentioned above:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frmmy4qaddjg9zfqdmowz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frmmy4qaddjg9zfqdmowz.png" alt="Visual Rep"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
Here is what our algorithm will look like:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh66fl6r2fg2ww257j7jc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh66fl6r2fg2ww257j7jc.png" alt="Pattern 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample Problem
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744290707_95Unit" rel="noopener noreferrer"&gt;K closest points to the origin&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Given an array of points in a 2D plane, find &lt;code&gt;K&lt;/code&gt; closest points to the origin.&lt;br&gt;
&lt;code&gt;Example: Input: points = [[1,2],[1,3]], K = 1, Output: [[1,2]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
The Euclidean distance of a point P(x,y) from the origin can be calculated through the following formula:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa87rsd14n31vh09zupfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa87rsd14n31vh09zupfe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use a Max Heap to find K points closest to the origin. We can start by pushing K points in the heap. While iterating through the remaining points, if a point (say P) is closer to the origin than the top point of the max-heap, we will remove that top point from the heap and add P to always keep the closest points in the heap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
Here is what our algorithm will look like:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F08a0yr8wevcw443wl6xm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F08a0yr8wevcw443wl6xm.png" alt="Pattern 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample Problem
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628744042826_67Unit" rel="noopener noreferrer"&gt;Subsets&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem statement&lt;/strong&gt;&lt;br&gt;
Given a set with distinct elements, find all of its distinct subsets.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example: Input: [1, 5, 3]&lt;br&gt;
Output: [], [1], [5], [3], [1,5], [1,3], [5,3], [1,5,3]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
To generate all subsets of the given set, we can use the Breadth-First Search (BFS) approach. We can start with an empty set, iterate through all numbers one-by-one, and add them to existing sets to create new subsets.&lt;/p&gt;

&lt;p&gt;Let’s take the aforementioned example to go through each step of our algorithm:&lt;/p&gt;

&lt;p&gt;Given set: [1, 5, 3]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with an empty set: [[]]&lt;/li&gt;
&lt;li&gt;Add the first number (1) to all the existing subsets to create new subsets: [[], &lt;strong&gt;[1]&lt;/strong&gt;];&lt;/li&gt;
&lt;li&gt;Add the second number (5) to all the existing subsets: [[], [1], &lt;strong&gt;[5], [1,5]&lt;/strong&gt;];&lt;/li&gt;
&lt;li&gt;Add the third number (3) to all the existing subsets: [[], [1], [5], [1,5], &lt;strong&gt;[3], [1,3], [5,3], [1,5,3]&lt;/strong&gt;].&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the visual representation of the above steps:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ft3cc10ekujxqgjp4ebd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ft3cc10ekujxqgjp4ebd1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
Here is what our algorithm will look like:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdmkq2pf3yluf7r3c8756.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdmkq2pf3yluf7r3c8756.png" alt="Pattern 4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample Problem
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.designgurus.org/path-player?courseid=grokking-the-coding-interview&amp;amp;unit=grokking-the-coding-interview_1628743923908_54Unit" rel="noopener noreferrer"&gt;Binary Tree Path Sum&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem Statement&lt;/strong&gt;&lt;br&gt;
Given a binary tree and a number S, find if the tree has a path from root-to-leaf such that the sum of all the node values of that path equals S.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F41h4nl6du2a6n15w06aj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F41h4nl6du2a6n15w06aj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
As we are trying to search for a root-to-leaf path, we can use the Depth First Search (DFS) technique to solve this problem.&lt;/p&gt;

&lt;p&gt;To recursively traverse a binary tree in a DFS fashion, we can start from the root and, at every step, make two recursive calls, one for the left and one for the right child.&lt;/p&gt;

&lt;p&gt;Here are the steps for our Binary Tree Path Sum problem:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start DFS with the root of the tree.&lt;/li&gt;
&lt;li&gt;If the current node is not a leaf node, do two things: a) Subtract the value of the current node from the given number to get a new sum =&amp;gt; &lt;code&gt;S = S - node.value&lt;/code&gt;, b) Make two recursive calls for both the children of the current node with the new number calculated in the previous step.&lt;/li&gt;
&lt;li&gt;At every step, see if the current node being visited is a leaf node and if its value is equal to the given number S. If both are true, we have found the required root-to-leaf path, therefore return true.&lt;/li&gt;
&lt;li&gt;If the current node is a leaf, but its value is not equal to the given number S, return false.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
Here is what our algorithm will look like:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8wow5xuy9tl2twt3y51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fy8wow5xuy9tl2twt3y51.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftme9i3rsfotwh00zhejz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftme9i3rsfotwh00zhejz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F44n1scuq9aebue6r4xbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F44n1scuq9aebue6r4xbd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdnyyx8zytorppvnuoves.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdnyyx8zytorppvnuoves.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fke3iyp2i75oir24fh71u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fke3iyp2i75oir24fh71u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhob05x7mxm2ml0z02pnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhob05x7mxm2ml0z02pnq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Following these patterns helped me tremendously to save time for my coding interview prep. Take a look at &lt;a href="https://designgurus.io/course/grokking-the-coding-interview" rel="noopener noreferrer"&gt;Grokking the Coding Interview&lt;/a&gt; and &lt;a href="https://designgurus.io/course/grokking-dynamic-programming" rel="noopener noreferrer"&gt;Grokking Dynamic Programming Patterns for Coding Interviews&lt;/a&gt; to find more of such patterns and their sample problems.&lt;/p&gt;

&lt;p&gt;Check &lt;a href="//www.designgurus.io"&gt;Design Gurus&lt;/a&gt; for some good courses on Programming Interviews and System Design interviews.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>career</category>
      <category>codinginterview</category>
      <category>codinginterviewquestions</category>
    </item>
  </channel>
</rss>
