<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubham Raj Kumawat on Medium]]></title>
        <description><![CDATA[Stories by Shubham Raj Kumawat on Medium]]></description>
        <link>https://medium.com/@shubhamrajkumawat?source=rss-c76f58b4ea89------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pOfgj8ls6mYA6_lE_wtV2w.png</url>
            <title>Stories by Shubham Raj Kumawat on Medium</title>
            <link>https://medium.com/@shubhamrajkumawat?source=rss-c76f58b4ea89------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 09:49:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhamrajkumawat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PHP2Shell: CVE-2026–109618 & CVE-2026–109619 Explained (and How to Patch)]]></title>
            <link>https://shubhamrajkumawat.medium.com/php2shell-cve-2026-109618-cve-2026-109619-explained-and-how-to-patch-9f0112550042?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f0112550042</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 16:45:08 GMT</pubDate>
            <atom:updated>2026-10-25T16:45:08.026Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Critical PHP remote code execution vulnerabilities: how they work, which versions are affected, why config workarounds aren’t enough, and what the bugs teach us about half-built state</em></p><p>On October 21, 2026, the PHP project shipped an emergency release for two critical remote code execution bugs, CVE-2026–109618 and CVE-2026–109619, nicknamed PHP2Shell. Both score 9.2 on CVSS v4.0. Details leaked a day before the planned disclosure, which pulled the release forward, and AWS reported exploitation attempts as early as October 17, days before any patch existed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7MzLCuNniYblJUT1SLFtQ.png" /></figure><p>The headline is “patch now,” and you should. But the more durable story is in the bugs themselves. Both follow a pattern that shows up in far more codebases than PHP, and it is worth understanding even if you never write C.</p><h3>What was affected</h3><p>According to Google Cloud’s advisory summary, every PHP version from 5.4 through 8.5.11 is vulnerable. Fixes landed in 8.2.35, 8.3.36, 8.4.27 and 8.5.12, and the PHP security team also published minimal source backports for 7.4, 8.0 and 8.1. Every way of serving PHP over HTTP is in scope: Apache’s module, PHP-FPM, php-cgi, FrankenPHP and LiteSpeed. Palo Alto’s Unit 42 counted more than 22 million potentially exposed instances.</p><p>Two details make this worse than a typical application-layer bug:</p><ul><li>The flaws live in the interpreter, below WordPress, Laravel or any framework. Updating your application or plugins changes nothing.</li><li>PHP parses the request before your code runs. Application authentication, input validation and routing never get a chance to reject a malicious request, because the damage happens while PHP is still setting up or tearing down the request.</li></ul><h3>The shared pattern: abandon an operation, then trust the leftovers</h3><p>Datadog’s researchers, who reproduced the bugs independently, summarize both flaws the same way: a fatal error interrupts PHP partway through an operation, and later code treats the incomplete state as if it were valid.</p><p><strong>CVE-2026–109618</strong> is the memory-exhaustion variant. When PHP turns a form submission into the $_POST array, it inserts entries into an internal hash table. In the affected code, the table&#39;s bookkeeping counters were updated before the memory for the new key was allocated. The shape of the problem looks like this (simplified pseudocode, not PHP&#39;s actual source):</p><pre>slot = table-&gt;used++;          // 1. record that the slot exists<br>table-&gt;count++;<br>table-&gt;data[slot].key = alloc(len);   // 2. allocate; may fail</pre><p>If step 2 hits the memory limit, PHP raises a fatal error and abandons the insertion. The counters now claim a slot exists that was never initialized. When the request is cleaned up, the destructor walks every counted slot and interprets whatever bytes happen to be there as real values. If an attacker can influence those leftover bytes, they influence what cleanup does next.</p><p><strong>CVE-2026–109619</strong> is the lifecycle variant. A PHP worker serves many requests over its lifetime, and some worker-wide fields point at memory owned by a single request. If that memory is freed without clearing the pointer, a later request can follow a stale reference into freed memory, a classic use-after-free. PHP’s advisory describes two ways stale state survives: a fatal error interrupts a reset, or a late shutdown diagnostic recreates state after cleanup. The upload path is the notable one, because session upload progress is enabled by default and runs even if your application never starts a session.</p><h3>Why “just turn off the feature” is not a fix</h3><p>When details leaked, a one-line workaround circulated: disable session.upload_progress.enabled. It is worth being precise about what that does. It blocks the confirmed session-based path for CVE-2026-109619, but it does nothing for CVE-2026-109618, and PHP&#39;s own guidance says no configuration change fully fixes either flaw. The mitigation for the memory bug, setting memory_limit=-1, comes with its own caveats. It must be paired with request-size limits at the frontend and container memory limits, and process-level limits such as RLIMIT_AS should not be substituted, since they can trigger the very allocation failures the bug depends on.</p><p>Two days after the emergency release, PHP also published an informational advisory for a related issue, CVE-2026–115560, affecting unusual session configurations. PHP considers it unlikely in practice and plans a fix in a routine release, recommending the same upload-progress setting in the meantime. The lesson is not that configuration hardening is useless. It reduces exposure while you roll out an update, but it should never be the end state.</p><h3>What the patch changes</h3><p>The fix is instructive because it changes error handling rather than only the one insertion routine. A soft memory limit now defers the error until PHP reaches a safe point, letting an in-progress operation finish initializing its data. Past a higher hard limit, PHP terminates the worker immediately instead of running normal cleanup over potentially invalid state. Request-owned global state is also reset before anything can reuse it.</p><p>Datadog’s analysis points out that the counter-before-allocation ordering remains in the fixed code, and that the broader pattern is risky enough that similar bugs may surface. That is a fair reading: the patch closes the known exploit class by controlling how failure unwinds, not by removing every place where metadata is updated early.</p><h3>Engineering lessons worth taking away</h3><ol><li><strong>Commit metadata after the resource it describes.</strong> Allocate first, then update counters. If anything fails in between, the structure stays consistent.</li><li><strong>Cleanup code must not assume initialization succeeded.</strong> Destructors that trust counts or flags written earlier are only as safe as the last error path that touched them.</li><li><strong>For long-lived workers, reset is a feature, not a courtesy.</strong> Anything pointing at per-request memory needs an explicit, tested clear on every exit path, including fatal ones.</li><li><strong>When state is suspect, abort rather than unwind.</strong> Terminating a worker is a cheaper failure than running cleanup logic over corrupt data.</li><li><strong>Theoretical findings deserve follow-through.</strong> The PHP Foundation said a core developer noticed early signs of the memory flaw during a 2024 external audit, but no concrete route to code execution was found then. Bugs rated “unexploitable” tend to be rated that way until someone builds the exploit.</li></ol><h3>A practical response checklist</h3><ul><li><strong>Inventory first.</strong> Include containers and apps that bundle their own interpreter. The CLI PHP on a host often differs from the runtime serving web traffic.</li><li><strong>Update, then verify.</strong> Linux distributions frequently backport fixes without changing the upstream version number, so check your vendor’s advisory rather than the version string alone.</li><li><strong>Rebuild images and restart workers.</strong> A patched package does nothing for processes still running the old runtime.</li><li><strong>If you cannot patch yet,</strong> restrict public exposure and filter at a reverse proxy in front of PHP, and treat that as temporary.</li><li><strong>Hunt for signals.</strong> Fatal memory-exhaustion errors reported at “Unknown on line 0” mean PHP failed during request initialization, before any script ran. Unusually large or deeply nested multipart submissions, odd PHPSESSID values, and any shell spawned by a web worker deserve investigation. None is conclusive alone, and a successful attack does not necessarily crash the worker, so correlate them.</li></ul><h3>Closing thoughts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*pwOBbh1E8AcqadZ5h9aucA.png" /></figure><p>PHP2Shell is a reminder that the most dangerous bugs often sit in the least glamorous code: error paths, cleanup routines and lifecycle resets that run only when something has already gone wrong. If you operate PHP, patch today. If you build systems in any language, look at your own failure paths and ask a simple question: if this operation stops halfway, what will the next piece of code believe about the state it left behind?</p><p><strong>Sources</strong></p><ul><li><a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w">PHP security advisory for CVE-2026–109618 (GHSA-w8hw-w9fx-j79w)</a> and <a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp">CVE-2026–109619 (GHSA-6wmf-4rv5-p3rp)</a></li><li><a href="https://securitylabs.datadoghq.com/articles/php2shell-critical-vulnerabilities-in-php/">Datadog Security Labs: PHP2Shell analysis</a></li><li><a href="https://cloud.google.com/blog/products/identity-security/responding-to-core-php-vulnerabilities-cve-2026-109618-cve-2026-109619">Google Cloud: Responding to core PHP vulnerabilities</a></li><li><a href="https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/">Palo Alto Networks Unit 42 threat brief</a></li><li><a href="https://thehackernews.com/2026/10/php-issues-emergency-patches-for-two.html">The Hacker News: emergency patches</a> and <a href="https://thehackernews.com/2026/10/urgent-php-warns-of-another-unpatched.html">follow-up on CVE-2026–115560</a></li><li><a href="https://watchtowr.com/intelligence/php-cve-2026-109618-faq/">watchTowr PHP2Shell FAQ</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f0112550042" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Cracked the Arcesium Lead Engineer Interview — A Complete Experience]]></title>
            <link>https://shubhamrajkumawat.medium.com/how-i-cracked-the-arcesium-lead-engineer-interview-a-complete-experience-7994737b8fca?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/7994737b8fca</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[arcesium]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 14:52:15 GMT</pubDate>
            <atom:updated>2026-04-23T03:11:57.134Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Shubham | April 2026 | Backend Engineering | Java | Distributed Systems</em></p><p>I still remember the moment the recruiter pinged me on LinkedIn about Arcesium. I had been deep in my job search for a while — multiple interviews, some wins, some near-misses — and honestly I was a bit tired. But something about Arcesium felt different. A fintech company working with hedge funds and institutional asset managers, building post-trade processing systems at scale. Complex financial data problems. Real engineering depth. I decided to give it everything.</p><p>Four rounds later, I had an offer.</p><p>This post is my attempt to document every round in as much detail as I can remember — the questions, what I said, what worked, what almost didn&#39;t. I hope it saves someone else the anxiety I went through.</p><h3>A Little About Me</h3><p>I&#39;m Shubham, a Senior Backend Engineer and Tech Lead with 6+ years of experience. My primary stack is Java, Spring Boot, Kafka, AWS, and microservices. Most recently I was on an American Express engagement building event-driven financial data pipelines. Before that I spent a few years at Clarivate working on FoundationIP — a large-scale IP management SaaS platform on AWS where I grew into a Tech Lead role.</p><p>I&#39;m sharing this because when I was preparing I couldn&#39;t find a detailed Arcesium experience for a Lead/Senior Engineer level. Most posts were for freshers or had very surface-level information. Hopefully this fills that gap.</p><h3>The Process Overview</h3><pre>Round 1 — DSA + Project Discussion     ~60 minutes<br>Round 2 — High Level System Design     ~60 minutes<br>Round 3 — Database Design              ~60 minutes<br>Round 4 — Hiring Manager Round         ~75 minutes<br>Result  — Offer Received ✅</pre><p>Total process took about two weeks from first contact to offer.</p><h3>Round 1 — DSA + Project Discussion</h3><p>I was nervous going into this one. Not because I&#39;m bad at DSA — but because I genuinely never know what level of problem to expect. Would it be pure LeetCode hard? Would it be system-oriented? The interviewer actually eased my anxiety upfront by saying they prefer real-world style problems over abstract puzzles. That helped me relax.</p><h3>The Coding Problem</h3><p><strong>Problem:</strong></p><blockquote><em>Given a 2D grid representing a warehouse where </em><em>1 denotes a storage rack and </em><em>0 denotes empty space, count the number of distinct clusters of storage racks. A cluster is formed by adjacent </em><em>1s — up, down, left, right.</em></blockquote><p>I recognized this immediately — connected components on a grid. Classic BFS/DFS. I went with BFS because I find it more intuitive for grid problems and easier to explain step by step.</p><pre>public int countClusters(int[][] grid) {<br>    int rows = grid.length;<br>    int cols = grid[0].length;<br>    boolean[][] visited = new boolean[rows][cols];<br>    int count = 0;<br><br>    for (int i = 0; i &lt; rows; i++) {<br>        for (int j = 0; j &lt; cols; j++) {<br>            if (grid[i][j] == 1 &amp;&amp; !visited[i][j]) {<br>                bfs(grid, visited, i, j);<br>                count++;<br>            }<br>        }<br>    }<br>    return count;<br>}<br><br>private void bfs(int[][] grid, boolean[][] visited,<br>                  int row, int col) {<br>    Queue&lt;int[]&gt; queue = new LinkedList&lt;&gt;();<br>    queue.offer(new int[]{row, col});<br>    visited[row][col] = true;<br>    int[][] dirs = {{0,1},{0,-1},{1,0},{-1,0}};<br><br>    while (!queue.isEmpty()) {<br>        int[] curr = queue.poll();<br>        for (int[] dir : dirs) {<br>            int r = curr[0] + dir[0];<br>            int c = curr[1] + dir[1];<br>            if (r &gt;= 0 &amp;&amp; r &lt; grid.length &amp;&amp;<br>                c &gt;= 0 &amp;&amp; c &lt; grid[0].length &amp;&amp;<br>                grid[r][c] == 1 &amp;&amp; !visited[r][c]) {<br>                visited[r][c] = true;<br>                queue.offer(new int[]{r, c});<br>            }<br>        }<br>    }<br>}</pre><p>He seemed fine with this. Then the follow-ups started — and this is where it got interesting.</p><p><strong>Follow-up 1:</strong></p><blockquote><em>What if multiple warehouse grids are provided? How do you compute clusters for each?</em></blockquote><p>Simple enough — iterate over List&lt;int[][]&gt;, call the same function for each. Each grid is independent, no shared state.</p><p><strong>Follow-up 2 — the one I enjoyed:</strong></p><blockquote><em>What if we have hundreds or thousands of grids? Can you parallelize? What&#39;s your concurrency approach?</em></blockquote><p>This is where I felt the interview open up. I walked through the options:</p><pre>Option 1 — Sequential loop<br>  Works, doesn&#39;t scale. O(N × M × K)<br><br>Option 2 — Java parallel streams<br>  grids.parallelStream()<br>       .map(this::countClusters)<br>       .collect(toList())<br>  Uses ForkJoinPool. Good for CPU-bound<br>  work on a single machine.<br><br>Option 3 — ExecutorService with thread pool<br>  Fixed pool = Runtime.availableProcessors()<br>  Submit each grid as Callable&lt;Integer&gt;<br>  Collect Future&lt;Integer&gt; results<br>  More control than parallel streams.<br><br>Option 4 — Distributed (Kafka based)<br>  For thousands of grids at scale:<br>  Each grid as a Kafka message<br>  Consumer group processes in parallel<br>  Results aggregated downstream</pre><p>I recommended Option 3 for hundreds of grids on one machine and Option 4 if we&#39;re talking distributed scale with thousands. The interviewer engaged well with the Kafka option — which led nicely into the project discussion.</p><h3>Project Discussion</h3><p>He asked me to walk through a recent project. I talked about FoundationIP — the multi-tenant IP management platform at Clarivate. AWS-based, Spring Boot microservices, integrating with USPTO, Salesforce, Azure Service Bus.</p><p>The questions that followed were sharp:</p><p><strong>On Amazon SQS:</strong></p><blockquote><em>What was your specific use case for SQS in your system?</em></blockquote><p>We used SQS for per-client isolated queues in the USPTO PAIR integration. Patent status updates came in asynchronously from USPTO. Each enterprise client had their own SQS queue — so one client&#39;s heavy volume couldn&#39;t affect another. It also gave us per-client DLQ configuration which was important for compliance.</p><p><strong>On Kafka vs SQS:</strong></p><blockquote><em>You mentioned Kafka too. How is it different from SQS? And if Kafka can also do async processing, why wasn&#39;t it used here?</em></blockquote><p>This is a question I genuinely enjoy because the answer isn&#39;t obvious. My explanation:</p><pre>SQS:<br>├── Managed queue — simple, serverless on AWS<br>├── Message deleted after consumption<br>├── Per-client isolation is trivial<br>├── No replay capability<br>└── Perfect for fire-and-forget async<br><br>Kafka:<br>├── Distributed log — messages retained<br>├── Multiple consumer groups can read<br>│   the same message independently<br>├── Replay from any offset — powerful<br>├── Higher throughput at scale<br>└── More operational complexity</pre><p>Why SQS was chosen initially: the team was already deep in AWS ecosystem, per-client queue isolation was a hard requirement from enterprise law firm clients, and the volume didn&#39;t justify Kafka&#39;s operational overhead at that point. We did use Kafka internally for high-volume event streaming where replay and multiple consumers mattered.</p><p><strong>On the 30% performance improvement:</strong></p><blockquote><em>What was the pain point and how did you actually measure it?</em></blockquote><p>The Kafka producer was configured with acks=all and no batching — every message was a synchronous round trip to all replicas. Under load this was causing significant latency. I tuned three settings: switched to acks=1 for non-critical events, added linger.ms=10 for batching, enabled lz4 compression. Measured via CloudWatch before and after over a two-week period. 30% reduction in end-to-end processing latency confirmed.</p><p><strong>On job change motivation:</strong></p><blockquote><em>You&#39;ve been in your current role only a few months — why are you looking?</em></blockquote><p>I was honest. I&#39;ve been on the bench since the AmEx engagement ended. More fundamentally I want to move from consulting to product — I&#39;ve had breadth across domains but I want depth. Arcesium&#39;s financial data domain is that depth.</p><h3>Round 2 — High Level System Design (HLD)</h3><p>This was the round I had prepared most for and it showed. The problem appeared in the HackerRank notes section:</p><h3>Problem: Distributed Geo-Fencing Alert System</h3><pre>Design a mechanism that:<br>1. Allocates geo-fences with lat/long and radius<br>   (~100m each, total area ~5000 km²)<br>2. Admin allocates groups of people to fences<br>   (user can be in one group or multiple fences)<br>3. Triggers alert when person crosses a fence boundary<br>4. Tracks travel in real-time — person trail<br>   as they hop fence to fence<br><br>Device: IoT mobile<br>Storage: Transactional DB (Oracle/MySQL) + MongoDB<br>         3-month archival and purge policy<br>Expected: Key APIs, services,<br>          sync vs async, HLD</pre><p>The first thing I did was clarify scale — ~100K active tracked users, alerts within 2-3 seconds acceptable, location ping every 5 seconds from device.</p><p>Then I stated something upfront that I think set the right tone for the discussion:</p><blockquote><em>&quot;This system is fundamentally write-heavy. 100K users pinging every 5 seconds is 20,000 writes per second. The core challenge is decoupling location ingestion from geo-fence computation — otherwise one slow fence check blocks the entire write path.&quot;</em></blockquote><p>The architecture I designed:</p><pre>Mobile Device (IoT)<br>    ↓ HTTPS ping every 5s<br>API Gateway (Auth + Rate Limit)<br>    ↓<br>Location Ingestion Service  ← sync ACK to device<br>    ↓ async<br>Kafka (location-events topic, partitioned by userId)<br>    ↓              ↓                    ↓<br>Geo-Fence      Trail Recording      Analytics<br>Check Service  Service              Service<br>    ↓               ↓<br>Redis           MongoDB<br>(fence state)   (TTL 90 days)<br>    ↓<br>Alert Service<br>    ↓<br>FCM / SMS / Webhook</pre><p><strong>Key APIs I designed:</strong></p><pre>POST /api/v1/location/ping          Single location update<br>POST /api/v1/location/batch         Offline buffer flush<br>POST /api/v1/fences                 Admin creates fence<br>POST /api/v1/fence-groups/{id}/members  Admin assigns users<br>GET  /api/v1/users/{id}/trail       Get movement history<br>GET  /api/v1/alerts                 Get alerts for user</pre><p><strong>The geo-fence check algorithm</strong> — Haversine formula for point-in-circle distance. Redis stores fence-state:{userId}:{fenceId} as INSIDE or OUTSIDE. State change triggers alert. Kafka partition by userId guarantees ordering per user so the state machine works correctly.</p><p><strong>Sync vs async breakdown:</strong></p><pre>SYNC:  Mobile → Ingestion Service (instant ACK, don&#39;t make device wait)<br>       Admin → Fence CRUD APIs<br>ASYNC: Ingestion → Kafka → all downstream consumers<br>       Geo-check result → Kafka → Alert Service</pre><p>The interviewer asked about Kafka configuration specifically — partitioning strategy, producer settings, consumer lag handling. I went through linger.ms, acks, lz4 compression on producer side, and consumer lag monitoring via CloudWatch with auto-scaling triggers.</p><p>He also asked why MongoDB for trail data. My answer: trail records are append-only, schema-flexible, time-series in nature, need TTL-based auto-purge, and the 20K writes/sec volume benefits from MongoDB&#39;s write throughput. MySQL would struggle under that write load and TTL purge via cron jobs is operationally messy compared to MongoDB&#39;s native TTL index.</p><h3>Round 3 — Database Design</h3><p>One problem across 60 minutes. This round separates people who understand data from people who just write tables.</p><h3>Problem : Messaging App Database — WhatsApp Style</h3><blockquote><em>Design a database for a messaging app. Two people should be able to send text and multimedia messages with each other. People can exchange messages in a group — a group can contain a maximum of 100 people. Design for 10 million users. There must be no loss of information. Latency must be less.</em></blockquote><p>This was the last problem of the round and I could feel the clock. 15 minutes left, a fresh problem on screen. I took a breath and did what I had trained myself to do — clarify before I type anything.</p><p><strong>Clarifying questions I asked:</strong></p><pre>1:1 and group messages both?         → Yes, max 100 per group<br>Multimedia types?                    → Image, video, audio, documents<br>Delivery receipts (sent/delivered/read)? → Yes, per recipient<br>Message deletion — for me or everyone?  → Both<br>Online presence / last seen?         → Yes<br>Message retention?                   → Indefinite — the NFR says no loss</pre><p>The &quot;no loss of information&quot; NFR was stated explicitly. That immediately tells you two things: you need replication, and you need an event log that survives consumer failures.</p><p><strong>Entity tiers — I mapped these out loud before touching the editor:</strong></p><pre>Tier 1 — Core (can&#39;t exist without these):<br>  User, Conversation, Message<br><br>Tier 2 — Supporting:<br>  ConversationMember, MessageReceipt, MediaAttachment<br><br>Tier 3 — Operational:<br>  UserPresence, MessageDeletion</pre><p><strong>Core schema:</strong></p><pre>-- Single conversation table for both 1:1 and group<br>-- One unified inbox query — simpler than two separate tables<br>CREATE TABLE conversation (<br>    conversation_id   BIGSERIAL    PRIMARY KEY,<br>    conversation_type VARCHAR(10)  NOT NULL,   -- &#39;DIRECT&#39; or &#39;GROUP&#39;<br>    group_name        VARCHAR(100),            -- NULL for DIRECT<br>    created_by        BIGINT       REFERENCES app_user(user_id),<br>    last_message_at   TIMESTAMPTZ,             -- denormalized for inbox sort ★<br>    is_active         BOOLEAN      NOT NULL DEFAULT TRUE<br>);<br><br>CREATE INDEX idx_conv_last_message ON conversation(last_message_at DESC);<br><br>-- ConversationMember — who&#39;s in which chat<br>-- CRITICAL: last_read_message_id stored here for O(1) unread count<br>CREATE TABLE conversation_member (<br>    conversation_id      BIGINT      NOT NULL REFERENCES conversation(conversation_id),<br>    user_id              BIGINT      NOT NULL REFERENCES app_user(user_id),<br>    role                 VARCHAR(20) NOT NULL DEFAULT &#39;MEMBER&#39;, -- MEMBER, ADMIN<br>    joined_at            TIMESTAMPTZ NOT NULL DEFAULT NOW(),<br>    is_active            BOOLEAN     NOT NULL DEFAULT TRUE,<br>    last_read_message_id BIGINT,    -- unread count anchor<br>    PRIMARY KEY (conversation_id, user_id)<br>);<br><br>CREATE INDEX idx_member_user ON conversation_member(user_id) WHERE is_active = TRUE;<br><br>-- Message — the core fact table<br>CREATE TABLE message (<br>    message_id          BIGSERIAL   PRIMARY KEY,<br>    conversation_id     BIGINT      NOT NULL REFERENCES conversation(conversation_id),<br>    sender_id           BIGINT      NOT NULL REFERENCES app_user(user_id),<br>    message_type        VARCHAR(20) NOT NULL,  -- TEXT, IMAGE, VIDEO, AUDIO, DOCUMENT<br>    body                TEXT,<br>    reply_to_message_id BIGINT      REFERENCES message(message_id),<br>    sent_at             TIMESTAMPTZ NOT NULL DEFAULT NOW(),<br>    is_deleted_for_all  BOOLEAN     NOT NULL DEFAULT FALSE<br>);<br><br>-- The single most-hit index in the system<br>CREATE INDEX idx_message_conv_time ON message(conversation_id, sent_at DESC);<br><br>-- Media — metadata only, binary files go to S3<br>CREATE TABLE media_attachment (<br>    attachment_id    BIGSERIAL    PRIMARY KEY,<br>    message_id       BIGINT       NOT NULL REFERENCES message(message_id),<br>    storage_key      TEXT         NOT NULL,   -- S3 object key<br>    cdn_url          TEXT         NOT NULL,   -- CloudFront URL<br>    file_size_bytes  BIGINT       NOT NULL,<br>    mime_type        VARCHAR(100) NOT NULL,<br>    checksum_sha256  CHAR(64),               -- integrity verification<br>    duration_seconds INT                     -- for audio/video<br>);<br><br>-- Per-recipient delivery + read tracking<br>CREATE TABLE message_receipt (<br>    message_id    BIGINT      NOT NULL REFERENCES message(message_id),<br>    recipient_id  BIGINT      NOT NULL REFERENCES app_user(user_id),<br>    delivered_at  TIMESTAMPTZ,<br>    read_at       TIMESTAMPTZ,<br>    CONSTRAINT uq_receipt UNIQUE (message_id, recipient_id)<br>);<br><br>CREATE INDEX idx_receipt_undelivered<br>    ON message_receipt(recipient_id) WHERE delivered_at IS NULL;<br><br>-- Presence — kept separate from user table due to high write volume<br>CREATE TABLE user_presence (<br>    user_id      BIGINT PRIMARY KEY REFERENCES app_user(user_id),<br>    status       VARCHAR(20) NOT NULL DEFAULT &#39;OFFLINE&#39;,<br>    last_seen_at TIMESTAMPTZ NOT NULL DEFAULT NOW()<br>);<br><br>-- &quot;Delete for me&quot; — soft delete per user, not affecting others<br>CREATE TABLE message_deletion (<br>    message_id BIGINT NOT NULL REFERENCES message(message_id),<br>    user_id    BIGINT NOT NULL REFERENCES app_user(user_id),<br>    deleted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),<br>    PRIMARY KEY (message_id, user_id)<br>);</pre><p>The two design decisions I called out explicitly:</p><p><strong>last_message_at denormalized on conversation.</strong> The inbox loads constantly. You cannot run a subquery against the message table on every inbox render at 10M users. You write this field on every message send — worth the overhead.</p><p><strong>last_read_message_id on </strong><strong>conversation_member.</strong> The unread count for a conversation becomes a single COUNT WHERE message_id &gt; last_read_message_id. Or better — an INCR/DECR Redis counter keyed by user:{id}:conv:{id}:unread, updated atomically on every send and read event. No DB round trip on inbox load.</p><p><strong>On scale — the technology choices the question explicitly asked for:</strong></p><pre>10M users × 5 messages/day = 50M messages/day<br>~580 writes/second average, 5–10x spikes<br><br>Message store:   Cassandra — wide-row model, partition by<br>                 conversation_id, cluster by sent_at DESC.<br>                 One partition = one full conversation history.<br>                 Linear write scalability.<br><br>User/group metadata: PostgreSQL — ACID, joins still needed here,<br>                     low write volume.<br><br>Presence:        Redis TTL keys — DB cannot absorb 10M<br>                 heartbeat writes/second.<br><br>Media:           S3 + CloudFront — binary blobs never in DB.<br><br>Fan-out:         Kafka — decouple message write from delivery<br>                 to N recipients.<br><br>Unread counters: Redis INCR/DECR — atomic, sub-millisecond.</pre><p>Message delivery flow:</p><pre>Sender → API Server → Kafka topic: messages.inbound<br>                              ↓<br>                    Persistence Service<br>                    (write to Cassandra + update Redis counter)<br>                              ↓<br>                    Fan-out Service (per recipient)<br>                              ↓<br>                    WebSocket push OR APNs/FCM (if offline)</pre><p>On the &quot;no loss of information&quot; NFR specifically — I framed it as two distinct guarantees: durability (Cassandra RF=3 across availability zones, data survives any single node or AZ failure) and recoverability (Kafka retains the event stream for 7 days as a replay buffer, so if any consumer crashes or falls behind, it replays from its last committed offset — no messages are permanently lost).</p><p>The interviewer nodded. &quot;That&#39;s the right way to read that requirement.&quot;</p><h3>Round 4 — Hiring Manager Round</h3><p>This was the round I was most curious about going in. And honestly it turned out to be the most enjoyable conversation of the entire process. The HM was sharp, warm, and clearly knew his domain deeply. No fluff — every question had a follow-up that went one level deeper.</p><h3>Background</h3><p>He asked me to walk through my professional journey at a high level without going deep on any project — he said we&#39;d get into specifics later. I kept it to 90 seconds: Tavant for foundation, Clarivate for growth into Tech Lead, AmEx for financial domain exposure.</p><p>Then he observed something interesting:</p><blockquote><em>&quot;I see mostly core backend but also some traces of Angular. How do you see yourself as a general purpose engineer?&quot;</em></blockquote><p>I said T-shaped. Deep in backend — Java, distributed systems, Kafka, AWS. Broad enough in frontend to design better APIs and collaborate without gaps. Not full-stack, but not siloed either.</p><p>He followed up on React exposure, other backend languages, Python scripting specifics, and then asked about PySpark. I was honest — conceptually familiar, not hands-on production experience. He appreciated the directness and moved on.</p><h3>Technical Deep Dive</h3><p>He asked me to pick one interesting module I owned and walk through it completely. I chose the BMO module from FoundationIP.</p><p>The problem: IP attorneys needed to perform bulk updates on thousands of patent records simultaneously — status changes, deadline updates, reassignments. Naive synchronous processing would timeout, block the UI, or corrupt data on partial failures.</p><p>My design:</p><pre>Layer 1 — API (Spring Boot)<br>  Validate request → generate job ID → return immediately<br>  Don&#39;t make user wait for bulk processing<br><br>Layer 2 — Async (ActiveMQ)<br>  Job pushed to queue → consumer processes chunk by chunk<br>  Each chunk = 100 records = one DB transaction<br>  Failure in chunk 5 doesn&#39;t rollback chunks 1-4<br>  Partial success is acceptable, silent corruption is not<br><br>Layer 3 — Status tracking<br>  Job status table updated per chunk<br>  UI polls every 3 seconds → real-time progress<br>  Final report: success count + failed records with reasons</pre><p>He then pushed on business context — what are the actual use cases in FoundationIP? I walked through attorneys checking deadlines daily (the most critical read path — missing a patent deadline could mean losing the IP entirely), portfolio analytics queries via Apache Solr, automated USPTO status updates via SQS polling, and bulk operations.</p><p>Then came the question that I found genuinely interesting:</p><blockquote><em>&quot;What if Update A was supposed to happen before Update B, but Update A failed and Update B is already getting processed? Is that a real scenario?&quot;</em></blockquote><p>Yes, and here&#39;s how we handled it:</p><pre>1. State machine validation — every matter has<br>   defined valid transitions. FILED cannot move<br>   to PENDING. Invalid transitions rejected hard<br>   before any DB write.<br><br>2. Optimistic locking — @Version on every matter<br>   entity. If Update A and B both read version 5,<br>   A updates to version 6, B&#39;s update on version 5<br>   throws OptimisticLockException and retries.<br><br>3. Per-matter ordering — partition ActiveMQ queue<br>   by matterId. All operations for a given matter<br>   go to the same queue partition, processed<br>   sequentially. Ordering guaranteed per matter.<br><br>4. DLQ for failures — Update A fails after retries,<br>   goes to Dead Letter Queue, ops team alerted.<br>   Update B hits state machine validation, fails<br>   cleanly. Nothing silently corrupted.</pre><h3>DB Experience Deep Dive</h3><p>He asked me to walk through my complete database experience — what was chosen for what and why. I covered:</p><ul><li><strong>MySQL/Oracle</strong> for transactional config data — ACID, joins, referential integrity, stable schema</li><li><strong>MongoDB</strong> for flexible schema data — USPTO response payloads, attachment metadata, event logs, TTL auto-purge</li><li><strong>Redis</strong> for caching and session management — sub-millisecond reads, atomic counters, JWT blacklisting</li><li><strong>Apache Solr</strong> for full-text search — inverted index for millisecond search across millions of IP records vs SQL LIKE which would be a full table scan</li></ul><p>Then he went deep on Redis specifically:</p><blockquote><em>&quot;If a cache node goes down in distributed Redis, how do you handle the in-memory data? And how does cache invalidation work?&quot;</em></blockquote><p>On node failure: Redis Cluster mode with primary-replica pairs. Sentinel detects failure in ~5-10 seconds, replica promoted automatically. During those seconds — cache misses happen, requests fall through to DB. The key is always coding for cache miss as the normal fallback. Circuit breaker (Resilience4j) ensures if Redis is completely down, all requests go to DB without hammering the failed cache repeatedly.</p><p>On invalidation — I explained it depends on data type:</p><pre>Matter metadata (low change): Write-through<br>  Update DB and cache atomically<br>  TTL: 1 hour as safety net<br><br>Search results (acceptable staleness): TTL only<br>  5 minute TTL, let it expire naturally<br><br>Session tokens: Explicit delete on logout<br>  Cannot wait for TTL — security requirement<br><br>Bulk operations: Batch delete all affected keys<br>  Let them repopulate on next read<br>  Much safer than 1000 individual write-throughs</pre><p>The bulk invalidation point seemed to resonate. It&#39;s the kind of thing you only know from actually doing it in production.</p><h3>Production Incident</h3><blockquote><em>&quot;Talk me through a production incident — how you handled it near term and long term.&quot;</em></blockquote><p>On the AmEx engagement, our Kafka consumer processing financial transaction events started silently accumulating lag. No errors in logs initially — just reports showing data gaps and CloudWatch alarms for processing delays.</p><p>Investigation revealed: memory leak in a third-party deserializer was causing OOM, which caused consumer restarts, which triggered Kafka rebalances, which caused 30-second processing pauses on every restart. Over 3 hours this accumulated to 2 million messages of lag.</p><p>Immediate fix: increased JVM heap (bought time), rolling restart of consumers (stopped the rebalance cascade), reduced max.poll.records from 500 to 100 (less memory pressure). Lag cleared in 45 minutes. Zero data loss — Kafka retention meant everything was reprocessed.</p><p>Long term: patched the deserializer, added consumer lag alerting to CloudWatch, implemented consumer auto-scaling based on lag thresholds, created a JVM monitoring dashboard.</p><p>He pushed deeper:</p><blockquote><em>&quot;How do you make sure this class of problem never happens again? Think deeper.&quot;</em></blockquote><p>I shifted from tactical to systemic:</p><p>The real root cause wasn&#39;t the memory leak — it was insufficient observability. Every service we shipped after this had three things mandatory before going to production: consumer lag dashboard, JVM heap and GC metrics, and a business-level metric (expected events per minute — if it drops, alert fires). We also introduced canary deployments for consumer changes and started running 4-hour sustained load tests to catch slow memory leaks that short tests miss.</p><p>The philosophical shift: stop thinking &quot;build it and fix issues when they appear&quot; and start thinking &quot;assume it will fail — design so you know immediately, blast radius is contained, and recovery is documented.&quot;</p><h3>Conflict and Consensus</h3><blockquote><em>&quot;Talk about a time you built consensus on a technical decision — one where either they came around to your view or you came around to theirs.&quot;</em></blockquote><p>I used the DB-per-tenant vs shared database story from Clarivate. The existing architecture used a shared schema with client_id filtering. I believed this was wrong.</p><p>He stopped me mid-story:</p><blockquote><em>&quot;You&#39;re mentioning performance — but the real concern should be data confidentiality, right? What am I missing?&quot;</em></blockquote><p>He was completely right and I said so immediately. I had conflated two separate problems. The primary argument was always data confidentiality — law firms have confidential IP data and a shared schema means one missing WHERE clause in application code can expose Client A&#39;s data to Client B. The database itself provides no hard boundary. DB-per-tenant means even if the application layer has a bug, the isolation holds at the infrastructure level.</p><p>Performance was a secondary, separate concern that could have been solved other ways. I should have led with confidentiality from the start.</p><p>He seemed satisfied. I think moments like this — where you correct yourself cleanly instead of defending a wrong point — actually build more trust than getting it right the first time.</p><h3>Career Direction</h3><blockquote><em>&quot;Are you going more towards a strong IC role or people management eventually?&quot;</em></blockquote><p>Strong IC with technical leadership — Staff/Principal Engineer trajectory. I want to build deep expertise in financial domain engineering specifically. The most effective engineering managers I&#39;ve seen were deeply technical first — they earned respect because they could sit down and solve hard problems alongside the team. I&#39;m not there yet in terms of domain depth. I want to get there first.</p><h3>AI Tools</h3><p>He asked how I&#39;m leveraging AI tools and what the productivity impact actually is.</p><p>I use GitHub Copilot daily for boilerplate elimination and test generation — probably the two highest ROI use cases. Cursor with agent mode for refactoring across multiple files. Claude for system design thinking and documentation drafting.</p><p>Honest assessment: meaningful productivity gain on a typical sprint — maybe 20-30% — but only when you&#39;re disciplined about where you apply it. High involvement for scaffolding and repetitive patterns. Low involvement for security-sensitive code, financial business logic, and architecture decisions where AI has no context of your system constraints.</p><p>The engineers who will be most valuable in the next few years aren&#39;t the ones who resist AI or the ones who blindly trust it. It&#39;s the ones who use it to go faster on routine work and spend that freed-up time on the genuinely hard problems that require deep human judgment.</p><h3>Role Fit</h3><p>Near the end he described the role in detail — unit lead acting as second to the engineering manager, engaging with product and external stakeholders like brokers and counterparties, post-trade processing systems, P&amp;L computation, reconciliation, tax filing. Polyglot stack — Java, Kotlin, Go, Python. Six to seven person team, startup mentality, hackathons, tech blogging culture.</p><p>Everything he described connected to something I had either done or actively wanted. Small teams with high ownership. Functional domain depth alongside technical depth. A culture that values contribution beyond just shipping tickets.</p><p>My questions to him:</p><ol><li>What are the hardest engineering problems the team is working on right now?</li><li>What does ownership look like in the first six months?</li><li>How collaborative is the design culture — individual contributors going deep, or frequent cross-team design discussions?</li><li>Stakeholder interaction with product and counterparties — is that from day one or does it build as you understand the domain?</li></ol><p>His answers confirmed everything I had hoped about the role.</p><h3>What I Think Arcesium Is Actually Testing</h3><p>Looking back across all four rounds, here&#39;s what I believe each round is really evaluating:</p><pre>Round 1 — DSA + Project<br>  Not just can you solve the problem —<br>  can you think about scale and parallelism?<br>  Do you understand your own systems deeply<br>  enough to defend every decision?<br><br>Round 2 — System Design<br>  Can you identify the core challenge<br>  before jumping to solutions?<br>  Do you understand sync vs async trade-offs?<br>  Can you justify technology choices<br>  with real reasoning?<br><br>Round 3 — Database Design<br>  Do you think beyond just writing tables?<br>  Do you understand why certain DB choices<br>  are made for certain data patterns?<br>  Can you handle real-world scale concerns —<br>  partitioning, archival, concurrency?<br><br>Round 4 — HM Round<br>  Are you self-aware?<br>  Can you handle pushback gracefully?<br>  Do you understand the business context<br>  of the systems you build?<br>  Are you someone we actually want to work<br>  with for the next few years?</pre><h3>Preparation Tips That Actually Helped</h3><p><strong>For DSA:</strong> Don&#39;t just solve the problem — think about what happens at 100x scale. Arcesium cares deeply about the follow-up.</p><p><strong>For System Design:</strong> Start every answer by identifying the core challenge. For me it was &quot;this is write-heavy, the challenge is decoupling ingestion from computation.&quot; That framing sets the entire discussion.</p><p><strong>For DB Design:</strong> Know why you&#39;re choosing each database, not just what it does. Product vs SKU separation, DECIMAL vs FLOAT for financial data, corporate actions for historical pricing, Cassandra vs PostgreSQL for messaging at scale — these are the details that show real domain understanding. And always read the NFRs carefully: &quot;no loss of information&quot; is not a schema concern, it&#39;s a replication and event-log concern.</p><p><strong>For HM Round:</strong> Have specific stories. Not &quot;I worked on a complex project&quot; but &quot;here is the specific decision, here is the specific pushback I got, here is how I handled it, here is the outcome.&quot; Specificity is credibility. And when an interviewer corrects you — acknowledge it cleanly and immediately. It builds more trust than being right the first time.</p><h3>Final Thoughts</h3><p>Arcesium was the most intellectually honest interview process I went through in my entire job search. The questions were challenging but fair. Every interviewer was genuinely engaged. Nobody was trying to trick me — they were trying to understand how I think.</p><p>If you&#39;re preparing for a similar role, invest time in understanding the financial domain they operate in — post-trade processing, reconciliation, fund accounting, P&amp;L. You don&#39;t need to be an expert going in but showing genuine curiosity about the business problems makes a real difference.</p><p>Good luck to everyone preparing. Feel free to drop questions in the comments — happy to help.</p><p><em>Shubham is a Senior Backend Engineer and Tech Lead with 6+ years of experience in Java, Spring Boot, Kafka, and distributed systems. He writes about backend engineering and system design on Medium.</em></p><p><strong>Tags:</strong> #Java #SystemDesign #DatabaseDesign #Arcesium #InterviewExperience #BackendEngineering #Kafka #DistributedSystems #FinTech #TechLead #Cassandra #WhatsApp #MessagingSystem</p><p>This post is my attempt to document every round in as much detail as I can remember — the questions, what I said, what worked, what almost didn’t. I hope it saves someone else the anxiety I went through.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7994737b8fca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon’s SDE II Interview (AFFS, Pune) in 2026 — A Full Breakdown]]></title>
            <link>https://shubhamrajkumawat.medium.com/amazons-sde-ii-interview-affs-pune-in-2026-a-full-breakdown-19b9593b32ec?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/19b9593b32ec</guid>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 12:03:59 GMT</pubDate>
            <atom:updated>2026-03-11T12:03:59.002Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From online assessments to bar raiser — everything you need to know</em></p><p>I recently went through Amazon’s SDE II interview process for the AFFS (Amazon Fulfillment Financial Systems) team in Pune, and I wanted to document every round in detail — the coding problems, system design questions, leadership principle questions, and the mental game behind all of it. If you’re preparing for a similar role, this is the guide I wish I had.</p><h3>The Process at a Glance</h3><p>Amazon’s SDE II loop consisted of <strong>5 rounds</strong>:</p><ol><li>Online Assessment (OA)</li><li>DSA Round</li><li>Low-Level Design (LLD)</li><li>High-Level Design (HLD)</li><li>Bar Raiser</li></ol><p>Let’s go through each one.</p><h3>Round 1: Online Assessment</h3><p>The OA had two coding problems and was timed. Here’s what I faced:</p><h3>Problem 1 — Count Ways to Reach Final Grid Configuration</h3><p>You are given an initial grid of dimensions p1 × q1 and a final grid of dimensions p2 × q2. The grid can grow via two operations:</p><ul><li><strong>Vertical Expansion</strong> — add a new row</li><li><strong>Horizontal Expansion</strong> — add a new column</li></ul><p>After each expansion, exactly <strong>one newly created slot must be selected</strong>. Two sequences are considered different if the order of expansions or the chosen slots differ.</p><p><strong>Goal:</strong> Return the total number of distinct ways to go from the initial grid to the final grid.</p><p><strong>Example:</strong></p><pre>p1=2, q1=2, p2=3, q2=2 → Output: 2</pre><p><em>Explanation:</em> One vertical expansion adds 2 new slots. We pick one → C(2,1) = 2.</p><p><strong>Key Insight:</strong> Let R = p2 - p1 (vertical expansions) and C = q2 - q1 (horizontal expansions). Count valid interleaving sequences and multiply by the slot-selection choices per expansion step.</p><h3>Problem 2 — Determine Final Location After Redirection</h3><p>You are given a list of redirection rules [fromLocation → toLocation] and a list of starting locations. Follow the chain of redirects from each starting point until you hit a location that doesn&#39;t redirect anywhere.</p><p><strong>Example:</strong></p><pre>locations = [[1,2],[2,3],[3,5]]<br>redirectRecords = [1]<br>→ 1 → 2 → 3 → 5<br>Output: [5]</pre><p><strong>Optimal Approach:</strong> Use a HashMap + <strong>path compression / memoization</strong> to avoid re-traversing chains. Time complexity approaches O(n).</p><h3>Round 2: DSA Round</h3><p>This round focused on algorithmic depth. The interviewer wanted to understand not just correctness, but <em>why</em> I chose a particular approach.</p><h3>Problem 1 — Discount Rebate (Count Smaller Elements to the Right)</h3><p>Given an array of product prices, for each product i, count how many products j exist such that j &gt; i and prices[j] &lt; prices[i].</p><p><strong>Example:</strong></p><pre>prices = [5, 2, 6, 1]<br>Output: [2, 1, 1, 0]</pre><p>I solved this using <strong>Modified Merge Sort</strong>, which naturally counts inversions during the merge step.</p><h3>Follow-up: Why Merge Sort over Selection Sort?</h3><p>The interviewer probed specifically on this. My reasoning:</p><ul><li><strong>Selection Sort</strong> is O(n²) — fine for small inputs, doesn’t scale</li><li><strong>Merge Sort</strong> gives O(n log n) and lets us count smaller elements on the right <em>during</em> the merge phase, making it both correct and efficient</li><li>For large n (10⁵+), the difference between O(n²) and O(n log n) is enormous in practice</li></ul><h3>Leadership Questions in This Round</h3><p><strong>LP 1 — Dive Deep:</strong></p><blockquote><em>“Describe a situation where you dug really deep to find the root cause, even though a surface-level fix was available.”</em></blockquote><p><strong>LP 2 — Deliver Results:</strong></p><blockquote><em>“Tell me about a crucial project where you were lagging by two weeks. What did you do to get back on track?”</em></blockquote><p><strong>Tip:</strong> Use the STAR format (Situation, Task, Action, Result). Be specific with data — timelines, impact metrics, what you changed.</p><h3>Round 3: Low-Level Design (LLD)</h3><h3>Optional Project Discussion</h3><p>The interviewer gave me the option to walk through a current or recent project. This is actually a great opportunity — it warmed up the conversation and let me demonstrate real-world design thinking. We discussed system throughput, request sizes, infrastructure choices, and scale challenges.</p><p>One interesting exchange: the interviewer estimated that with 3 nodes and ~100 character IDs, a fan-out of 10,000 sub-requests could push request size to ~10MB. He asked: <em>“Was this a typical case? Did you think about this?”</em> — so be ready to defend your architecture quantitatively.</p><h3>LLD Problem — Amazon Internal Stack Overflow</h3><p>Design a low-level system for an internal Q&amp;A platform (like Stack Overflow) with the following requirements:</p><ul><li>Members can post questions, add answers, and comment on both</li><li>Members can upvote questions, answers, and comments</li><li>Members can add tags to questions</li><li><strong>Moderators</strong> can close questions or undelete deleted questions</li><li>Guests and members can search by tags, description, or topic</li><li>Each member has a <strong>reputation score</strong> that increases on upvotes</li></ul><p><strong>My Approach:</strong></p><p>I identified the core entities: User, Question, Answer, Comment, Tag, Vote, Moderator. Key design decisions included:</p><ul><li>Inheritance: Moderator extends Member</li><li>Votable interface implemented by Question, Answer, Comment</li><li>Reputation updated via an Observer/Event pattern on upvotes</li><li>Search backed by an inverted index on tags + full-text on description</li><li>Role-based access control for moderation actions</li></ul><blockquote>Note: My Bluescape whiteboard link wasn’t working during the interview, so I used Draw.io — always have a backup tool ready!</blockquote><h3>Round 4: High-Level Design (HLD)</h3><h3>Leadership Questions</h3><p><strong>LP 1 — Earn Trust:</strong></p><blockquote><em>“Tell me about a time you received tough critical feedback. What was it, how did you receive it, and what did you do?”</em></blockquote><p><strong>LP 2 — Long-Term Thinking:</strong></p><blockquote><em>“Tell me about a time you sacrificed short-term gain for long-term value — for your team, customer, or yourself.”</em></blockquote><h3>HLD Problem — Global Software Image Distribution System</h3><blockquote><em>“Design a system that distributes software images (like Android OS updates) to millions of devices globally, safely and efficiently. The release server is in California. 20% of users are in India. How do you handle global scale?”</em></blockquote><p>This is a meaty problem. Key areas I covered:</p><p><strong>Requirements:</strong></p><ul><li>Distribute large binary files (OS images can be GBs) to millions of devices</li><li>Ensure safety (integrity, rollback support, staged rollouts)</li><li>Minimize latency globally</li></ul><p><strong>High-Level Components:</strong></p><ul><li><strong>CDN Layer:</strong> Geo-distributed edge nodes (think Cloudfront/Akamai) cache images close to users. India gets a regional PoP.</li><li><strong>Release Service:</strong> Central orchestrator in the US manages version metadata, rollout policies, and canary releases</li><li><strong>Device Registry:</strong> Tracks device state, OS version, eligibility for update</li><li><strong>Staged Rollout Engine:</strong> Push to 1% → 10% → 50% → 100% with health checks between stages</li><li><strong>Delta Updates:</strong> Only push diffs (not full images) to reduce bandwidth — critical at scale</li><li><strong>Integrity Verification:</strong> Checksum (SHA-256) + signature verification on device before applying</li><li><strong>Rollback Mechanism:</strong> Keep previous version on device; auto-rollback on boot failure</li></ul><p><strong>Bottlenecks to address:</strong> CDN cache invalidation, thundering herd on release day, low-bandwidth device connections in rural India.</p><h3>Round 5: Bar Raiser</h3><p>The Bar Raiser round is the most Amazon-specific. The interviewer is someone outside your team whose job is to maintain the hiring bar — they’re not on your side, and that’s by design.</p><h3>Behavioral Questions</h3><p><strong>Q1 — Customer Obsession:</strong></p><blockquote><em>“In your career, how have you identified a customer need and solved it with an innovative solution?”</em></blockquote><p><strong>Q2 — Disagree and Commit:</strong></p><blockquote><em>“Tell me a time when you took the side of a customer, even if it meant disagreeing with your own leadership — and strongly advocated for it.”</em></blockquote><p>Authenticity matters enormously here. Bar Raisers are trained to spot rehearsed answers. Tell real stories with real tension — disagreements that were uncomfortable, decisions that carried risk.</p><h3>Coding Q1 — Merge Route Segments (Minimum Cost)</h3><p>You are given N route segments, each with a number of delivery stops. Merging two segments costs the sum of their stops, and the merged segment becomes a new segment.</p><p><strong>Goal:</strong> Merge all segments into one with <strong>minimum total cost</strong>.</p><p>This is the classic <strong>Huffman Coding / greedy merge</strong> problem. The optimal strategy:</p><ol><li>Push all segment sizes into a <strong>min-heap</strong></li><li>Repeatedly extract the two smallest, merge them (cost = sum), push the result back</li><li>Accumulate total cost</li></ol><p><strong>Time Complexity:</strong> O(n log n) for n insertions/extractions from the heap.</p><p>The interviewer asked: <em>“What is the cost of the insert operation into the min-heap?”</em> — be crisp: O(log n) per insert due to the heap’s tree height, and O(1) amortized in some implementations.</p><h3>Coding Q2 — Zoo Infection Spread (Multi-source BFS)</h3><p>You are given a grid representing animal cages:</p><ul><li>I → infected animal</li><li>H → healthy animal</li><li>E → empty cage</li></ul><p>Infection spreads to neighboring cages in <strong>1 day</strong>. Find the <strong>minimum number of days</strong> to infect all animals.</p><p><strong>Key constraint:</strong> Consider all <strong>8 directions</strong> (not just 4).</p><p>This is a <strong>multi-source BFS</strong> problem:</p><ol><li>Add all I cells to the queue simultaneously as sources</li><li>BFS outward, skipping E cells</li><li>Track days until all H cells are infected</li><li>If any H cells remain unreachable (surrounded by E), return -1</li></ol><p>We ran out of time before completing the full walkthrough — the interviewer paused the trace and wrapped up. Don’t panic if this happens; finish your explanation concisely and stay composed.</p><h3>Key Takeaways &amp; Prep Tips</h3><h3>On Coding</h3><ul><li>Practice multi-source BFS, Merge Sort inversions, heap-based greedy merging, and path compression</li><li>Always state time and space complexity before diving in — interviewers appreciate structured thinking</li><li>Walk through examples aloud; don’t code silently</li></ul><h3>On System Design</h3><ul><li>Know your CDN, message queues, databases, and distributed systems primitives cold</li><li>Always ask clarifying questions: scale? consistency requirements? latency SLAs?</li><li>Have a backup for anything tech-dependent (whiteboard, Excalidraw, Draw.io)</li></ul><h3>On Leadership Principles</h3><ul><li>Amazon’s LPs aren’t buzzwords — they’re genuinely evaluated</li><li>Prepare 2–3 strong STAR stories that can flex across multiple LPs</li><li>Be honest about disagreements and failures; sanitized stories don’t land</li></ul><h3>On the Bar Raiser</h3><ul><li>Don’t try to “win” the Bar Raiser — just be authentic</li><li>They’re looking for culture add, not just competency</li><li>Customer Obsession and Disagree &amp; Commit come up most often — have crisp stories ready</li></ul><h3>Final Thoughts</h3><p>Amazon’s process is intense but fair. The breadth of what they evaluate — DSA, LLD, HLD, and behavioral depth — means you need to prepare holistically. Start with the Leadership Principles early; don’t treat them as an afterthought.</p><p>Good luck. You’ve got this. 🚀</p><p><em>If this helped you, feel free to clap or share. Happy to answer questions in the comments about any specific round.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19b9593b32ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Anthropic’s Claude Cowork Research Preview Has Shaken Markets — And Why Stocks Are Down]]></title>
            <link>https://shubhamrajkumawat.medium.com/how-anthropics-claude-cowork-research-preview-has-shaken-markets-and-why-stocks-are-down-79b874499a7a?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/79b874499a7a</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[claude-cowork]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 06:46:27 GMT</pubDate>
            <atom:updated>2026-02-05T06:46:27.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Anthropic’s Claude Cowork Research Preview Has Shaken Markets — And Why Stocks Are Down</h3><p><em>How AI automation tools are shifting markets, disrupting traditional service models, and reshaping jobs in India</em></p><p>On <strong>January 30, 2026</strong>, US AI company Anthropic rolled out <strong>Claude Cowork</strong> — a suite of generative AI tools designed to act as a <em>digital coworker</em>, not just a chatbot. Instead of simply responding to prompts, Claude Cowork can now <strong>manage files, perform multi-step tasks, and automate workflows</strong> across functions like legal review, data analysis, sales workflows, compliance, and more.</p><p>In the days that followed, global technology markets convulsed — and Indian tech stocks were no exception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgZGXymYAAqw_EPqlpnOiQ.png" /></figure><h3>📉 Indian IT Stocks Felt the Impact Hard</h3><p>Within 48 hours of the Claude Cowork launch:</p><ul><li><strong>NIFTY IT index plunged nearly 6–7%</strong>, the steepest one-day fall since the COVID downturn, wiping out nearly <strong>₹2 lakh crore in market value</strong>.</li><li>Major Indian IT names such as <strong>Infosys, Tata Consultancy Services (TCS), Wipro, HCL Technologies, Tech Mahindra</strong>, and others saw share prices sharply decline.</li><li><strong>ADRs of Infosys and Wipro on Wall Street also moved lower</strong>, reflecting pressure in global markets.</li></ul><p>Even companies focused on legal tech and professional services overseas were rocked — with some European legal and data analytics stocks dropping double-digit percentages shortly after the announcement.</p><h3>🤖 So What Is Claude Cowork, Exactly?</h3><p>Unlike traditional AI assistants that answer questions, Claude Cowork is designed to function as an <strong>AI agent with task autonomy</strong>:</p><ul><li>It can access and manipulate files — reading, editing, organizing, and producing outputs directly for users.</li><li>Anthropic also released <strong>11 plug-ins</strong> that allow Claude to automate tasks previously handled by specialized enterprise platforms such as contract review software, customer relationship systems, and data analysis workflows.</li><li>Because of this, it <em>feels more like a coworker with agency</em> rather than a passive tool that waits for instructions.</li></ul><p>What investors found unsettling was the idea that these AI agents might do <strong>entire jobs or services that tech companies traditionally sell</strong>, rather than just assist humans in doing them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVcdk-oiLKJtKJZ8i0r3Dg.png" /></figure><h3>💡 Why the Market Reacted So Strongly</h3><p>Several narratives drove investor reactions:</p><h3>🚨 1. Disrupting the Service-Driven IT Model</h3><p>India’s IT sector has long been driven by <strong>billable hours — human consultants writing code, testing systems, analyzing data, handling compliance, and reviewing documents manually</strong>. AI agents that can perform these tasks autonomously pose a threat to that very business model.</p><h3>📊 2. Fear of Eroding Future Revenues</h3><p>Investors fear that if AI can package multiple software categories into a single agentic tool, the need for multiple enterprise software subscriptions or outsourced IT services could decline, putting future revenues at risk.</p><h3>🧑‍💻 3. Job Automation Concerns</h3><p>Claude’s automation capabilities revived concerns about white-collar job displacement. Tasks like routine coding, software testing, data processing, compliance tracking, legal document review, and customer support are increasingly vulnerable to AI automation, potentially reducing demand for entry-level work.</p><h3>🧠 What Does This Mean for Jobs in India?</h3><p>India’s IT workforce — one of the largest in the world — includes roles that are most likely to be affected:</p><h3>🔹 Entry-Level Developers &amp; Testers</h3><p>AI tools can automate boilerplate coding, bug fixing, unit tests, and routine documentation. These roles have traditionally relied on junior developers for manual execution.</p><h3>🔹 Data Analysts &amp; Compliance Specialists</h3><p>Tasks involving data cleaning, extraction, report generation, risk flagging, and compliance checks are increasingly within reach of AI automation tools.</p><h3>🔹 Legal &amp; Contract Workflow Professionals</h3><p>With dedicated plugins for contract review and NDA checking, tasks traditionally done by junior legal professionals or paralegals could see reduced human involvement.</p><h3>🔹 Routine Support &amp; Admin Functions</h3><p>Customer service scripts, support ticket triage, and back-office admin jobs can be handled by agentic AI at scale, reducing the need for large teams dedicated to these workflows.</p><p>However, roles involving <strong>strategic thinking, complex decision-making, creative problem solving, leadership, and empathetic communication</strong> are much harder to automate. These are the areas where humans will continue to lead.</p><h3>📚 A Future of Collaboration — Not Just Replacement</h3><p>While the sell-off in Indian IT stocks captured headlines, many analysts caution that this could be <strong>short-term sentiment, not structural collapse</strong>.<br> Investors may simply be <em>reassessing valuations and future growth forecasts</em>, rather than declaring a full-blown industry downturn.</p><p>Even so, market reactions show one clear trend: <strong>AI is no longer an auxiliary technology — it’s viewed as a direct competitor to traditional revenue streams.</strong></p><p>For India, the challenge isn’t just job loss. It’s <strong>adapting business models</strong> — from labor-intensive service delivery to productized, AI-augmented services that amplify output while lowering costs.</p><h3>🧭 What Should India Do Next?</h3><p>To thrive in this new era:</p><h3>✅ Invest in Higher-Order Skills</h3><p>Focus on human-AI collaboration skills — strategy, creativity, complex problem solving, and system architecture.</p><h3>✅ Build Domestic AI Competency</h3><p>Develop frameworks, APIs, and localized AI applications that integrate global innovations into Indian business contexts.</p><h3>✅ Adapt Education and Training</h3><p>Recalibrate curriculums to emphasize AI fluency and interdisciplinary capabilities.</p><h3>✅ Leverage AI to Create New Opportunities</h3><p>Companies that <em>use</em> tools like Claude Cowork to augment operations may become more competitive, not less — if they can pivot fast.</p><h3>📌 Final Thought</h3><p>The launch of <em>Claude Cowork</em> didn’t simply introduce a new AI product — it signaled a <strong>paradigm shift</strong>.</p><p>AI is no longer just about efficiency gains — it’s about <strong>reshaping what work means, how value gets created, and who gets paid for it</strong>.</p><p>For India’s vast talent pool and $200+ billion IT industry, <strong>the next decade will be defined not by whether AI exists, but by how Indians choose to work <em>with</em> it</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79b874499a7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Paytm Senior Software Engineer Interview Experience (2024–2025): Complete Question Bank +…]]></title>
            <link>https://shubhamrajkumawat.medium.com/paytm-senior-software-engineer-interview-experience-2024-2025-complete-question-bank-72c7f155638a?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/72c7f155638a</guid>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[interview-experience]]></category>
            <category><![CDATA[paytm]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 12:15:16 GMT</pubDate>
            <atom:updated>2025-11-17T12:16:54.453Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paytm Senior Software Engineer Interview Experience ( Sep 2025)</h3><p><em>Real Questions from 4 Back-to-Back Interviews — Combined in One Guide</em></p><p>If you’re preparing for a <strong>Paytm Senior Software Engineer (SSE)</strong> role, this article will be your biggest advantage.<br> Over the past few months, I appeared in <strong>four different Paytm interviews</strong>, across teams handling <strong>payments, transactions, real-time systems, and microservices</strong>.</p><p>I documented <em>every</em> question asked — including <strong>DSA, Core Java, Spring Boot, Kafka, concurrency, debugging, system design, and LLD</strong>.</p><p>This article combines all four into <strong>one structured, SEO-friendly guide</strong>, with <strong>diagrams</strong> to help you understand the system design rounds clearly.</p><h3>⭐ Table of Contents</h3><ol><li>Round 1 — Java, Microservices &amp; Kafka</li><li>Round 2 — Realtime Transaction Flow + Fraud Detection</li><li>Round 3 — System Design (Seat Booking)</li><li>Round 4 — Debugging + Architecture Deep Dive</li><li>Full Question Bank (All Rounds)</li><li>System Design Diagrams (ASCII)</li><li>My Experience + Tips for Cracking Paytm</li></ol><h3>1. Round 1 — Java, Microservices &amp; Kafka</h3><h3>🔥 Core Java Questions (Asked Exactly)</h3><ul><li>How JVM manages <strong>heap, stack, metaspace</strong>.</li><li>How do you debug <strong>memory leaks</strong> in production systems?</li><li>Difference between HashMap, ConcurrentHashMap, Hashtable.</li><li>How does <strong>BigInteger</strong> work internally?</li><li>How to use BigInteger in large dynamic programming problems?</li><li>Explain the volatile keyword.</li><li>Explain immutability and places where it’s useful.</li></ul><h3>🔥 Microservices Questions</h3><ul><li>Your API shows <strong>sudden high latency</strong> — how do you debug end-to-end?</li><li>What KPIs do you check?</li><li>How do you detect <strong>thread pool starvation</strong>?</li><li>How do you ensure an EC2 instance (8 cores, 24GB RAM) is fully utilized?</li><li>Other caching tools apart from Redis?</li></ul><h3>🔥 Kafka Questions</h3><ul><li>Kafka architecture: leaders, followers, partitions, offsets.</li><li>Real-time transaction streaming — how would you design it?</li><li>How do consumer groups rebalance?</li><li>Explain offset commit flow.</li><li>How does Kafka ensure <strong>at least once</strong> vs <strong>exactly once</strong>?</li></ul><h3>2. Round 2 — Realtime Transaction Flow + Fraud Detection</h3><h3>🔥 Real-Time Transaction Flow (Exact Questions)</h3><ul><li>Explain how a <strong>real-time payment</strong> flows end-to-end.</li><li>How does the Transaction Service respond to the user?</li><li>How do you notify the user + merchant app?</li><li>How does the transaction system inform <strong>Pevify App</strong>?</li></ul><h3>🔥 Fraud Detection</h3><ul><li>How do you detect fraudulent transactions in real-time?</li><li>What patterns do you check?</li><li>What ML/non-ML features would you track?</li><li>How do you flag a suspicious payment instantly?</li></ul><h3>🔥 Concurrency: Seat Locking</h3><ul><li>How do you ensure <strong>two users never get the same seat</strong>?</li><li>Which locking mechanism would you use?</li><li>Pessimistic lock</li><li>Optimistic lock</li><li>Redlock</li><li>Will you use Redis or DB-level locking?</li></ul><h3>🔥 Scaling &amp; Caching Questions</h3><ul><li>For 1000+ users, do you need caching? Where?</li><li>Redis vs Memcached — which one and why?</li><li>How many read replicas should you configure?</li></ul><h3>🔥 Single-Trim Design Pattern</h3><ul><li>Where can the single-trim pattern be applied?</li><li>Why would a payment pipeline need it?</li></ul><h3>3. Round 3 — System Design: Booking Management System</h3><p>You were shown a UI sketch and asked to design the <strong>complete backend</strong>.</p><h3>Functional Requirements</h3><ul><li>Search bus/train seats</li><li>Check availability</li><li>Block seat</li><li>Confirm booking</li><li>Handle concurrency</li><li>Avoid double bookings</li><li>Support retries, failures, idempotency keys</li><li>Show booking history</li></ul><h3>Key Questions from the Interview</h3><ul><li>How do you prevent double-booking under concurrency?</li><li>Would you store seat-lock in <strong>DB or cache</strong>?</li><li>What if cache goes down?</li><li>What retry strategy do you use?</li><li>How do you avoid race conditions?</li></ul><h3>4. Round 4 — Deep Technical Debugging + Architecture</h3><h3>🔥 Memory Troubleshooting</h3><ul><li>How do you identify GC pressure?</li><li>Tools you use: JProfiler / VisualVM / New Relic / Dynatrace</li><li>What causes memory leak in microservices?</li></ul><h3>🔥 API Latency Debugging</h3><ul><li>If your API is slow, what dashboards do you check first?</li><li>How do you detect a slow downstream dependency?</li><li>How to identify blocked threads?</li></ul><h3>🔥 MCP Server Discussion</h3><ul><li>What is an MCP server?</li><li>Why do large-scale systems need it?</li><li>How does it handle backpressure &amp; retries?</li></ul><h3>🔥 Knowledge Growth</h3><ul><li>“How are you increasing your knowledge base daily?”<br> (This is a Paytm favorite.)</li></ul><h3>5. Combined Paytm SSE Question Bank (All Four Interviews)</h3><h3>💡 Java</h3><ul><li>HashMap internals</li><li>Memory leaks</li><li>Multi-threading</li><li>BigInteger usage</li><li>JVM tuning</li><li>Deadlock resolution</li></ul><h3>💡 Spring Boot</h3><ul><li>Circuit breaker</li><li>Thread pool tuning</li><li>Idempotency keys</li><li>Retry logic</li><li>API gateway behavior</li></ul><h3>💡 Kafka</h3><ul><li>Offset commit</li><li>Partitions</li><li>Rebalancing</li><li>Exactly-once flow</li></ul><h3>💡 System Design</h3><ul><li>Booking management system</li><li>Transaction workflow</li><li>Notification service</li><li>Fraud detection pipeline</li><li>Event-driven architecture</li></ul><h3>💡 DSA</h3><ul><li>Unique paths with obstacles</li><li>DFS/BFS exploration</li><li>Using BigInteger in DP</li><li>Grid-based traversal</li></ul><h3>6. System Design Diagrams (ASCII for Medium)</h3><h3>A. Transaction Flow in Paytm</h3><pre>User App<br>   |<br>   v<br>API Gateway<br>   |<br>   v<br>Transaction Service ---&gt; Fraud Service<br>   |                         |<br>   v                         v<br>Kafka Topic &lt;--------- Real-time Checks<br>   |<br>   v<br>Payment Processor<br>   |<br>   v<br>Callback Handler<br>   |<br>   v<br>Notification Service</pre><h3>B. Seat Booking System Flow</h3><pre>User ---&gt; Search Seats<br>          |<br>          v<br>     Availability Service<br>          |<br>          v<br>+---------------------------+<br>| Redis seat-lock cache     |<br>+---------------------------+<br>          |<br>  (Lock seat for 2 minutes)<br>          |<br>          v<br>  Confirm Booking Service<br>          |<br>          v<br>     Database (SQL)</pre><h3>C. Concurrency Control (Optimistic Locking)</h3><pre>BEGIN<br>Read seat row version = 12<br>User tries to book<br>UPDATE seat SET version = 13 WHERE version = 12<br>IF update fails -&gt; retry<br>END</pre><h3>7. My Final Thoughts + Tips to Crack Paytm</h3><h3>✔️ Learn how real-time payments work</h3><p>Paytm interviewers heavily focus on <strong>flows, consistency, race conditions</strong>.</p><h3>✔️ Master Kafka</h3><p>They expect deep practical knowledge, not textbook definitions.</p><h3>✔️ Practice debugging scenarios</h3><p>You must explain step-by-step how you would debug high latency or memory issues.</p><h3>✔️ System design must include**:</h3><ul><li>Idempotency</li><li>Retries</li><li>Caching</li><li>Locking</li><li>Database isolation</li><li>Event-driven flow</li><li>Race condition prevention</li></ul><h3>✔️ Prepare grid/DP DSA questions</h3><p>Almost every interview had one twist-based DP or grid problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72c7f155638a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✈️ My United Airlines F2F Interview Experience (Gurgaon) — Full Question List with Topics You Must…]]></title>
            <link>https://shubhamrajkumawat.medium.com/%EF%B8%8F-my-united-airlines-f2f-interview-experience-gurgaon-full-question-list-with-topics-you-must-b1cd14058290?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1cd14058290</guid>
            <category><![CDATA[united-airlines]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[career-growth]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[interview-experience]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 08:01:51 GMT</pubDate>
            <atom:updated>2025-11-11T08:01:51.490Z</atom:updated>
            <content:encoded><![CDATA[<h3>✈️ My United Airlines F2F Interview Experience (Gurgaon) — Full Question List with Topics You Must Prepare</h3><p><em>By Shubham Raj</em></p><h3>🧠 Introduction</h3><p>Last week, I had my <strong>face-to-face interview with United Airlines (Gurgaon)</strong> for a <strong>Software Engineer (Java / Spring Boot)</strong> role.<br> The discussion was deep, practical, and touched all major areas — from <strong>Java 8 streams</strong> and <strong>SQL window functions</strong> to <strong>Spring Boot architecture</strong>, <strong>exception handling</strong>, and <strong>real-world troubleshooting</strong>.</p><p>I decided to share every question I was asked (and a few that came up in later rounds) — so that others preparing for similar roles can benefit.</p><h3>☕ Core Java &amp; Coding Questions</h3><ol><li><strong>Find the First Duplicate Character</strong><br> 👉 <em>“Write a Java program to find the first duplicate character in a string.”</em><br> Example: &quot;United States America&quot; → Output: &#39;i&#39;.</li><li><strong>Filter Employees by Salary (Java 8)</strong><br> 👉 <em>“Using Java 8, find all employees whose salary is greater than 10,000.”</em></li><li><strong>Find Maximum Salary (Java 8 Streams)</strong><br> 👉 <em>“Find the employee with the highest salary using Java 8 streams.”</em></li><li><strong>Explain How Streams Work Internally</strong><br> 👉 <em>“Can you explain how your stream-based solution works internally, step by step?”</em></li><li><strong>Concurrency Basics</strong></li></ol><ul><li>Difference between synchronized and Lock</li><li>Why use ExecutorService instead of manual threads</li><li>Thread-safe collections in Java (ConcurrentHashMap, CopyOnWriteArrayList, etc.)</li></ul><h3>⚙️ Spring Boot &amp; Architecture</h3><ol><li><strong>Project Architecture Overview</strong><br> 👉 <em>“Can you explain the architecture of your current project?”</em></li><li><strong>Monolithic vs Microservices</strong><br> 👉 <em>“What are the advantages of monolithic architecture compared to microservices?”</em></li><li><strong>@Bean vs @Component</strong><br> 👉 <em>“When do you use </em><em>@Bean and when </em><em>@Component in Spring Boot?”</em></li><li><strong>Pre-Processing Before Save</strong><br> 👉 <em>“How can you execute some logic before saving data via a REST service (e.g. insert audit details)?”</em></li><li><strong>Database Connection Setup</strong><br> 👉 <em>“How do you establish the database connection in your Spring Boot application?”</em></li></ol><h3>🗃️ Database Migration &amp; SQL</h3><ol><li><strong>Database Migration (Oracle → MySQL)</strong><br> 👉 <em>“If you migrate from Oracle to MySQL, how do you handle it at the application level with minimal code changes?”</em></li><li><strong>Avoid Native Queries</strong><br> 👉 <em>“How can you avoid database-specific native queries when migrating between Oracle and MySQL?”</em></li><li><strong>SQL — 8th Largest Salary</strong><br> 👉 <em>“Write a query to find the 8th largest salary.”</em></li><li><strong>SQL — Remove Duplicates</strong><br> 👉 <em>“Write a SQL query to delete duplicate rows while keeping one record.”</em></li><li><strong>SQL — Join Row Count</strong><br> 👉 <em>“How do you determine how many rows a JOIN between two tables will return?”</em></li></ol><h3>🚨 Exception Handling</h3><ol><li><strong>Global Exception Handling</strong><br> 👉 <em>“How do you handle exceptions globally in Spring Boot?”</em></li><li><strong>Custom Exceptions</strong><br> 👉 <em>“How do you create and manage custom exceptions in your application?”</em></li><li><strong>RuntimeException vs Exception</strong><br> 👉 <em>“Why do you extend </em><em>RuntimeException and not </em><em>Exception when creating custom exceptions?”</em></li></ol><h3>☁️ Monitoring, Deployment &amp; Production Scenarios</h3><ol><li><strong>Monitoring</strong><br> 👉 <em>“How do you monitor your application? What happens if your app goes down?”</em></li><li><strong>Deployment</strong><br> 👉 <em>“How do you deploy a Spring Boot application — and what does your CI/CD pipeline look like?”</em></li><li><strong>High CPU Usage Scenario</strong><br> 👉 <em>“If your app suddenly shows 90% CPU usage, how do you troubleshoot it?”</em></li><li><strong>Service Down Scenario</strong><br> 👉 <em>“If one service goes down in production, how do you handle it gracefully?”</em></li></ol><h3>🧑‍💼 Behavioral &amp; Project Discussion</h3><ol><li><em>“Can you explain one of your recent projects and your role in it?”</em></li><li><em>“Tell me about a challenging issue you faced and how you solved it.”</em></li><li><em>“How do you handle conflicts or design disagreements within your team?”</em></li><li><em>“If you’re under tight deadlines, how do you maintain code quality?”</em></li></ol><h3>✈️ Company &amp; HR Round</h3><ol><li><strong>What do you know about United Airlines?</strong><br> 👉 Mention global presence, digital innovation, sustainability, and tech hub in Gurgaon.</li><li><strong>Why United Airlines?</strong><br> 👉 Talk about global scale, tech-first culture, and opportunity to work on high-availability systems.</li><li><strong>Employee Benefits (India — Gurgaon)</strong></li></ol><ul><li>Standby &amp; discounted travel on United flights</li><li>Health and life insurance</li><li>Paid time off (vacation + sick)</li><li>Maternity benefits</li><li>Hotel &amp; travel partner discounts</li></ul><ol><li><strong>Out-of-India Travel</strong><br> 👉 <em>“Does United Airlines provide international travel opportunities for employees?”</em><br> <em>(Answer: Yes, as standby/discounted travel benefits subject to seat availability.)</em></li></ol><h3>💡 Bonus Topics They Might Ask</h3><ol><li><strong>System Design</strong> — <em>“Design a flight booking system using microservices.”</em></li><li><strong>Caching Strategy</strong> — <em>“How would you use Redis or in-memory caching to optimize read-heavy APIs?”</em></li><li><strong>Idempotency</strong> — <em>“How do you ensure API idempotency in payment or booking flows?”</em></li></ol><h3>🎯 Final Thoughts</h3><p>If you’re preparing for a <strong>United Airlines </strong>or any large enterprise Java interview — expect questions that mix <strong>core Java fundamentals</strong>, <strong>Spring Boot architecture</strong>, <strong>SQL performance</strong>, and <strong>real-world troubleshooting</strong>.</p><p>They look for <strong>clarity of thought</strong>, not just syntax.<br> Think through your answers like a developer who understands <strong>production systems</strong>, not just code.</p><h3>🏷️ Tags</h3><p>#Java #SpringBoot #SQL #Microservices #UnitedAirlines #InterviewExperience #CodingInterview #TechCareer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1cd14058290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airtel SDE-2 Interview Experience — My Journey, Questions & Learnings]]></title>
            <link>https://shubhamrajkumawat.medium.com/airtel-sde-2-interview-experience-my-journey-questions-learnings-d0364e4e28b7?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0364e4e28b7</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[interview-experience]]></category>
            <category><![CDATA[airtel-payments-bank]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 13:40:36 GMT</pubDate>
            <atom:updated>2025-11-09T13:40:36.083Z</atom:updated>
            <content:encoded><![CDATA[<h3>Airtel SDE-2 Interview Experience — My Journey, Questions &amp; Learnings</h3><h3>🏢 About the Role &amp; Interview Process</h3><p>Recently, I interviewed with <strong>Airtel</strong> for the <strong>Software Development Engineer 2 (SDE-2)</strong> position.</p><p>The process focused heavily on <strong>problem-solving, backend design, and real-world system performance</strong>. The panel emphasized <strong>hands-on experience</strong> rather than textbook definitions, especially around <strong>Java, Spring Boot, Kafka, and monitoring tools</strong>.</p><ul><li><strong>Role:</strong> SDE-2</li><li><strong>Mode:</strong> Virtual (Google Meet)</li><li><strong>Duration:</strong> ~90 minutes</li><li><strong>Panel:</strong> 1 Senior Engineer + 1 Tech Lead</li><li><strong>Focus Areas:</strong> Java, Spring Boot, Kafka, System Design, Monitoring, and SLAs</li></ul><h3>💻 Round 1: Technical Deep Dive</h3><p>The interviewer started with a quick introduction, then directly moved to technical discussions. Here’s a round-wise breakdown of what was asked and how I approached it 👇</p><h4>🧩 1. Kafka Fundamentals</h4><blockquote><strong><em>Q:</em></strong><em> Can you explain how Kafka ensures message delivery guarantees?</em></blockquote><p><strong>My Answer:</strong><br> I explained the <strong>three delivery semantics</strong>:</p><ul><li><strong>At-most-once:</strong> message may be lost but never redelivered</li><li><strong>At-least-once:</strong> message will never be lost but might be redelivered</li><li><strong>Exactly-once:</strong> achieved using <strong>idempotent producers</strong> and <strong>transactional writes</strong></li></ul><p>To show practical knowledge, I mentioned:</p><pre>acks=all  <br>min.insync.replicas=2  <br>enable.idempotence=true</pre><p>✅ <strong>Tip:</strong> Mention real Kafka configuration and production scenarios to highlight hands-on experience.</p><h4>⚙️ 2. Monitoring and Observability</h4><blockquote><strong><em>Q:</em></strong><em> How do you track production system performance and uptime?</em></blockquote><p><strong>My Approach:</strong></p><ul><li><strong>Grafana</strong> + <strong>Prometheus</strong> for metrics visualization</li><li><strong>AWS CloudWatch</strong> for infrastructure-level alerts</li><li><strong>ELK Stack</strong> for centralized log management</li></ul><p>We configured <strong>Grafana alerts</strong> for latency spikes and downtime anomalies.</p><p>✅ <strong>Takeaway:</strong> Always link tools with metrics like <em>latency</em>, <em>throughput</em>, or <em>error rate</em> — it shows awareness of SLAs.</p><h4>🧠 3. API SLAs and Performance</h4><blockquote><strong><em>Q:</em></strong><em> What is an SLA for an API, and how do you ensure it’s met?</em></blockquote><p><strong>Answer:</strong><br> SLA (Service Level Agreement) defines guarantees such as <strong>uptime</strong>, <strong>response time</strong>, and <strong>error tolerance</strong>.</p><p>To ensure SLAs:</p><ul><li>Used <strong>caching (Redis)</strong> for faster responses</li><li>Implemented <strong>circuit breakers</strong> and <strong>retry patterns</strong> using <strong>Resilience4j</strong></li><li>Added <strong>load balancing + async calls</strong> where possible</li></ul><p>✅ <strong>Tip:</strong> Pair concepts like “SLA” with <strong>real implementation details</strong>.</p><h4>🔍 4. Coding — Modified Binary Search</h4><blockquote><strong><em>Q:</em></strong><em> Find an element in a rotated sorted array.</em></blockquote><p><strong>Brute Force:</strong></p><pre>int search(int[] nums, int target) {<br>    for (int i = 0; i &lt; nums.length; i++) {<br>        if (nums[i] == target) return i;<br>    }<br>    return -1;<br>}</pre><p><strong>Optimized Solution (Modified Binary Search):</strong></p><pre>int search(int[] nums, int target) {<br>    int left = 0, right = nums.length - 1;<br>    while (left &lt;= right) {<br>        int mid = (left + right) / 2;<br>        if (nums[mid] == target) return mid;</pre><pre>        if (nums[left] &lt;= nums[mid]) { // Left sorted<br>            if (target &gt;= nums[left] &amp;&amp; target &lt; nums[mid])<br>                right = mid - 1;<br>            else<br>                left = mid + 1;<br>        } else { // Right sorted<br>            if (target &gt; nums[mid] &amp;&amp; target &lt;= nums[right])<br>                left = mid + 1;<br>            else<br>                right = mid - 1;<br>        }<br>    }<br>    return -1;<br>}</pre><p>✅ <strong>Complexity:</strong> O(log N)<br> ✅ <strong>Tip:</strong> Always start with brute force → optimize → explain why.</p><h4>🧱 5. System Design Discussion</h4><blockquote><strong><em>Q:</em></strong><em> Suppose you’re tracking the speed of a production line in real time. How would you design the system?</em></blockquote><p><strong>My Approach:</strong></p><ul><li>Devices send data → <strong>Kafka topics</strong></li><li><strong>Spring Boot microservice</strong> consumes and processes messages</li><li>Store in <strong>time-series DB (InfluxDB / DynamoDB)</strong></li><li>Visualize via <strong>Grafana dashboards</strong></li><li>Use <strong>Kubernetes + autoscaling</strong> for scaling</li><li>Implement <strong>threshold alerting service</strong></li></ul><p>✅ <strong>Takeaway:</strong> Focus on scalability, fault tolerance, and data freshness.</p><h4>💬 6. Major Challenge Discussion</h4><blockquote><strong><em>Q:</em></strong><em> Tell me about a major challenge you faced in your project.</em></blockquote><p>I shared about a <strong>payment duplication issue</strong> due to <strong>retry loops</strong> in a distributed system.<br> <strong>Solution:</strong></p><ul><li>Introduced <strong>idempotency keys</strong></li><li>Used a <strong>deduplication table</strong> with transaction IDs</li><li>Added <strong>circuit breaker</strong> + <strong>retry pattern</strong> for resilience</li></ul><p>✅ <strong>Lesson:</strong> They want to see ownership and debugging mindset, not just success.</p><h3>🎯 My Key Learnings</h3><ul><li>Airtel’s interviews are <strong>scenario-driven</strong>, not purely theoretical.</li><li>Emphasis on <strong>real-world debugging, monitoring, and SLAs</strong>.</li><li>Kafka + System Design knowledge is <strong>highly valued</strong>.</li><li>Expect a blend of <strong>coding + practical architecture</strong> questions.</li></ul><h3>🌟 Overall Experience Rating</h3><p>⭐️⭐️⭐️⭐️☆ (4/5)<br> A balanced round that tested both coding ability and backend design depth.</p><h3>🧾 Tips for Future Candidates</h3><p>✅ Revise <strong>Spring Boot internals</strong>, <strong>Kafka guarantees</strong>, and <strong>Resilience4j</strong><br> ✅ Practice <strong>array-based DSA questions</strong> and <strong>binary search variations</strong><br> ✅ Prepare one <strong>real incident story</strong> (production bug, outage, etc.)<br> ✅ Mention your monitoring stack — it reflects mature engineering habits</p><h3>🔗 What’s Next</h3><p>➡️ Up next in this series — my <strong>Publicis Sapient Technical Interview</strong>, where I faced one of the toughest <strong>system design rounds</strong> so far.</p><p>Follow me on <a href="https://www.linkedin.com/in/shubhamraj">LinkedIn</a> or Medium for the next story in my<br> <strong>“30 Real Interviews — My Journey to Senior Software Engineer”</strong> series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0364e4e28b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Amazon SDE-II Interview Experience — From DP on Trees to Infection Spread in Binary Trees]]></title>
            <link>https://shubhamrajkumawat.medium.com/my-amazon-sde-ii-interview-experience-from-dp-on-trees-to-infection-spread-in-binary-trees-9c82471f8210?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c82471f8210</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[amazon-interview]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[amazon-sde2]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Sun, 05 Oct 2025 16:43:45 GMT</pubDate>
            <atom:updated>2025-10-05T16:43:45.330Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Amazon SDE-II Interview Experience — From DP on Trees to Infection Spread in Binary Trees</h3><p>On August 25, 2025, It was one of those dream interviews where you get to solve <strong>deep algorithmic problems</strong> that truly test your understanding of <strong>dynamic programming, recursion, and graph traversal</strong>.<br> Here’s my complete experience solving two back-to-back <strong>binary tree problems</strong> in my <strong>Amazon SDE-II technical interview</strong>.</p><p>A few days ago, I asked one of my friends for a <strong>referral at Amazon</strong>, and surprisingly, within <strong>two days</strong>, I got an interview call from the recruiter.</p><p>The interviewer began by introducing themselves and then asked me to give a <strong>brief overview of my experience</strong>. After that, we moved on to a <strong>Leadership Principle</strong> question — specifically around <strong>“Ownership” and “Problem Solving.”</strong></p><p>He asked:</p><blockquote><em>“Can you tell me about a time when you faced a major challenge in your project and how you handled it?”</em></blockquote><p>I used the <strong>STAR approach (Situation, Task, Action, Result)</strong> to structure my answer. I explained how, during a production issue in our annuities module, I analyzed the problem’s root cause, quickly designed a rollback-safe patch, and coordinated with the QA and DevOps teams to deploy it in record time. The result was zero downtime and positive feedback from both the client and internal QA teams.</p><p>After that discussion, we jumped into the <strong>DSA problem-solving section</strong>.</p><h3>💻 Interview Round Overview</h3><p>The round lasted about 60 minutes.<br> The interviewer wanted to evaluate:</p><ul><li>My ability to <strong>choose the right data structure</strong>.</li><li><strong>Explain thought process</strong> clearly before coding.</li><li>Write both <strong>brute-force and optimized</strong> versions.</li><li>Provide <strong>time and space complexity</strong> analysis.</li></ul><p>The two questions asked were from <strong>LeetCode’s Medium to Hard</strong> category:</p><ol><li><strong>House Robber III</strong> — <a href="https://leetcode.com/problems/house-robber-iii/">LeetCode #337</a></li><li><strong>Amount of Time for Binary Tree to Be Infected</strong> — <a href="https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/">LeetCode #2385</a></li></ol><h3>🏠 Problem 1: House Robber III</h3><h3>🧩 Problem Summary</h3><p>You’re given a <strong>binary tree</strong> where each node represents a house containing money.<br> You cannot rob two directly connected houses (i.e., parent-child).<br> Find the <strong>maximum sum</strong> you can rob.</p><h3>💭 Thought Process</h3><p>When the interviewer asked:</p><blockquote><em>“Which data structure would you use to solve this problem efficiently?”</em></blockquote><p>I reasoned that this is a <strong>Dynamic Programming on Trees</strong> problem — a perfect case for <strong>post-order DFS traversal</strong> where we compute results from children before parents.</p><p>At each node, we track two states:</p><ul><li><strong>robbed</strong> → if we rob this node, we cannot rob its children.</li><li><strong>notRobbed</strong> → if we don’t rob this node, we can take the max from children (robbed or not).</li></ul><p>Then the interviewer challenged:</p><blockquote><em>“If we add </em><em>left.robbed + right.robbed when robbing the current node, is that correct?”</em></blockquote><p>That’s the catch.<br> When the current node is robbed, you can only add <strong>left.notRobbed + right.notRobbed</strong>, because children cannot be robbed.</p><h3>🧠 Optimized Approach (DFS + DP)</h3><pre>class Solution {<br>    public int rob(TreeNode root) {<br>        int[] res = dfs(root);<br>        return Math.max(res[0], res[1]);<br>    }</pre><pre>    private int[] dfs(TreeNode node) {<br>        if (node == null) return new int[]{0, 0};</pre><pre>        int[] left = dfs(node.left);<br>        int[] right = dfs(node.right);</pre><pre>        int robbed = node.val + left[1] + right[1];<br>        int notRobbed = Math.max(left[0], left[1]) + Math.max(right[0], right[1]);</pre><pre>        return new int[]{robbed, notRobbed};<br>    }<br>}</pre><h3>⏱️ Complexity</h3><p>Type Complexity Explanation <strong>Time</strong> O(N) Each node processed once <strong>Space</strong> O(H) Recursion stack depth (tree height)</p><p>✅ <strong>Insight:</strong> This is one of the cleanest tree DP patterns — bottom-up recursion with state compression.</p><h3>🌳 Problem 2: Amount of Time for Binary Tree to Be Infected</h3><h3>🧩 Problem Summary</h3><p>Given the root of a binary tree and a node value start, the infection starts from start at minute 0.<br> Each minute, the infection spreads to <strong>all adjacent nodes</strong> (parent ↔ child).<br> Return how many minutes it takes to infect the entire tree.</p><p><strong>LeetCode Link:</strong> <a href="https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/">LeetCode #2385</a></p><h3>⚙️ Which Data Structures to Think Of</h3><p>I started by explaining my data structure selection:</p><p>Data Structure Purpose <strong>Map&lt;TreeNode, TreeNode&gt;</strong> Store each node’s parent to enable upward traversal <strong>Queue</strong> Perform BFS to simulate infection spread <strong>Set</strong> Keep track of already infected nodes</p><p>This transforms the tree into an <strong>undirected graph</strong>, allowing a level-by-level infection simulation.</p><h3>🧭 Clarification with the Interviewer</h3><p>He asked:</p><blockquote><em>“Define what a </em>level<em> means in this context?”</em></blockquote><p>I explained:<br> A <strong>level</strong> represents the <strong>nodes infected at the same minute</strong>.<br> Each BFS iteration corresponds to one minute of infection spread.</p><ul><li>Level 0 = start node</li><li>Level 1 = directly connected nodes (parent/children)</li><li>Level 2 = next layer of infection, and so on.</li></ul><p>The <strong>last BFS level</strong> gives the total infection time.</p><h3>💡 Optimal BFS Solution</h3><pre>class Solution {<br>    Map&lt;Integer, List&lt;Integer&gt;&gt; graph = new HashMap&lt;&gt;();</pre><pre>    public int amountOfTime(TreeNode root, int start) {<br>        buildGraph(root, null);</pre><pre>        Queue&lt;Integer&gt; q = new LinkedList&lt;&gt;();<br>        Set&lt;Integer&gt; visited = new HashSet&lt;&gt;();<br>        q.add(start);<br>        visited.add(start);</pre><pre>        int minutes = -1;<br>        while (!q.isEmpty()) {<br>            int size = q.size();<br>            minutes++;<br>            for (int i = 0; i &lt; size; i++) {<br>                int cur = q.poll();<br>                for (int nei : graph.get(cur)) {<br>                    if (visited.add(nei)) q.add(nei);<br>                }<br>            }<br>        }<br>        return minutes;<br>    }</pre><pre>    private void buildGraph(TreeNode node, TreeNode parent) {<br>        if (node == null) return;<br>        graph.putIfAbsent(node.val, new ArrayList&lt;&gt;());<br>        if (parent != null) {<br>            graph.get(node.val).add(parent.val);<br>            graph.get(parent.val).add(node.val);<br>        }<br>        buildGraph(node.left, node);<br>        buildGraph(node.right, node);<br>    }<br>}</pre><h3>🧮 Complexity</h3><p>Type Complexity Explanation <strong>Time</strong> O(N) Each node visited once <strong>Space</strong> O(N) Graph + queue + visited set</p><h3>🎯 Key Takeaways</h3><p>💡 <strong>1. Choose your DS wisely:</strong><br> Before coding, decide the <em>primary data structure</em> — graph for infection, recursion with DP for robbery.</p><p>💡 <strong>2. BFS = time layers:</strong><br> In problems with “spreading” or “distance per minute”, BFS naturally models time progression.</p><p>💡 <strong>3. Always justify complexity:</strong><br> Interviewers love when you explain <em>why</em> space is O(h) or O(n), not just quote it.</p><p>💡 <strong>4. Speak your thought process:</strong><br> Even if code isn’t perfect, structured reasoning wins hearts (and offers).</p><h3>💬 Final Thoughts</h3><p>This interview reminded me that success in Amazon-style DSA rounds isn’t about memorizing solutions — <br> it’s about <strong>thinking from first principles</strong>, choosing the right <strong>data structures</strong>, and explaining <strong>why</strong>.</p><p>When you can confidently discuss <em>why a DFS fits better than BFS, or why a HashMap is required</em>, you’re already ahead of most candidates.</p><p>Although I was not called for Round 2 which was System Design as I was not selected in first.</p><h3>📚 Problem References</h3><ul><li>🏠 <strong>House Robber III</strong> → <a href="https://leetcode.com/problems/house-robber-iii/">LeetCode #337</a></li><li>🌳 <strong>Amount of Time for Binary Tree to Be Infected</strong> → <a href="https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/">LeetCode #2385</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c82471f8210" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Code Quality with SonarLint: Binding to SonarQube or SonarCloud in IntelliJ IDE]]></title>
            <link>https://shubhamrajkumawat.medium.com/enhancing-code-quality-with-sonarlint-binding-to-sonarqube-or-sonarcloud-in-intellij-ide-8240f28f341e?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/8240f28f341e</guid>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[intellij]]></category>
            <category><![CDATA[sonarlint]]></category>
            <category><![CDATA[sonarcloud]]></category>
            <category><![CDATA[code-quality]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 06:23:16 GMT</pubDate>
            <atom:updated>2024-08-06T06:23:16.739Z</atom:updated>
            <content:encoded><![CDATA[<p>In the ever-evolving landscape of software development, maintaining high <strong>code quality</strong> is paramount. Tools like SonarLint help developers <strong>catch bugs</strong> and <strong>code smells</strong> early in the development process. When integrated with powerful platforms like <strong>SonarQube </strong>or <strong>SonarCloud</strong>, SonarLint becomes even more potent, offering <strong>deeper analysis</strong> and historical context. This article will guide you through binding SonarLint to SonarQube or SonarCloud within the <strong>IntelliJ IDE</strong>, enhancing your coding workflow.</p><ul><li><strong>Why Bind SonarLint to SonarQube or SonarCloud?</strong></li></ul><p>Binding SonarLint to SonarQube or SonarCloud extends the capabilities of SonarLint beyond local analysis. It allows you to:<br>- Leverage centralized rules and quality profiles defined in SonarQube or SonarCloud.<br>- Receive project-wide issue synchronization.<br>- Access a comprehensive history of code quality issues.</p><ul><li><strong>Prerequisites</strong></li></ul><p>Before you start, ensure you have the following:</p><p>- Node.JS installed in system.<br>- SonarLint installed in IntelliJ.<br>- Access to a SonarQube server or a SonarCloud account</p><p><strong>Step-by-Step Guide to Binding SonarLint</strong></p><p><strong>1. Open SonarLint Settings in IntelliJ</strong></p><p>Navigate to the SonarLint settings in IntelliJ:<br>1. Go to `File` -&gt; `Settings` (or `IntelliJ IDEA` -&gt; `Preferences` on macOS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*z_QOtk2uTDLdmob37DrmCg.png" /></figure><p>2. In the left-hand pane, select `Tools` -&gt; `SonarLint`.</p><p>3. Select the path of Node.JS installed in system.</p><p><strong>2. Configure Connection to SonarQube or SonarCloud</strong></p><p>In the SonarLint settings:<br>1. Click on the `Connections` tab.<br>2. Click the `+` button to add a new connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*z_QOtk2uTDLdmob37DrmCg.png" /></figure><p><strong>SonarQube</strong></p><p>For SonarQube:<br>1. Select `SonarQube` as the connection type.<br>2. Enter the SonarQube server URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*r4serbwDB3OK7uTmm_qthQ.png" /></figure><p>3. Authenticate using either a token or login credentials. It will automatically fetch token from server when clicked on “Create Token”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*I7MEhvzYKiKmrlZJNK2TgQ.png" /></figure><p>4. Test the connection to ensure it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*_N49CQdpq3oChURE05du7g.png" /></figure><p><strong>SonarCloud</strong></p><p>For SonarCloud:<br>1. Select `SonarCloud` as the connection type.<br>2. Authenticate using your SonarCloud token.<br>3. Test the connection to ensure it works.</p><p><strong>3. Bind Your Project to a SonarQube or SonarCloud Project</strong></p><p><strong>After configuring the connection:<br></strong>1. Go back to the `Project Settings` tab in the SonarLint settings.<br>2. Select the connection you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*mSzwGXEyVdPfjd2vrt4zwg.png" /></figure><p>3. Choose the appropriate project from the dropdown list. This list shows all projects available on your SonarQube server or SonarCloud account.</p><p><strong>4. Synchronize Settings</strong></p><p>Once the project is bound:<br>1. SonarLint will synchronize with the project’s quality profiles and settings from SonarQube or SonarCloud.<br>2. Ensure the synchronization is successful to leverage centralized rules and policies.</p><p><strong>5. Analyzing Code with SonarLint</strong></p><p><strong>With the binding complete:<br></strong>1. SonarLint will analyze your code against the rules and profiles from SonarQube or SonarCloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u31xy24eyAFEKbTklWcIcg.png" /></figure><p>2. Issues will be reported in real-time as you code, ensuring immediate feedback and correction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwKQJZUQ2nMfKByZ50S-bQ.png" /></figure><p><strong>Benefits of Binding SonarLint to SonarQube or SonarCloud</strong></p><ul><li><strong>Centralized Quality Management</strong></li></ul><p>By binding SonarLint to SonarQube or SonarCloud, your team can manage coding standards and quality profiles centrally. This ensures consistency across all projects and team members.</p><ul><li><strong>Enhanced Issue Detection</strong></li></ul><p>Binding enables SonarLint to use the comprehensive rule sets and profiles from SonarQube or SonarCloud, improving the detection of issues beyond the basic local analysis.</p><ul><li><strong>Historical Context</strong></li></ul><p>Access to the historical context of code quality issues allows developers to understand trends and recurring problems, facilitating better long-term improvements.</p><ul><li><strong>Continuous Integration and Continuous Delivery (CI/CD)</strong></li></ul><p>Integrating SonarLint with SonarQube or SonarCloud ensures that code quality checks are part of the CI/CD pipeline, catching issues early and reducing the risk of introducing bugs into production.</p><p><strong>Conclusion</strong></p><p>Binding SonarLint to SonarQube or SonarCloud in IntelliJ is a straightforward process that significantly enhances your ability to maintain high code quality. By leveraging centralized rules, enhanced issue detection, and historical context, you can catch potential problems early and ensure a smoother development process. Follow the steps outlined in this guide to integrate these powerful tools and take your code quality to the next level.</p><p>For more detailed instructions, you can visit the official [SonarSource documentation](<a href="https://github.com/SonarSource/sonarlint-intellij/wiki/Bind-to-SonarQube-or-SonarCloud">https://github.com/SonarSource/sonarlint-intellij/wiki/Bind-to-SonarQube-or-SonarCloud</a>)</p><p>You can also refer to <a href="https://github.com/SonarSource/sonarlint-intellij/wiki/Bind-to-SonarQube-or-SonarCloud">https://github.com/SonarSource/sonarlint-intellij/wiki/Bind-to-SonarQube-or-SonarCloud</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8240f28f341e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Anatomy of the CrowdStrike Outage: A Programmer’s Misstep Unveiled]]></title>
            <link>https://shubhamrajkumawat.medium.com/the-anatomy-of-the-crowdstrike-outage-a-programmers-misstep-unveiled-27f4af1e69fb?source=rss-c76f58b4ea89------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f4af1e69fb</guid>
            <category><![CDATA[crowdstrike]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Shubham Raj Kumawat]]></dc:creator>
            <pubDate>Tue, 23 Jul 2024 05:26:45 GMT</pubDate>
            <atom:updated>2024-07-23T05:26:45.373Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of cybersecurity, the resilience of tools like CrowdStrike is paramount. However, even the most robust systems can falter due to human error. Recently, a significant outage at CrowdStrike underscored the fragility of code and the far-reaching impact of a seemingly small mistake. Let’s delve into what transpired.</p><h3>The Programmer’s Misstep</h3><p>The root cause of the outage was a programming error in C++. A developer inadvertently introduced a bug, creating a cascade of issues that culminated in a system crash. Understanding the specifics of this error sheds light on the critical importance of meticulous coding practices.</p><h3>The Culprit: Null Pointer Creation</h3><p>The problematic code involved the creation of a pointer variable (Obj* obj). Ideally, this pointer should have referenced a specific object in memory containing the necessary data. However, due to the error, the pointer remained NULL—meaning it didn&#39;t point to any valid memory location.</p><h3>Missing Null Check</h3><p>Robust code typically includes safeguards to verify that pointers are valid before attempting to use them. A common practice is to check if the pointer is NULL (e.g., if (obj == NULL) { ... }). In this instance, the developer omitted this crucial check.</p><h3>Attempting to Access “Nothing”</h3><p>As the code attempted to access member variables of the object via the null pointer (e.g., obj-&gt;a or obj-&gt;b), it tried to read data from an invalid memory address. For instance, if the code calculated an offset from a null pointer value (e.g., 0x0 + 4), it would attempt to access memory at 0x9C, which is invalid. The stack dump snapshot revealed this miscalculation, showing an attempt to access 0x9C, an invalid memory region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqI2q1AFEdIwVw_CR2s0_A.jpeg" /></figure><h3>Memory Access Violation</h3><p>Accessing invalid memory is recognized by operating systems as a severe threat, prompting protective measures. In this case, Windows identified the illegal memory access as a security risk and crashed the program to safeguard the system. This abrupt termination led to the infamous Blue Screen of Death (BSOD) and the subsequent service outage.</p><h3>Conclusion</h3><p>This incident underscores the importance of rigorous coding standards and thorough testing. A simple null pointer check could have averted the entire outage, highlighting the critical need for vigilance in software development.</p><h3>Credit</h3><p>Special thanks to Zach Vorhies for his in-depth analysis of the issue.</p><h3>Source</h3><p>For further details, refer to the original analysis on <a href="https://lnkd.in/g5BZKx6G">LinkedIn</a>.</p><p>This incident serves as a stark reminder to developers: always check your pointers, and never underestimate the impact of a single line of code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f4af1e69fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>