<?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>Forem: Parul Chaddha</title>
    <description>The latest articles on Forem by Parul Chaddha (@parulchaddha).</description>
    <link>https://forem.com/parulchaddha</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%2F1175390%2F2bbcd648-ccd9-447d-8132-5de08cdbb904.jpeg</url>
      <title>Forem: Parul Chaddha</title>
      <link>https://forem.com/parulchaddha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/parulchaddha"/>
    <language>en</language>
    <item>
      <title>Scalability Trade-offs</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Tue, 01 Jul 2025 19:46:40 +0000</pubDate>
      <link>https://forem.com/parulchaddha/scalability-trade-offs-52ll</link>
      <guid>https://forem.com/parulchaddha/scalability-trade-offs-52ll</guid>
      <description>&lt;p&gt;Ever wondered what happens when your side project goes viral overnight? You get thousands of users in an hour, and suddenly… your website crashes. It’s slow. Things break. And people leave.&lt;/p&gt;

&lt;p&gt;Why? Because your system wasn’t &lt;em&gt;scalable&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In this blog, I’ll break down &lt;strong&gt;scalability&lt;/strong&gt; in a super simple way — no heavy jargon, just the real stuff you need to know if you're a developer, builder, or someone curious about how apps like Instagram or Amazon handle millions of users without falling apart.&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 What Is Scalability?
&lt;/h2&gt;

&lt;p&gt;In simple terms:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Scalability&lt;/strong&gt; is the ability of a system to handle &lt;strong&gt;increased load&lt;/strong&gt; — whether it’s more users, more data, or more traffic — &lt;strong&gt;without breaking, crashing, or slowing down&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So when we say “this app scales well,” we mean:  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“It still works smoothly, even if a lot more people start using it.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚙️ Is Scalability About Coding or Hardware?
&lt;/h2&gt;

&lt;p&gt;Here’s the truth — it’s both.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Good code&lt;/strong&gt; helps your system stay efficient.
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Right infrastructure&lt;/strong&gt; helps your system stay alive when traffic grows.
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Smart architecture&lt;/strong&gt; decides &lt;em&gt;how easily&lt;/em&gt; you can grow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can't throw better hardware at bad design and expect miracles. You need both working together.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Types of Scalability
&lt;/h2&gt;

&lt;p&gt;There are two ways to scale a system:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Vertical Scalability (Scaling Up)
&lt;/h3&gt;

&lt;p&gt;This means upgrading your existing server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add more RAM&lt;/li&gt;
&lt;li&gt;Use faster CPU&lt;/li&gt;
&lt;li&gt;Better disk speed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📦 Think of it like upgrading your laptop — same machine, just more powerful.&lt;/p&gt;

&lt;p&gt;✅ Simple&lt;br&gt;&lt;br&gt;
❌ There’s a limit — you can’t upgrade forever&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Horizontal Scalability (Scaling Out)
&lt;/h3&gt;

&lt;p&gt;This means adding more servers to share the load.&lt;/p&gt;

&lt;p&gt;📦 Think of it like hiring more chefs when your restaurant gets too many orders.&lt;/p&gt;

&lt;p&gt;✅ Flexible, preferred for large-scale systems&lt;br&gt;&lt;br&gt;
❌ More complex — needs load balancers and distributed systems design&lt;/p&gt;




&lt;h2&gt;
  
  
  🛑 How Do You Know a System Is &lt;em&gt;Not&lt;/em&gt; Scalable?
&lt;/h2&gt;

&lt;p&gt;Here are some red flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⏳ Slows down when users increase
&lt;/li&gt;
&lt;li&gt;💥 Crashes under load
&lt;/li&gt;
&lt;li&gt;🐌 Delayed responses
&lt;/li&gt;
&lt;li&gt;🔄 Features stop working randomly
&lt;/li&gt;
&lt;li&gt;🔗 One service’s failure brings everything down
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your app works fine with 100 users but misbehaves with 500, you’ve hit a scalability issue.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ How Do You Build a Scalable System?
&lt;/h2&gt;

&lt;p&gt;Let’s get to the good part — what actually makes a system scalable?&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Design Stateless Services
&lt;/h3&gt;

&lt;p&gt;Don’t tie user sessions to a single server. Use something like Redis to manage sessions.&lt;/p&gt;

&lt;p&gt;📌 Why? It allows you to spin up more servers easily.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Use Load Balancers
&lt;/h3&gt;

&lt;p&gt;When you have multiple backend servers, a load balancer sits in front and distributes traffic.&lt;/p&gt;

&lt;p&gt;📌 Think of it like a receptionist assigning customers to different counters.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Use Caching
&lt;/h3&gt;

&lt;p&gt;Not every request needs to hit the database.&lt;/p&gt;

&lt;p&gt;Use tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redis&lt;/strong&gt; or &lt;strong&gt;Memcached&lt;/strong&gt; for server-side caching
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CDNs&lt;/strong&gt; (like Cloudflare) for static files
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 It’s like keeping a copy of frequently used books near your desk instead of walking to the library each time.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Decouple Services
&lt;/h3&gt;

&lt;p&gt;Break your application into &lt;strong&gt;microservices&lt;/strong&gt; or at least modular services.&lt;/p&gt;

&lt;p&gt;📌 Benefit? You can scale only the part that needs it. For example, scale your payment service without touching user profiles.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Use Asynchronous Processing
&lt;/h3&gt;

&lt;p&gt;Not every task needs to be done &lt;em&gt;immediately&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Use queues like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kafka
&lt;/li&gt;
&lt;li&gt;RabbitMQ
&lt;/li&gt;
&lt;li&gt;AWS SQS
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 For example: After a user uploads a video, process it in the background — don’t make them wait.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Scale Your Database
&lt;/h3&gt;

&lt;p&gt;This is often the bottleneck. You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add &lt;strong&gt;replication&lt;/strong&gt; (copies of data)
&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;sharding&lt;/strong&gt; (split data across DBs)
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;NoSQL&lt;/strong&gt; (MongoDB, Cassandra) if data is unstructured
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. Monitor Everything
&lt;/h3&gt;

&lt;p&gt;If you can’t measure it, you can’t fix it.&lt;/p&gt;

&lt;p&gt;Use tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prometheus + Grafana
&lt;/li&gt;
&lt;li&gt;Datadog
&lt;/li&gt;
&lt;li&gt;New Relic
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 Watch CPU, memory, DB response time, and API failures.&lt;/p&gt;




&lt;h3&gt;
  
  
  8. Auto-Scaling &amp;amp; Cloud Infrastructure
&lt;/h3&gt;

&lt;p&gt;Cloud platforms (AWS, GCP, Azure) let you scale based on demand.&lt;/p&gt;

&lt;p&gt;📌 Example: Auto-add a server if CPU usage crosses 80%.&lt;/p&gt;

&lt;p&gt;Use containerization (Docker) and orchestration (Kubernetes) for scalable deployments.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Real-Life Analogy: The Coffee Shop
&lt;/h2&gt;

&lt;p&gt;Imagine you own a coffee shop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have 1 barista. All good.
&lt;/li&gt;
&lt;li&gt;Then 100 people walk in together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The barista panics and messes up orders — &lt;strong&gt;not scalable&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You bring in 5 more baristas and assign one to each counter — &lt;strong&gt;scalable&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same logic applies to apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Real-World Example
&lt;/h2&gt;

&lt;p&gt;Let’s say you’ve built a resume analysis tool (just an example):&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 1:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;1 backend server
&lt;/li&gt;
&lt;li&gt;Local file storage
&lt;/li&gt;
&lt;li&gt;No queue — everything sync
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Week 1: Gets 5k users a day
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;App slows down
&lt;/li&gt;
&lt;li&gt;File uploads hang
&lt;/li&gt;
&lt;li&gt;DB gets jammed
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fix:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use Amazon S3 for resume storage
&lt;/li&gt;
&lt;li&gt;Use Redis to cache past results
&lt;/li&gt;
&lt;li&gt;Add background processing for PDF parsing
&lt;/li&gt;
&lt;li&gt;Horizontal scaling with Docker containers
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Boom&lt;/strong&gt; — now your system can handle 100k users/day.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>performance</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Consistency Patterns</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Fri, 04 Apr 2025 21:52:08 +0000</pubDate>
      <link>https://forem.com/parulchaddha/consistency-patterns-p1j</link>
      <guid>https://forem.com/parulchaddha/consistency-patterns-p1j</guid>
      <description>&lt;p&gt;If you’ve ever built or worked with a distributed system, you’ve probably asked:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;“How do I keep all my data in sync when it’s scattered across multiple servers?”&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Well, that’s where &lt;strong&gt;consistency patterns&lt;/strong&gt; come in.&lt;/p&gt;




&lt;h2&gt;
  
  
  First, What’s a Distributed System?
&lt;/h2&gt;

&lt;p&gt;A distributed system is basically a bunch of components running on different networked computers, all working together to achieve a common goal. Think of it as teamwork—each part plays its role, and together, they build something powerful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
In an e-commerce app, you might have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;account service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;payment service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;order service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;inventory service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;loyalty points service&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a user buys a book, multiple services kick in. So how do we make sure they’re all on the same page (literally)? That’s where &lt;strong&gt;data consistency&lt;/strong&gt; becomes critical.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Does Consistency Matter?
&lt;/h2&gt;

&lt;p&gt;Let’s say two users try to buy the same last-copy book at the same time.&lt;br&gt;&lt;br&gt;
If the &lt;strong&gt;inventory&lt;/strong&gt; doesn’t update fast enough after the first order, both users might think the book is available. You can guess how that ends—not good for customer trust.&lt;/p&gt;




&lt;h2&gt;
  
  
  Meet the Consistency Patterns
&lt;/h2&gt;

&lt;p&gt;There are three major patterns that define how data is kept consistent in distributed systems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Strong Consistency
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Every read reflects the most recent write.&lt;/li&gt;
&lt;li&gt;All data copies are updated &lt;strong&gt;synchronously&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You always see the latest state—no surprises.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A banking system where a fund transfer must reflect &lt;strong&gt;immediately&lt;/strong&gt; on both accounts. No delays, no stale data. Accuracy over speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt; High data integrity&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons:&lt;/strong&gt; Higher latency, lower availability&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Weak Consistency
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Reads &lt;strong&gt;may or may not&lt;/strong&gt; reflect recent writes.&lt;/li&gt;
&lt;li&gt;Data may be inconsistent across nodes.&lt;/li&gt;
&lt;li&gt;Great for systems where &lt;strong&gt;speed matters more than precision&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
In online multiplayer games, actions might appear instantly to nearby players but lag for others if there’s network delay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt; High availability, low latency&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons:&lt;/strong&gt; Risk of data conflicts&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Eventual Consistency
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A flavor of weak consistency—but with a promise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eventually&lt;/strong&gt;, all nodes will reflect the latest data.&lt;/li&gt;
&lt;li&gt;Updates are propagated &lt;strong&gt;asynchronously&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A social media post shows up instantly for users in the same data center, but may take a few seconds to appear globally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt; Good balance between availability and consistency&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Cons:&lt;/strong&gt; Temporary inconsistencies&lt;/p&gt;




&lt;h2&gt;
  
  
  So, Which Pattern Should You Choose?
&lt;/h2&gt;

&lt;p&gt;It depends on what your system needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strong Consistency&lt;/strong&gt; → Use when &lt;strong&gt;accuracy&lt;/strong&gt; is non-negotiable (e.g., finance).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weak Consistency&lt;/strong&gt; → Use when &lt;strong&gt;speed&lt;/strong&gt; is crucial and some delay is acceptable (e.g., games).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eventual Consistency&lt;/strong&gt; → Use when you want &lt;strong&gt;scalability&lt;/strong&gt; and &lt;strong&gt;availability&lt;/strong&gt;, but can tolerate slight delays (e.g., social platforms).&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>CAP Theorem</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Thu, 03 Apr 2025 20:34:02 +0000</pubDate>
      <link>https://forem.com/parulchaddha/cap-theorem-4i6n</link>
      <guid>https://forem.com/parulchaddha/cap-theorem-4i6n</guid>
      <description>&lt;p&gt;Let’s start with a truth that hits every backend engineer eventually:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Scaling your system &lt;em&gt;will&lt;/em&gt; make your life more complicated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In today’s world of growing traffic, real-time apps, and microservices, we’re all striving to make our systems bigger, faster, and more resilient. And sure, throwing in extra hardware sounds like an easy fix—just add more servers, more storage, more compute. Problem solved, right?&lt;/p&gt;

&lt;p&gt;Not quite.&lt;/p&gt;

&lt;p&gt;The more we scale &lt;strong&gt;out&lt;/strong&gt;—adding more machines to distribute the load—the more we have to deal with the &lt;strong&gt;complexity&lt;/strong&gt; that comes with distributed systems. And that’s exactly where the &lt;strong&gt;CAP Theorem&lt;/strong&gt; becomes your new best friend (or worst enemy, depending on how well you understand it).&lt;/p&gt;




&lt;h2&gt;
  
  
  So, What Is the CAP Theorem?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;CAP Theorem&lt;/strong&gt; is a principle that applies to &lt;strong&gt;distributed systems&lt;/strong&gt;—those magical systems made of multiple nodes talking to each other across a network.&lt;/p&gt;

&lt;p&gt;It states that in the event of a &lt;strong&gt;network partition&lt;/strong&gt;, a distributed system can only guarantee &lt;strong&gt;two out of the following three properties&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt; – Every read receives the most recent write.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt; – Every request receives a (non-error) response, even if it's not the latest data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Tolerance&lt;/strong&gt; – The system continues to operate even if parts of the network can't communicate.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And here’s the kicker: &lt;strong&gt;you must choose two&lt;/strong&gt;. You can’t have all three. Not during a network partition.&lt;/p&gt;

&lt;p&gt;Let that sink in..........&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Definitions Before We Dive Deeper
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt; means that if you write a value to the system, all future reads return that same value—no surprises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt; means that every request receives some kind of response—success or stale data, but &lt;em&gt;never&lt;/em&gt; a timeout or failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Tolerance&lt;/strong&gt; means your system still works even if some nodes can’t talk to others. Because guess what? Networks fail. Regularly....&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reality Check: Networks Are Not Reliable
&lt;/h2&gt;

&lt;p&gt;We don’t live in a perfect world where all nodes stay connected forever.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Servers crash.
&lt;/li&gt;
&lt;li&gt;Routers drop packets.
&lt;/li&gt;
&lt;li&gt;Data centers get disconnected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don’t get to pick &lt;em&gt;if&lt;/em&gt; a network partition will happen—you only choose how to respond &lt;strong&gt;when&lt;/strong&gt; it does.&lt;/p&gt;

&lt;p&gt;And that’s where the CAP Theorem becomes more than just a theoretical concept. It becomes a design decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Trade-Off: CP vs AP (Because P Is Non-Negotiable)
&lt;/h2&gt;

&lt;p&gt;Since &lt;strong&gt;Partition Tolerance&lt;/strong&gt; is not optional in the real world, you’re left with two architectural styles:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. CP – &lt;strong&gt;Consistency + Partition Tolerance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In this setup, the system sacrifices &lt;strong&gt;Availability&lt;/strong&gt; during a partition.&lt;/p&gt;

&lt;p&gt;If two nodes can’t talk to each other, you may:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wait for the partitioned node to respond (could be a timeout),&lt;/li&gt;
&lt;li&gt;Or return an error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why would you do this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because your application &lt;strong&gt;can’t afford stale data&lt;/strong&gt;. Think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking transactions&lt;/li&gt;
&lt;li&gt;Inventory management&lt;/li&gt;
&lt;li&gt;Medical systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When correctness is critical, &lt;strong&gt;you choose consistency&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. AP – &lt;strong&gt;Availability + Partition Tolerance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now we flip it.&lt;/p&gt;

&lt;p&gt;In this model, the system remains &lt;strong&gt;Available&lt;/strong&gt;, even during partitions. But it may return:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slightly outdated data&lt;/li&gt;
&lt;li&gt;Temporary inconsistencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why would this make sense?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because your app needs to stay online, even if some data is stale. Think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shopping carts&lt;/li&gt;
&lt;li&gt;Social media feeds&lt;/li&gt;
&lt;li&gt;Streaming platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When user experience and uptime matter more than perfectly fresh data, &lt;strong&gt;you prioritize availability&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  This Is a Software Trade-Off—You’re in Control
&lt;/h2&gt;

&lt;p&gt;Here’s the good news: you get to decide how your system behaves when things go sideways.&lt;/p&gt;

&lt;p&gt;Want to pause all writes during a partition to ensure consistency? Go CP.&lt;/p&gt;

&lt;p&gt;Want to accept all writes and resolve conflicts later? Go AP.&lt;/p&gt;

&lt;p&gt;This decision depends entirely on your application’s requirements. But here’s what’s non-negotiable:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Network partitions will happen. Prepare for it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Final Thoughts: Why the CAP Theorem Matters
&lt;/h2&gt;

&lt;p&gt;Building distributed systems gives you scale, speed, and flexibility. But it also brings complexity and trade-offs.&lt;/p&gt;

&lt;p&gt;Understanding the CAP Theorem is essential because it helps you design systems that behave &lt;em&gt;predictably&lt;/em&gt; when the unpredictable happens.&lt;/p&gt;

&lt;p&gt;Mess this up, and your app may fail the moment you hit real-world traffic.&lt;/p&gt;

&lt;p&gt;Get it right, and you’ve built a foundation that can scale with confidence.&lt;/p&gt;

&lt;p&gt;So the next time you're designing a distributed system, ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can I tolerate stale data?&lt;/li&gt;
&lt;li&gt;Do I need every request to succeed?&lt;/li&gt;
&lt;li&gt;How critical is consistency for my users?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And remember: you can’t cheat the CAP Theorem, but you can play it smart.&lt;/p&gt;

</description>
      <category>cap</category>
      <category>theorem</category>
      <category>systemdesign</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Latency v/s Throughput – What’s Slowing You Down?</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Thu, 03 Apr 2025 04:57:05 +0000</pubDate>
      <link>https://forem.com/parulchaddha/latency-vs-throughput-whats-slowing-you-down-4kl5</link>
      <guid>https://forem.com/parulchaddha/latency-vs-throughput-whats-slowing-you-down-4kl5</guid>
      <description>&lt;p&gt;Ever waited for a web page to load and felt like time had slowed to a crawl? Or noticed your internet blazing fast while streaming but struggling during a video call?&lt;/p&gt;

&lt;p&gt;Let’s explore why that happens.&lt;/p&gt;

&lt;p&gt;Two core metrics drive system performance: &lt;strong&gt;latency&lt;/strong&gt; and &lt;strong&gt;throughput&lt;/strong&gt;. They might sound similar, but they measure very different things. By the end of this post, you’ll understand what they are, how they relate, and how they impact real-world systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Latency?
&lt;/h2&gt;

&lt;p&gt;Let’s say you click a button. How long does it take before something happens?&lt;/p&gt;

&lt;p&gt;That delay is &lt;strong&gt;latency&lt;/strong&gt;—the time between a request and its corresponding response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Latency&lt;/strong&gt; is typically measured in milliseconds (ms) or microseconds (µs), and it reflects how fast a system can respond to a single task. The lower the latency, the faster and more responsive the system feels.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Causes Latency?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Network travel time (especially across multiple hops)&lt;/li&gt;
&lt;li&gt;Network congestion&lt;/li&gt;
&lt;li&gt;Complex or inefficient algorithms&lt;/li&gt;
&lt;li&gt;Server or hardware load&lt;/li&gt;
&lt;li&gt;Disk or memory speed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;High latency often results in slow performance. Low latency, on the other hand, makes applications feel snappy and responsive.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Throughput?
&lt;/h2&gt;

&lt;p&gt;While latency is about the speed of a single task, &lt;strong&gt;throughput&lt;/strong&gt; measures the system’s capacity—how many tasks it can complete in a given time.&lt;/p&gt;

&lt;p&gt;Throughput is measured in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requests per second (RPS)&lt;/li&gt;
&lt;li&gt;Transactions per second (TPS)&lt;/li&gt;
&lt;li&gt;Bits per second (bps)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A high-throughput system can process large volumes of data or requests efficiently. A low-throughput system, even if fast for one user, will struggle when handling many simultaneous users.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Limits Throughput?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hardware capacity (CPU, memory, disk I/O)&lt;/li&gt;
&lt;li&gt;Network bandwidth&lt;/li&gt;
&lt;li&gt;Software design and architecture&lt;/li&gt;
&lt;li&gt;Algorithm efficiency&lt;/li&gt;
&lt;li&gt;Concurrency and thread management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Throughput matters when evaluating systems under load—like web servers, databases, and networks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Latency vs Throughput – What’s the Difference?
&lt;/h2&gt;

&lt;p&gt;Think of a toll booth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Latency&lt;/strong&gt; is how long it takes for one car to pass through.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Throughput&lt;/strong&gt; is how many cars can pass through per minute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Low latency but low throughput (fast for one, but not for many)&lt;/li&gt;
&lt;li&gt;High throughput but high latency (handles volume, but slowly)&lt;/li&gt;
&lt;li&gt;The ideal: low latency and high throughput (fast and scalable)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In system design, optimizing one often affects the other, which brings us to the trade-offs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Example: Web Servers
&lt;/h2&gt;

&lt;p&gt;Imagine you're running a web server and want web pages to load quickly (low latency) while also serving thousands of users (high throughput).&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Add More Servers
&lt;/h3&gt;

&lt;p&gt;Adding more servers increases &lt;strong&gt;throughput&lt;/strong&gt; by handling more requests in parallel. But latency might increase due to routing overhead or data replication across multiple servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Optimize Server Code
&lt;/h3&gt;

&lt;p&gt;Making the server software more efficient increases &lt;strong&gt;throughput&lt;/strong&gt; per server. But if it uses more resources to serve requests, individual response time may increase, raising &lt;strong&gt;latency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The solution often involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load balancing&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Smart request routing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These techniques help balance both latency and throughput.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Example: Databases
&lt;/h2&gt;

&lt;p&gt;In databases, tuning for latency might mean caching frequently accessed data in memory. This allows for near-instant data retrieval.&lt;/p&gt;

&lt;p&gt;However, relying too much on memory can reduce the system's &lt;strong&gt;throughput&lt;/strong&gt;, as less memory is available for other operations.&lt;/p&gt;

&lt;p&gt;Alternatively, optimizing for throughput might mean batch processing large amounts of data—efficient overall, but slower for individual queries, increasing latency.&lt;/p&gt;




&lt;h2&gt;
  
  
  So, Which One Should You Optimize?
&lt;/h2&gt;

&lt;p&gt;It depends on your use case.&lt;/p&gt;

&lt;p&gt;The general goal in system design is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Maximize throughput while maintaining acceptable latency.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If your system is blazing fast for one user but chokes with ten, it’s not scalable.&lt;br&gt;&lt;br&gt;
If it handles thousands of users but each request takes 5 seconds, it’s not usable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Latency and throughput are both critical, but they serve different purposes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Latency&lt;/strong&gt; measures responsiveness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Throughput&lt;/strong&gt; measures capacity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding how they interact helps you make smarter system design decisions. Whether you're working on web apps, APIs, databases, or networks—knowing when to optimize for one or balance both can make or break your system's performance.&lt;/p&gt;

</description>
      <category>latency</category>
      <category>throughput</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Scalability v/s Performance</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Wed, 02 Apr 2025 19:10:14 +0000</pubDate>
      <link>https://forem.com/parulchaddha/scalability-vs-performance-16ab</link>
      <guid>https://forem.com/parulchaddha/scalability-vs-performance-16ab</guid>
      <description>&lt;p&gt;Have you ever found yourself waiting in a long checkout line at your local supermarket? That everyday experience is a lot like the challenge of balancing &lt;strong&gt;performance&lt;/strong&gt; and &lt;strong&gt;scalability&lt;/strong&gt; in software development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Basics
&lt;/h3&gt;

&lt;p&gt;Early in my career, I mistakenly thought that performance and scalability were one and the same.&lt;br&gt;&lt;br&gt;
Imagine my surprise when my very first project to &lt;strong&gt;scale&lt;/strong&gt; a system ended up making my code &lt;strong&gt;run slower&lt;/strong&gt;—in my development environment, at least!  &lt;/p&gt;

&lt;p&gt;Let’s break it down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt; is all about &lt;strong&gt;speed&lt;/strong&gt;. It’s how fast your system processes a single request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt; is about &lt;strong&gt;handling growth&lt;/strong&gt;—more users, more data, more traffic—&lt;strong&gt;while keeping performance steady&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While the speed of light remains constant, software speed? Not so much.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Supermarket Analogy
&lt;/h3&gt;

&lt;p&gt;Picture a supermarket with a single cashier who checks out one shopper every minute.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When just one shopper comes in, everything is smooth.&lt;/li&gt;
&lt;li&gt;But what happens when &lt;strong&gt;two&lt;/strong&gt; shoppers arrive every minute?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s what it looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1st shopper&lt;/strong&gt;: Checked out in &lt;strong&gt;1 minute&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2nd shopper&lt;/strong&gt;: Waits 1 minute → Checkout = &lt;strong&gt;2 minutes&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3rd &amp;amp; 4th shoppers&lt;/strong&gt;: Each one waits even longer.&lt;/li&gt;
&lt;li&gt;Eventually, the &lt;strong&gt;wait time balloons&lt;/strong&gt; as more shoppers arrive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what’s happening here?&lt;/p&gt;

&lt;p&gt;The performance of one cashier is fine under low traffic, but once the flow increases, performance &lt;strong&gt;drops rapidly&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Scalability to the Rescue
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt; ensures that the system maintains &lt;strong&gt;consistent performance even as traffic increases&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This might mean building more complex systems that seem "slower" when things are quiet—but the trade-off is worth it when you're &lt;strong&gt;handling real traffic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, adding more cashiers in our supermarket:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Might take slightly longer for a single shopper.&lt;/li&gt;
&lt;li&gt;But allows the system to handle &lt;strong&gt;many more shoppers&lt;/strong&gt; efficiently.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Tactics for Better Scalability
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Caching
&lt;/h4&gt;

&lt;p&gt;Let’s say regulars buy the &lt;strong&gt;same items every day&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of scanning each item again and again, we give them a &lt;strong&gt;special receipt&lt;/strong&gt;. Scanning this receipt takes &lt;strong&gt;10 seconds&lt;/strong&gt;, not 1 full minute.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Boom. One cashier now checks out &lt;strong&gt;6 people per minute&lt;/strong&gt; instead of 1.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But of course, caching isn’t perfect. Sometimes the receipt (cache) &lt;strong&gt;fails&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The shopper’s items change daily.&lt;/li&gt;
&lt;li&gt;It’s a new shopper with no receipt.&lt;/li&gt;
&lt;li&gt;The receipt (cache) is lost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are &lt;strong&gt;cache misses&lt;/strong&gt;, and they might make things even slower (e.g., 1 min 10 sec instead of 1 min).&lt;/p&gt;




&lt;h4&gt;
  
  
  2. Adding More Cashiers
&lt;/h4&gt;

&lt;p&gt;More cashiers = more people served.&lt;/p&gt;

&lt;p&gt;But there’s still complexity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shoppers might spend time &lt;strong&gt;deciding&lt;/strong&gt; which cashier to approach.&lt;/li&gt;
&lt;li&gt;If one cashier is &lt;strong&gt;slow&lt;/strong&gt; or gets sick, lines get messed up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Space&lt;/strong&gt; becomes an issue as lines grow.&lt;/li&gt;
&lt;li&gt;People might &lt;strong&gt;cut the line&lt;/strong&gt;, causing frustration (and maybe chaos 😅).&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  3. Single Queue Strategy
&lt;/h4&gt;

&lt;p&gt;So what’s a better solution? A &lt;strong&gt;single, shared queue&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shoppers line up in one line.&lt;/li&gt;
&lt;li&gt;They go to the &lt;strong&gt;next available cashier&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;No worrying about being stuck behind a slowpoke.&lt;/li&gt;
&lt;li&gt;No panic if a cashier disappears.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, the shopper might have to &lt;strong&gt;walk a little farther&lt;/strong&gt;, but overall, &lt;strong&gt;fairness and efficiency win&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the world of software, this is like using a &lt;strong&gt;message queue&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Each shopper = a &lt;strong&gt;message&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Cashiers = &lt;strong&gt;worker processes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Queue = a place to &lt;strong&gt;manage load evenly&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Wrapping It Up
&lt;/h3&gt;

&lt;p&gt;Balancing &lt;strong&gt;performance&lt;/strong&gt; and &lt;strong&gt;scalability&lt;/strong&gt; is a lot like managing a busy supermarket.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t panic if your code slows down a bit after scaling—it’s &lt;strong&gt;expected&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Focus on the &lt;strong&gt;big picture&lt;/strong&gt;: Can your system handle growth &lt;strong&gt;without breaking&lt;/strong&gt;?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Happy scaling, and may your code run fast—even when the line is long!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>programming</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Introduction to System Design</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Tue, 01 Apr 2025 19:45:38 +0000</pubDate>
      <link>https://forem.com/parulchaddha/introduction-to-system-design-489f</link>
      <guid>https://forem.com/parulchaddha/introduction-to-system-design-489f</guid>
      <description>&lt;p&gt;If we break it down literally, &lt;strong&gt;System Designing&lt;/strong&gt; means &lt;strong&gt;designing a system&lt;/strong&gt;—simple, right? But the real question is:  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;"HOW?"&lt;/strong&gt; 🤔
&lt;/h3&gt;

&lt;p&gt;Let’s dive into it!  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is System Design?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;System design&lt;/strong&gt; is the process of planning and defining the architecture, components, and interactions of a system to meet specific requirements. It involves structuring different elements in a way that ensures efficiency, scalability, and reliability. The goal is to break down complex problems into manageable parts and design each component to work seamlessly as a whole.  &lt;/p&gt;

&lt;p&gt;System design isn’t a one-time process—it’s an &lt;strong&gt;evolving&lt;/strong&gt; approach that adapts to new challenges and requirements.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to Approach System Design?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let’s break it down into &lt;strong&gt;a structured roadmap&lt;/strong&gt; to designing a robust system:  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Understand the Problem&lt;/strong&gt; – Identify users, their needs, and system constraints.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;2. Define Scope&lt;/strong&gt; – Set clear boundaries: what the system &lt;strong&gt;will&lt;/strong&gt; and &lt;strong&gt;won’t&lt;/strong&gt; do.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;3. Research Existing Systems&lt;/strong&gt; – Learn from what worked (or failed) in similar systems.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;4. High-Level Design&lt;/strong&gt; – Outline core components and their interactions using diagrams or flowcharts.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;5. Refine the Design&lt;/strong&gt; – Iterate until the solution meets all requirements.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;6. Document Everything&lt;/strong&gt; – Keep records for future reference and scalability.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;7. Monitor &amp;amp; Improve&lt;/strong&gt; – Continuously optimize based on performance and new challenges.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;What’s Next?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This is just the beginning! In my next blog, I’ll dive into &lt;strong&gt;technical aspects&lt;/strong&gt; of system design, covering real-world case studies and best practices. Stay tuned! 🚀💡  &lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Mentorship to Full-time Offer | Flipkart SDE-1 Interview Experience</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Sun, 01 Sep 2024 22:24:05 +0000</pubDate>
      <link>https://forem.com/parulchaddha/mentorship-to-full-time-offer-flipkart-sde-1-interview-experience-13bp</link>
      <guid>https://forem.com/parulchaddha/mentorship-to-full-time-offer-flipkart-sde-1-interview-experience-13bp</guid>
      <description>&lt;p&gt;Hello readers!&lt;br&gt;
I’m excited to share my journey of interviewing at Flipkart, which led to an offer for a &lt;strong&gt;6-month internship (January to July)&lt;/strong&gt; and a full-time &lt;strong&gt;Software Development Engineer (SDE-1) role&lt;/strong&gt;. I got this opportunity through &lt;strong&gt;Flipkart’s Girls Wanna Code 5.0 program&lt;/strong&gt;, a mentorship initiative designed to support Women in Tech.&lt;/p&gt;

&lt;p&gt;Out of over &lt;strong&gt;13000+ applications&lt;/strong&gt;, only &lt;strong&gt;200 women&lt;/strong&gt; were chosen for the program. From that group, the &lt;strong&gt;top 30&lt;/strong&gt; were selected for interviews. I feel incredibly lucky to have been one of them, and in this blog, I’ll walk you through my experience and the lessons I learned along the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Points considered to be in TOP 30:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1- Your interaction with your mentor : Once you are selected for the program, you will be assigned a mentor&lt;br&gt;
2- Attendance in the sessions : You will get to attend live sessions&lt;br&gt;
3- Scores of the contests held during the mentorship : You will have to clear multiple mini contests&lt;br&gt;
4- &lt;strong&gt;Most Important&lt;/strong&gt;- Scores of the Final Assessment : Usual DSA questions&lt;/p&gt;

&lt;p&gt;There were a total of &lt;strong&gt;3 rounds&lt;/strong&gt; of interview (2 Tech + 1 Hiring Manager ) for all Top 30. Here is my interview experience:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 1 : Technical Interview (PS/DS 1) — Offline Flipkart Office,Bengaluru&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first interview was an in-person technical round held at Flipkart’s Bengaluru office. During this hour-long session, I was presented with two DSA (Data Structures and Algorithms) questions — one easy and one medium-level. However, I completed the interview in just 35 minutes.&lt;/p&gt;

&lt;p&gt;The first question focused on string manipulation, while the second was a dynamic programming problem named “&lt;a href="https://leetcode.com/problems/unique-paths-ii/description/" rel="noopener noreferrer"&gt;Unique Paths II&lt;/a&gt;” from LeetCode. I was asked to explain my approach, perform a dry run by drawing the recursion tree, and then write the optimized code on the whiteboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 2 : Technical Interview (PS/DS 2) — Online&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My second interview was online and it was an hour long that I concluded in 50 minutes. During this round, I was given one medium-level and one hard-level question.&lt;/p&gt;

&lt;p&gt;The first question was to determine if a linked list is a palindrome, and the second involved finding the distance between two nodes in a binary tree.&lt;/p&gt;

&lt;p&gt;I explained and wrote both the brute-force and optimized solutions for each problem. The interviewer was satisfied with my approach and solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 3: Hiring Manager — Online&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This round was a mix of CS fundamentals + Projects + Past Experience + HR questions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the list of questions that were asked to me.&lt;br&gt;
1- My past internship experience and questions related to that.&lt;br&gt;
2- About Projects and cross-question related to the implementation and its features.&lt;br&gt;
3- What is the difference between process and threads?&lt;br&gt;
4- What is deadlock?(Interviewer wasn’t expecting the bookish language instead a real-life example)&lt;br&gt;
5- Why do we use OOPs ?&lt;br&gt;
6- Difference between SQL and NoSQL databases?&lt;br&gt;
7- What is Cap theorem for NoSQL databases?&lt;br&gt;
8- Some SQL queries.&lt;br&gt;
9- What is Master-Slave architecture in DBMS and it’s working.&lt;br&gt;
10- My ambitions and how am I fit for the role?&lt;br&gt;
11- Why do I want to join Flipkart?&lt;br&gt;
12- Why do we hire you?&lt;br&gt;
13- My strengths and my weaknesses.&lt;br&gt;
14- How will I handle the pressure of work ?&lt;br&gt;
15- What do you think that you need to change in yourself?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;RESULTS!!&lt;/strong&gt;&lt;br&gt;
Finally #Flipkart_it_is!!!! and my happiness knew no bounds after that…….&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources :&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flipkart Interview Questions on GFG&lt;/li&gt;
&lt;li&gt;GFG past interview experiences&lt;/li&gt;
&lt;li&gt;DSA sheet by Fraz -&amp;gt; &lt;a href="https://docs.google.com/spreadsheets/u/0/d/1-wKcV99KtO91dXdPkwmXGTdtyxAfk1mbPXQg81R9sFE/htmlview?pli=1" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DSA sheet by Striver(takeUforward) -&amp;gt; &lt;a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DSA sheet by NeetCode -&amp;gt; &lt;a href="https://neetcode.io/practice" rel="noopener noreferrer"&gt;link&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thank you for reading! In case you need any help, feel free to reach out to me! You can reach out to me for any queries via &lt;a href="https://www.linkedin.com/in/parulchaddha0904/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; :) If the blog was helpful, show some love and smash the clap button below!!!&lt;/p&gt;

</description>
      <category>flipkart</category>
      <category>sde1</category>
      <category>interview</category>
      <category>offers</category>
    </item>
    <item>
      <title>Introduction to Docker</title>
      <dc:creator>Parul Chaddha</dc:creator>
      <pubDate>Mon, 16 Oct 2023 12:29:42 +0000</pubDate>
      <link>https://forem.com/parulchaddha/introduction-to-docker-13f9</link>
      <guid>https://forem.com/parulchaddha/introduction-to-docker-13f9</guid>
      <description>&lt;p&gt;Docker is a set of &lt;em&gt;platforms as a service (PaaS)&lt;/em&gt; products that use the Operating system level virtualization to deliver software in packages called containers.&lt;/p&gt;

&lt;p&gt;This is something a typical definition but let's understand it in simple terms.&lt;/p&gt;

&lt;p&gt;Think of Docker as a delivery service for software. It helps package up software and everything it needs to run into a neat box called a "container."&lt;br&gt;
Each container is like a separate box that holds a specific piece of software. These boxes are very good at keeping things separate and organized.&lt;br&gt;
Inside each container, you'll find the software, the tools it needs to work, and even its own settings. It's like the software's own little world.&lt;br&gt;
These containers can talk to each other if they need to. They have clear rules on how to communicate, like different rooms in a house connected by hallways.&lt;br&gt;
The clever part is that all these containers share the same "house" (the operating system), which makes it efficient. It's like living in an apartment building where everyone shares the same building but has their separate apartments.&lt;/p&gt;
&lt;h2&gt;
  
  
  *&lt;em&gt;Important Terminologies in Docker *&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Docker Image&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a file, comprised of multiple layers, used to execute code in a Docker container.&lt;/li&gt;
&lt;li&gt;They are a set of instructions used to create docker containers.
Simple terms explanation: Think of a Docker image as a snapshot of a software application. It's like taking a picture of a cake recipe, all the ingredients, and how to bake it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Docker Container&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a runtime instance of an image.&lt;/li&gt;
&lt;li&gt;Allows developers to package applications with all parts needed such as libraries and other dependencies.
Simple terms explanation: A Docker container is like a single, ready-to-eat cake made from the cake recipe image. It's a running instance of a Docker image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Docker file&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a text document that contains necessary commands which on execution helps assemble a Docker Image.&lt;/li&gt;
&lt;li&gt;Docker image is created using a Docker file.
Simple terms explanation: Think of a Dockerfile as the list of steps to make the "cake recipe image." It's like writing down all the ingredients and instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Docker Engine&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The software that hosts the containers is named Docker Engine.&lt;/li&gt;
&lt;li&gt;Docker Engine is a client-server based application
The docker engine has 3 main components:
&lt;strong&gt;Server:&lt;/strong&gt; It is responsible for creating and managing Docker images, containers, networks, and volumes on the Docker. It is referred to as a daemon process.
&lt;strong&gt;REST API:&lt;/strong&gt; It specifies how the applications can interact with the Server and instructs it what to do.
&lt;strong&gt;Client:&lt;/strong&gt; The Client is a docker command-line interface (CLI), that allows us to interact with Docker using the docker commands.
Simple terms explanation: The Docker Engine is like the chef in the kitchen. It's the software that creates and manages containers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Docker Hub&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker Hub is the official online repository where you can find other Docker Images that are available for use.&lt;/li&gt;
&lt;li&gt;It makes it easy to find, manage, and share container images with others.
Simple terms explanation: Docker Hub is like an online cookbook where you can find many "cake recipes" (Docker images) created by others. It's a place to share and discover recipes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Features of Docker:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open-source platform&lt;/li&gt;
&lt;li&gt;An Easy, lightweight, and consistent way of  delivery of applications&lt;/li&gt;
&lt;li&gt;Fast and efficient development life cycle.&lt;/li&gt;
&lt;li&gt;Segregation of duties&lt;/li&gt;
&lt;li&gt;Service-oriented architecture&lt;/li&gt;
&lt;li&gt;Security &lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Reduction in size&lt;/li&gt;
&lt;li&gt;Image management&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Volume management&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Architecture of Docker
&lt;/h2&gt;

&lt;p&gt;The Docker client talks with the docker daemon which helps in building, running, and distributing the docker containers. With the help of REST API over a  UNIX socket or a network, the docker client and daemon interact with each other. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Docker Daemon?&lt;/strong&gt;&lt;br&gt;
Docker daemon manages all the services by communicating with other daemons. It manages docker objects such as images, containers, networks, and volumes with the help of the API requests of Docker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Client&lt;/strong&gt;&lt;br&gt;
With the help of the docker client, the docker users can interact with the docker. The docker command uses the Docker API. The Docker client can communicate with multiple daemons. When a docker client runs any docker command on the docker terminal then the terminal sends instructions to the daemon. The Docker daemon gets those instructions from the docker client withinside the shape of the command and REST API’s request. The common commands which are used by clients are &lt;strong&gt;docker build, docker pull, and docker run.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Host&lt;/strong&gt;&lt;br&gt;
A Docker host is a type of machine that is responsible for running more than one container. It comprises the Docker daemon, Images, Containers, Networks, and Storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Registry&lt;/strong&gt;&lt;br&gt;
All the docker images are stored in the docker registry. There is a public registry which is known as a docker hub that can be used by anyone. We can run our private registry also. With the help of docker run or docker pull commands, we can pull the required images from our configured registry. Images are pushed into configured registry with the help of the docker push command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Storage&lt;/strong&gt;&lt;br&gt;
We can store data within the writable layer of the container but it requires a storage driver. Storage driver controls and manages the images and containers on our docker host. &lt;/p&gt;
&lt;h2&gt;
  
  
  Docker Cloud
&lt;/h2&gt;

&lt;p&gt;Docker Cloud is basically working as a service provider by Docker in which we can perform such as Operation system agnostic, packing only what is needed to run the application in an efficient manner, and easily moving to interact between infrastructure, among many others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operations of Docker Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nodes:– Connection between the cloud services provider such as MS Azure and AWS to run up containers.&lt;/li&gt;
&lt;li&gt;Data Processing:– Provide big data processing as a service package.&lt;/li&gt;
&lt;li&gt;Cloud Repository:– Provide a platform where we can store a number of versions in a specific Docker Image.&lt;/li&gt;
&lt;li&gt;Continuous Implementation:– Connect with GitHub and build a continuous integration pipeline.&lt;/li&gt;
&lt;li&gt;App Deployment:– Scale the Infrastructure and Containers with deployment.&lt;/li&gt;
&lt;li&gt;Consist Deployment:– it can be automated deployment.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Docker Commands
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Docker Run&lt;/strong&gt; &lt;br&gt;
This command is used to run a container from an image. The docker run command is a combination of the docker create and docker start commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker run &amp;lt;image_name&amp;gt;
To give name of container
$ docker run --name &amp;lt;container_name&amp;gt; &amp;lt;image_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Pull&lt;/strong&gt;&lt;br&gt;
This command allows you to pull any image which is present in the official registry of docker, Docker hub. By default, it pulls the latest image, but you can also mention the version of the image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker pull &amp;lt;image_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker PS&lt;/strong&gt;&lt;br&gt;
This command (by default) shows us a list of all the running containers. We can use various flags with it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;-a flag:  shows us all the containers, stopped or running.&lt;/li&gt;
&lt;li&gt;-l flag: shows us the latest container.&lt;/li&gt;
&lt;li&gt;-q flag: shows only the Id of the containers.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker ps [options..]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Docker Stop&lt;/strong&gt;&lt;br&gt;
This command allows you to stop a container if it has crashed or you want to switch to another one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker stop &amp;lt;container_ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Start&lt;/strong&gt;&lt;br&gt;
Suppose you want to start the stopped container again, you can do it with the help of this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker start &amp;lt;container_ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker rm&lt;/strong&gt;&lt;br&gt;
To delete a container. &lt;br&gt;
Some important flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;-f flag: remove the container forcefully.&lt;/li&gt;
&lt;li&gt;-v flag: remove the volumes.&lt;/li&gt;
&lt;li&gt;-l flag: remove the specific link mentioned.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker rm {options} &amp;lt;container_name or ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Docker Images&lt;/strong&gt;&lt;br&gt;
Lists all the pulled images which are present in our system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Login&lt;/strong&gt;&lt;br&gt;
The Docker login command will help you to authenticate with the Docker hub by which you can push and pull your images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker login 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Push&lt;/strong&gt;&lt;br&gt;
Once you build your own customized image by using Dockerfile you need to store the image in the remote registry which is DockerHub for that you need to push your image by using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker push &amp;lt;Image name/Image ID&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Build&lt;/strong&gt;&lt;br&gt;
The docker build command is used to build the docker images with the help of Dockerfile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t image_name:tag .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the place of image_name use the name of the image you build with and give the tag number and . “dot” represents the current directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Stop&lt;/strong&gt;&lt;br&gt;
You can stop and start the docker containers where you can do the maintenance for containers. To stop and start specific containers you can use the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop container_name_or_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Stop Multiple Containers&lt;/strong&gt;&lt;br&gt;
Instead of stopping a single container. You can stop multiple containers at a time by using the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop container1 container2 container3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Restart&lt;/strong&gt;&lt;br&gt;
While running the containers in Docker you may face some errors and containers fails to start. You can restart the containers to resolve the containers by using the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker restart container_name_or_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Inspection&lt;/strong&gt;&lt;br&gt;
Docker containers will run into some errors in real time to debug the container’s errors you can use the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker inspect container_name_or_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Docker Commit commands&lt;/strong&gt;&lt;br&gt;
After running the containers by using the current image you can make the updates to the containers by interacting with the containers from that containers you can create an image by using the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker commit container_name_or_id new_image_name:tag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This blog has covered up almost all the basics of Docker.&lt;br&gt;
Hope you liked it .😊😇&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>docker</category>
      <category>containers</category>
      <category>node</category>
    </item>
  </channel>
</rss>
