<?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 Arnav Gupta on Medium]]></title>
        <description><![CDATA[Stories by Arnav Gupta on Medium]]></description>
        <link>https://medium.com/@arnavkumargupta777?source=rss-53950c4655f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vOqGpr6KB_1DGHjJ</url>
            <title>Stories by Arnav Gupta on Medium</title>
            <link>https://medium.com/@arnavkumargupta777?source=rss-53950c4655f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:12:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arnavkumargupta777/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[How I Automated My LinkedIn Outreach Research with Claude and Python]]></title>
            <link>https://medium.com/@arnavkumargupta777/how-i-automated-my-linkedin-outreach-research-with-claude-and-python-c20119ce9a81?source=rss-53950c4655f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c20119ce9a81</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Arnav Gupta]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 18:32:27 GMT</pubDate>
            <atom:updated>2026-08-15T18:32:27.170Z</atom:updated>
            <content:encoded><![CDATA[<p>Landing early-career software engineering roles or quality internships often feels like a full-time job. Between hunting for companies that actually have budget, filtering out unmonitored inboxes, and crafting tailored outreach notes under strict character limits, the manual overhead adds up quickly.</p><p>Recently, I built a reliable, semi-automated workflow using <strong>Claude for Desktop (Scheduled Runs)</strong>, the <strong>Claude Chrome Extension</strong>, and a local <strong>Python/Excel tracker</strong>.</p><p>Instead of relying on clunky third-party scraping tools or spammy automation bots that can get your LinkedIn account flagged, this system uses an LLM to perform deep research across verified browser sessions, validates company sizes and recruiter activity, drafts bespoke connection notes, and appends them directly to a local spreadsheet.</p><p>Here is the complete walkthrough of how it works, how to set it up, and the exact master prompt to run it yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rB9YxBzI7rYvFYBcpofCw.avif" /><figcaption>Claude + LinkedIn</figcaption></figure><h3>1. The Strategy: Why Most Cold Outreach Fails</h3><p>Most candidates make two critical mistakes:</p><ol><li><strong>Targeting the extremes:</strong> Reaching out to Big Tech recruiters (where inboxes receive thousands of messages a day) or tiny early-stage startups that lack the budget to hire or sponsor competitive pay bands.</li><li><strong>Generic, robotic messaging:</strong> Sending bland templates (<em>“Hi, I saw you work at X and want a job”</em>) or exceeding LinkedIn’s <strong>300-character limit</strong> for connection notes.</li></ol><p>To fix this, I designed a set of strict heuristics:</p><ul><li><strong>The 90k — 400k Follower Sweet Spot:</strong> Companies with fewer than 90,000 LinkedIn followers often carry hiring or budget uncertainty. Those with more than 400,000 followers are usually overrun with applicants. The 90k–400k range captures well-funded, high-growth mid-sized product companies, GCCs, established service leaders, and scale-ups.</li><li><strong>Balanced Portfolio Allocation:</strong> Each research run targets exactly 10 companies across a specific portfolio:</li><li>1–2 Niche / Focus Domain firms (e.g., WealthTech / FinTech)</li><li>3–4 Mid-sized Product / SaaS companies</li><li>1–2 High-bar Engineering Service firms</li><li>1 Fast-growing Startup</li><li>1–2 Applied AI / Infrastructure companies</li><li><strong>Recruiter Reachability Filters:</strong> Target <strong>Talent Acquisition / Technical Recruiters only</strong> (not busy CTOs or engineering managers), enforcing a minimum of <strong>500+ connections</strong> (filters dead profiles) and fewer than <strong>40,000 followers</strong> (filters creator accounts who rarely check DMs).</li><li><strong>The 280–299 Character Sweet Spot:</strong> LinkedIn connection requests cap notes at 300 characters. Every note generated by this workflow is programmatically checked to land between <strong>280 and 299 characters</strong>, maximizing value and context without getting cut off.</li></ul><h3>2. Architecture &amp; Prerequisites</h3><p>The workflow operates locally on your machine with zero API subscription costs beyond your standard setup:</p><ul><li><strong>Claude for Desktop:</strong> Acts as the orchestrator running prompt logic with strict heuristics.</li><li><strong>Claude Chrome Extension:</strong> Interacts with active, logged-in LinkedIn tabs for live verification of companies, followers, and recruiter profiles.</li><li><strong>Python Engine (</strong>openpyxl<strong>):</strong> Handles de-duplication, character count verification, safe file handling, and sheet formatting.</li><li><strong>Local Excel Tracker:</strong> Stores organized, ready-to-send leads.</li></ul><h3>What You Need:</h3><ul><li><strong>Claude for Desktop App</strong></li><li><strong>Claude Chrome Extension</strong> installed, with your LinkedIn account logged in on an active tab</li><li>An Excel workbook saved locally (e.g., Job_Outreach_Tracker.xlsx)</li><li><strong>Python environment</strong> with openpyxl installed</li></ul><h3>3. Step-by-Step Implementation</h3><h3>Step 1: Initialize Your Tracker Workbook</h3><p>Create an Excel file named Job_Outreach_Tracker.xlsx on your local workspace. Inside, add a sheet titled LinkedIn Outreach with these exact column headers in Row 1:</p><ol><li><strong>Company</strong></li><li><strong>Company Category / Domain</strong></li><li><strong>Contact Name</strong></li><li><strong>Title</strong></li><li><strong>Contact Type</strong></li><li><strong>Target Role</strong></li><li><strong>LinkedIn Profile Link</strong></li><li><strong>Company Page Link</strong></li><li><strong>Connection Note (paste as-is)</strong></li></ol><h3>Step 2: Configuration Variables (Replace Before Running)</h3><p>Replace the bracketed values in the prompt below with your own details:</p><ul><li>[YOUR_FULL_NAME] — Your first and last name <em>(e.g., Alex Rivera)</em></li><li>[TRACKER_FILE_NAME.xlsx] — Local filename of your Excel tracker <em>(e.g., Job_Outreach_Tracker.xlsx)</em></li><li>[YOUR_COLLEGE_DEGREE] — Degree and university <em>(e.g., B.Tech CS, State University)</em></li><li>[YOUR_GRADUATION_MONTH_YEAR] — Graduation date <em>(e.g., May 2027)</em></li><li>[YOUR_CURRENT_ROLE_AND_COMPANY] — Current headline position <em>(e.g., Backend Intern at Acme Fintech)</em></li><li>[YOUR_PAST_EXPERIENCES] — Prior internships or projects <em>(e.g., TechCorp and NextGen Labs)</em></li><li>[YOUR_EMAIL] — Contact email <em>(e.g., alex.rivera@example.com)</em></li><li>[YOUR_SKILLS_LIST] — Primary tech stack <em>(e.g., TypeScript, Node.js, Go, PostgreSQL, Docker)</em></li><li>[TARGET_LOCATIONS] — Target cities/regions <em>(e.g., Bangalore, Hyderabad, or Remote)</em></li><li>[TARGET_ROLE_1]<strong>, </strong>[TARGET_ROLE_2] — Desired roles <em>(e.g., Backend Intern, Junior SDE)</em></li><li>[CURRENT_OR_HIGHLIGHT_COMPANY] — Main company/experience to highlight <em>(e.g., Acme Fintech)</em></li><li>[CORE_TECH_FOCUS] — Engineering niche <em>(e.g., high-throughput distributed microservices)</em></li><li>[TARGET_PRIMARY_DOMAIN] — Primary industry vertical <em>(e.g., Fintech / WealthTech)</em></li></ul><h3>Step 3: The Complete Production Prompt</h3><p>Copy and paste the prompt below into Claude:</p><pre>## Objective<br>Expand [YOUR_FULL_NAME]’s LinkedIn outreach tracker with new target companies and relevant LinkedIn recruiting contacts.</pre><pre>This is a manually triggered research run initiated while LinkedIn is open and active in Chrome via the Claude extension.</pre><pre>The run must be self-contained. Do not assume access to memory, previous chat messages, or previous run results beyond what is stored in the tracker workbook.</pre><pre>Do not send connection requests, click Connect, follow profiles, message anyone, submit applications, or perform any automated LinkedIn account actions. Only research public data and update the spreadsheet. Outreach is handled manually.</pre><pre>---</pre><pre>## Candidate Profile<br>Name: [YOUR_FULL_NAME]<br>Education: [YOUR_COLLEGE_DEGREE]<br>Graduation: [YOUR_GRADUATION_MONTH_YEAR]<br>Current Role: [YOUR_CURRENT_ROLE_AND_COMPANY]<br>Previous Experience: [YOUR_PAST_EXPERIENCES]<br>Email: [YOUR_EMAIL]</pre><pre>Relevant Skills:<br>[YOUR_SKILLS_LIST]</pre><pre>Target Opportunities:<br>1. [TARGET_ROLE_1]<br>2. [TARGET_ROLE_2]</pre><pre>---</pre><pre>## Hard Rules<br>1. Add exactly 9 to 10 new companies during each run.<br>2. Do not add a company already present in the tracker.<br>3. Do not add a LinkedIn profile already present in the tracker.<br>4. Never fabricate an office location, funding round, hiring status, contact name, title, company page, or LinkedIn profile URL.<br>5. Only use exact URLs verified directly from browser search pages.<br>6. Use openpyxl for all workbook modifications and saving. Pandas may be used for temporary analysis but must not be used to save the workbook.<br>7. Preserve every existing row, sheet, style, hyperlink, column width, filter, and workbook setting.<br>8. Do not automatically contact anyone on LinkedIn.<br>9. Every connection note must be verified programmatically to be strictly between 280 and 299 characters, including spaces.<br>10. When information cannot be verified, use the specified fallback value rather than guessing.</pre><pre>---</pre><pre>## Step 1 — Locate the Existing Workbook<br>Search the accessible workspace and output directories recursively for:<br>[TRACKER_FILE_NAME.xlsx]</pre><pre>- If exactly one matching file is found, use that file.<br>- If multiple matching files are found, select the most recently modified valid workbook and log this in the final report.</pre><pre>Open the workbook using openpyxl.load_workbook(). Access the sheet named &quot;LinkedIn Outreach&quot;.</pre><pre>Read all existing rows and collect:<br>- Company names<br>- LinkedIn profile links<br>- Company page links</pre><pre>Duplicate Normalization:<br>- Companies: Convert names to lowercase, strip punctuation, trim whitespace, and normalize common legal entities (Pvt Ltd, Ltd, Inc, LLC). Prefer canonical LinkedIn company page URLs as the unique identifier.<br>- Contacts: Strip URL tracking parameters and trailing slashes. Reject any profile URL already present in the sheet.</pre><pre>---</pre><pre>## Step 2 — Recreate Workbook (Fallback Only)<br>Recreate the workbook only if no usable copy can be found.</pre><pre>Create a sheet named &quot;LinkedIn Outreach&quot; with these exact columns:<br>1. Company<br>2. Company Category / Domain<br>3. Contact Name<br>4. Title<br>5. Contact Type<br>6. Target Role<br>7. LinkedIn Profile Link<br>8. Company Page Link<br>9. Connection Note (paste as-is)</pre><pre>Formatting Standards:<br>- Use Arial font throughout. Header background: Navy #1F4E78; Header text: Bold and White.<br>- Add thin borders across header and data cells. Freeze row 1. Enable autofilter on all columns.<br>- Alternate row shading between white and light grey #F2F2F2.<br>- Enable text wrapping for the Connection Note column (set row height to ~60pt).<br>- Add clickable hyperlinks to valid profile and company URLs.</pre><pre>Create a second sheet named &quot;Read Me&quot; specifying manual outreach best practices (e.g., limit sends to 5–10 requests per day).</pre><pre>---</pre><pre>## Step 3 — Research New Companies<br>Find 9 to 10 eligible companies with engineering hubs in [TARGET_LOCATIONS].</pre><pre>1. Follower Count Guardrails (Strict):<br>Target companies must have between 90,000 (90k) and 400,000 (400k) followers on LinkedIn:<br>- Less than 90k followers: Reject (higher risk of limited compensation/budget).<br>- Greater than 400k followers: Reject (higher risk of unreachable recruiters / mega-corps).</pre><pre>2. Run Composition Target (10 Companies Total):<br>- 1 to 2 Primary Focus / Domain-Specific Companies (e.g., [TARGET_PRIMARY_DOMAIN])<br>- 3 to 4 Mid-Sized Product Companies (Established SaaS, GCCs, or developer platforms)<br>- 1 Quality Engineering Service / Consulting Firm (High-bar engineering centers with competitive compensation)<br>- 1 Fast-Growing Startup (Well-backed mid-stage startup with solid technical runway)<br>- 1 to 2 AI-Focused Companies (Applied AI/ML products or data-infrastructure startups)</pre><pre>3. Exclusions:<br>- Big Tech / FAANG / MAANG firms.<br>- Hyper-growth unicorn startups dominating national headlines.<br>- Companies without verified technical offices in [TARGET_LOCATIONS].</pre><pre>---</pre><pre>## Step 4 — Find LinkedIn Contacts (Talent Acquisition Only)<br>For each target company, extract up to two contacts.</pre><pre>Persona Filter:<br>Select only contacts currently working in Talent Acquisition, Human Resources, Technical Recruitment, or Campus Recruitment.<br>Do not select Engineering Managers, Tech Leads, or C-level Executives.</pre><pre>Activity &amp; Reachability Filters:<br>- Minimum Network Size: Contact must have 500+ connections (filters out inactive accounts).<br>- Maximum Followers: Contact must have fewer than 40,000 followers (filters out unmonitored creator accounts).</pre><pre>Search Queries:<br>https://www.linkedin.com/search/results/people/?keywords=&lt;URL-encoded company name&gt; Talent Acquisition<br>https://www.linkedin.com/search/results/people/?keywords=&lt;URL-encoded company name&gt; Technical Recruiter<br>https://www.linkedin.com/search/results/people/?keywords=&lt;URL-encoded company name&gt; Campus Recruiter</pre><pre>Contact Type Values:<br>- Talent Acquisition<br>- Technical Recruiter<br>- Campus Recruiter<br>- HR Manager<br>- Pending LinkedIn Lookup</pre><pre>---</pre><pre>## Step 5 — LinkedIn Unavailable Fallback<br>If browser navigation is rate-limited or blocked:<br>- Do not fail the workflow. Proceed with company domain verification via general search.<br>- Populate the row with Contact Name: &quot;TBD — LinkedIn lookup&quot;, Contact Type: &quot;Pending LinkedIn Lookup&quot;, and leave the profile URL blank.</pre><pre>---</pre><pre>## Step 6 — Select Target Role<br>Assign the most relevant role label based on the candidate profile:<br>- [TARGET_ROLE_1]<br>- [TARGET_ROLE_2]<br>- Software Engineering Intern<br>- SDE1 / New Graduate</pre><pre>---</pre><pre>## Step 7 — Write Personalized Connection Notes<br>Write one customized connection note per contact adhering to LinkedIn&#39;s character constraints.</pre><pre>Structural Rules:<br>- Character Limit: Strictly between 280 and 299 characters (including spaces).<br>- Hook: Highlight experience at [CURRENT_OR_HIGHLIGHT_COMPANY] and focus on [CORE_TECH_FOCUS].<br>- Company Detail: Reference a verified product, milestone, or technical engineering initiative at the target company.<br>- Call to Action: Conclude by asking to connect regarding early career or engineering opportunities.</pre><pre>Note Templates:</pre><pre>Path A: For [TARGET_PRIMARY_DOMAIN] Companies:<br>&quot;Hi &lt;Name&gt;, I&#39;m an engineer at [CURRENT_OR_HIGHLIGHT_COMPANY]. I have hands-on experience building in this space and want to continue growing here. I saw what you&#39;re building with &lt;specific product/feature&gt; at &lt;Company&gt; and would love to connect for early career roles!&quot;</pre><pre>Path B: For All Other Product / AI / Service Companies:<br>&quot;Hi &lt;Name&gt;, I&#39;m an engineer at [CURRENT_OR_HIGHLIGHT_COMPANY] working on [CORE_TECH_FOCUS]. I came across &lt;Company&gt; and really liked your work on &lt;specific engineering feature/tool&gt;. I&#39;d love to connect to explore intern or early career engineering opportunities!&quot;</pre><pre>Validation: Validate character count before appending using: 280 &lt; len(note) &lt; 300.</pre><pre>---</pre><pre>## Step 8 — Safe Append &amp; Save<br>1. Open [TRACKER_FILE_NAME.xlsx] using openpyxl.<br>2. Append new rows to &quot;LinkedIn Outreach&quot;.<br>3. Preserve styling: Arial font, thin borders, alternating #F2F2F2 fill, and active hyperlinks.<br>4. Save to a temporary .xlsx file first, verify integrity, then overwrite the original file.</pre><pre>---</pre><pre>## Step 9 — Verification &amp; Report<br>Output a structured run report:<br>1. List of companies added grouped by category.<br>2. Verified follower count per company (within 90k–400k).<br>3. Number of TA contacts identified.<br>4. Row count delta (previous count vs. updated count).<br>5. Reminder: Space outreach to 5–10 requests/day to keep account metrics healthy.</pre><h3>4. Key Takeaways &amp; Best Practices</h3><ul><li><strong>Human in the Loop:</strong> Keep account actions manual. Letting an LLM research and organize data is safe and fast; automating clicks or browser actions directly on your personal LinkedIn profile risks getting restricted.</li><li><strong>Safe Sending Volume:</strong> Send <strong>5 to 10 connection requests per day</strong>. Spacing requests out yields higher acceptance rates and keeps your LinkedIn account metrics in good standing.</li><li><strong>Inspect the Output:</strong> Before copying notes into LinkedIn, do a quick 5-second check on company hooks and contact names to ensure high quality.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c20119ce9a81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SDD, TDD, and the Changing Role of Software Engineers]]></title>
            <link>https://medium.com/@arnavkumargupta777/sdd-tdd-and-the-changing-role-of-software-engineers-8efdbccb031c?source=rss-53950c4655f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8efdbccb031c</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Arnav Gupta]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 06:06:00 GMT</pubDate>
            <atom:updated>2026-07-13T06:06:00.796Z</atom:updated>
            <content:encoded><![CDATA[<p>I have recently been thinking about a simple question: when coding agents can write a large part of the implementation, what should developers spend most of their time owning?</p><p>One approach I have been reading about and trying to apply is <strong>Spec-Driven Development, or SDD</strong>. In this approach, the specification becomes the main source of truth for the project. Before implementation begins, the developer defines the expected behaviour, business rules, constraints, edge cases, and important architectural decisions. When a requirement changes, the specification is updated first, and the coding agent then modifies the implementation accordingly.</p><p>The basic idea behind this is not new. Long before AI coding agents existed, software engineering had <strong>Model-Driven Development, or MDD</strong>. In MDD, developers created formal models of a system, and specialised tools generated parts of the implementation from those models.</p><p>In many ways, SDD feels like a more evolved and accessible version of the same philosophy for the AI era. MDD depended heavily on formal modelling languages, predefined transformations, and specialised tooling. SDD can work with natural-language specifications, design documents, repository context, architectural guidelines, and coding agents.</p><p>However, a specification alone is not always enough. Coding agents are non-deterministic, which means the same specification can produce different implementations. Both versions may satisfy the requirement, but they may differ significantly in structure, maintainability, performance, or security.</p><p>This is where <strong>Test-Driven Development, or TDD</strong>, can complement SDD. The specification explains the intended behaviour of the system, while tests make that behaviour executable and verifiable. The agent can generate much of the implementation, but the tests help determine whether the generated output actually meets the expectations.</p><p>A practical workflow could involve defining the specification and architecture, writing the important tests, using the coding agent to produce the implementation, and then reviewing the final design, trade-offs, and code quality.</p><p>In this kind of development, code increasingly becomes a by-product of the decisions made before and around it. The real engineering effort moves towards understanding the problem, removing ambiguity, defining boundaries, designing the system, and validating the outcome.</p><p>But code becoming a by-product does not reduce ownership. The developer still owns the requirements, the architecture, the generated implementation, and its behaviour in production. In fact, as agents become capable of producing more code at greater speed, that ownership may become even more important because developers are now responsible for reviewing and validating a much larger amount of output.</p><p>The way code is written may be changing, but engineering accountability remains the same — and is possibly increasing.</p><p>#SoftwareEngineering #SpecDrivenDevelopment #ModelDrivenDevelopment #TDD #AICoding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8efdbccb031c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Backend Intern Interview Experience at a Series D-Funded Fintech]]></title>
            <link>https://medium.com/@arnavkumargupta777/my-backend-intern-interview-experience-at-a-series-d-funded-fintech-0f3df344bb59?source=rss-53950c4655f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f3df344bb59</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Arnav Gupta]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 15:42:40 GMT</pubDate>
            <atom:updated>2026-06-27T15:42:40.460Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zn_S9dGs_rLB4xmhfte9Yg.png" /></figure><p>I recently earned the opportunity to join as a <strong>Backend Engineer Intern</strong> at a <strong>Series D-funded fintech company</strong> building products at the intersection of investing, wealth management, and capital markets technology in India.</p><p>This blog is a breakdown of my complete <strong>backend intern interview experience</strong> how I applied, what the rounds looked like, how I prepared, where I struggled, and what helped me finally get the offer.</p><p>I am writing this especially for students, new grads, and early-career engineers who are preparing for backend-heavy internships and want a realistic view of what these interviews can look like.</p><h3>How I Applied</h3><p>I did not come from a very “fancy” college background, so I knew I had to make my resume, projects, and preparation do most of the talking. I applied for the role through LinkedIn. Around one week later, I received a call from the recruiter. The first call was a basic screening round. The recruiter asked about:</p><ul><li>My background</li><li>My availability</li><li>The projects on my resume</li><li>Whether I would be able to commit to the internship timeline</li></ul><h3>Round 1: Backend Fundamentals + Resume Deep Dive</h3><p>The first round was scheduled around four to five days later.</p><p>This was a backend-heavy technical round. The interviewer went through my resume, my previous internship experience, and the backend projects I had listed. The round was not just about direct theory questions. A lot of questions were situation-based. The interviewer would ask something, then keep adding constraints on top of it to see how I approached follow-ups.</p><p>That made the round feel more like a real engineering discussion than a normal question-answer interview.</p><p>We discussed areas like:</p><ul><li>Backend fundamentals</li><li>API design</li><li>Databases</li><li>Previous internship work</li><li>Project architecture</li><li>Trade-offs in backend systems</li><li>How I reason through constraints</li></ul><p>At the end of the round, I was asked one DSA question based on <strong>binary search</strong>. I had to explain the brute-force approach, optimize it, and discuss time and space complexity.</p><p>There was also one JavaScript question around Promise.all. I had not heard about Promise.all properly at that time, so I was not able to solve it fully. I was close but not correct.</p><p>Still, apart from that JavaScript part, the round went well because my backend fundamentals were strong and I was able to explain my projects clearly.</p><h3>How I Prepared After Round 1</h3><p>After two to three days, I got the feedback that I had cleared the first round.</p><p>I was told the next round would be a live coding round focused on DSA or SQL, and it would last around 1.5 hours. So, I prepared accordingly.</p><p>For the next few days, I revised:</p><ul><li>DSA patterns</li><li>SQL basics</li><li>Time and space complexity explanation</li></ul><p>I thought I was going into a DSA or SQL-heavy round. But the actual round turned out to be very different.</p><h3>Round 2: Machine Coding Round</h3><p>On the day of the interview, I found out that the round was more like a <strong>machine coding round</strong>.</p><p>The task was to design and implement a stock-market-style simulation with multiple constraints and test cases.</p><p>The expected solution had to be:</p><ul><li>Object-oriented</li><li>Cleanly structured</li><li>Written like a reusable library</li><li>Easy to test</li><li>Able to handle different edge cases</li></ul><p>I was not fully prepared for this type of round. I had also not revised Java basics deeply enough, so I decided not to write the solution in Java.</p><p>Instead, I chose C++ because I was more comfortable solving logic-heavy problems in it.</p><p>The challenge was to understand the problem statement, ask the right follow-up questions, design the solution, write the code, and pass the test cases all within around one to one-and-a-half hours.</p><p>I managed to write the solution and pass the test cases.</p><p>However, the feedback was that my code could have been more object-oriented and closer to a proper <strong>LLD-style structure</strong>. That feedback was fair. I had focused more on getting the logic correct and less on the design structure.</p><p>At that point, I honestly thought my journey was over. Since it was a long weekend, I assumed I would probably not move ahead.</p><h3>Round 3: Hiring Manager Round</h3><p>After four to five days, I followed up for feedback.</p><p>To my surprise, I was told that I had cleared the machine coding round and would now have a final round with the hiring manager. I was told there was nothing very specific to prepare and that the round would be more of a final discussion around logic, fundamentals, and fit.</p><p>Still, I revised the basics again.</p><p>I went through:</p><ul><li>Backend fundamentals</li><li>My projects</li><li>My previous internship work</li><li>Common system design trade-offs</li><li>Coding standards</li><li>Why I had made certain technical choices</li></ul><p>The actual round felt very different from the earlier ones. It started casually. The hiring manager asked about my background, my resume, my projects, my academics, and my previous experience.</p><p>But the follow-up questions were deep. Some questions made me think much harder than expected. Even today, I remember a few of them because they were not just about “knowing the answer.” They tested whether I could reason clearly.</p><p>The discussion covered:</p><ul><li>Programming fundamentals</li><li>Code quality</li><li>Backend design decisions</li><li>Previous work experience</li><li>Project depth</li><li>Communication clarity</li><li>How I think through engineering trade-offs</li></ul><h3>The Question That Helped Me Stand Out</h3><p>At the end of the interview, I was asked if I had any questions.</p><p>This was one of the most important moments of the process.</p><p>I knew the company worked with backend systems at scale, and my own resume had microservices-heavy backend projects. So instead of asking a generic question, I asked something I was genuinely curious about. I asked about the industry shift where some teams are moving from microservices back to monoliths.</p><p>My question was around:</p><ul><li>Why are some companies moving away from microservices?</li><li>When do microservices actually make sense?</li><li>When do they become over-engineering?</li><li>How do teams decide between a monolith and microservices?</li></ul><p>That question led to a strong discussion.</p><p>I think asking a thoughtful question helped me make a better impression because it showed genuine interest in backend architecture and real-world trade-offs.</p><h3>The Offer</h3><p>After three to four days, I followed up again.</p><p>I was asked to submit some documents, including a No Objection Certificate from my college. I submitted everything within a day. A few days later, I received the email saying I had cleared the interview process.</p><p>That was one of the best moments for me. A week later, I received the offer letter and signed it.</p><h3>What This Journey Taught Me</h3><p>This offer was not the result of one lucky interview. It was the result of constantly giving interviews, failing, improving, and trying again.</p><p>A few months before this, I had interviewed with an early-stage startup where they criticized my projects although I agreed with them. In another company, I was rejected during the initial phone screening because my communication was not good enough.</p><p>Those moments were painful, but they helped me understand what I needed to improve.</p><p>Over time, I worked on:</p><ul><li>Speaking more clearly</li><li>Explaining my projects better</li><li>Strengthening backend fundamentals</li><li>Practicing DSA consistently</li><li>Building deeper projects</li><li>Understanding system design trade-offs</li><li>Becoming more confident in interviews</li></ul><p>The biggest lesson was that interviews are not only about solving problems. They are also about explaining your thought process, handling pressure, asking good questions, and showing that you can learn fast.</p><h3>Final Thoughts</h3><p>This backend intern interview experience taught me that consistency matters more than perfection.</p><p>I did not answer everything correctly. I made mistakes. I struggled in some parts. But I stayed honest, explained my thinking, followed up professionally, and kept improving after every rejection.</p><p>Keep building. Keep interviewing. Keep improving.</p><p>One interview can change everything, but the preparation for that interview starts much earlier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f3df344bb59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strong Consistency in Distributed Systems: Raft Algorithm]]></title>
            <link>https://medium.com/@arnavkumargupta777/strong-consistency-in-distributed-systems-raft-algorithm-e366649ffb1e?source=rss-53950c4655f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e366649ffb1e</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Arnav Gupta]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 17:00:22 GMT</pubDate>
            <atom:updated>2026-01-28T17:00:22.738Z</atom:updated>
            <content:encoded><![CDATA[<p>This week, while studying distributed systems, I dived into the <strong>Raft consensus algorithm </strong>and honestly, it left me both excited and slightly shocked. I initially started learning Raft to understand how consensus works in blockchain technologies, but along the way, I discovered something even more fascinating: how Raft enables <strong>strong data consistency in distributed storage systems</strong>.</p><p>That curiosity pushed me to explore Raft beyond blockchains and into real-world distributed data environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMVh38je6fJrBaDbJNQL8Q.jpeg" /></figure><h3>What Is the Raft Algorithm?</h3><p>At its core, Raft is a <strong>consensus algorithm</strong>. Consensus simply means agreement specifically, agreement among multiple nodes in a distributed system about the system’s current state. Also very important to mention that Paxos algorithm is also recommended to study while learning raft as it highlights how easy and practical is raft algorithm.</p><p>Raft was designed to make consensus <strong>easy to understand and implement</strong>, unlike earlier algorithms that were powerful but hard to reason about.</p><p>In a Raft-based system, nodes can take one of three roles:</p><ul><li><strong>Leader- One node per group/shard that propagates the changes.</strong></li><li><strong>Follower- Nodes that follow the leader and make changes to their state.</strong></li><li><strong>Candidate- During elections all nodes are candidate.</strong></li></ul><p>At any given time, there is exactly <strong>one leader</strong> responsible for coordinating the system.</p><h3>Leader, Followers, and Log Replication</h3><p>The leader acts as the central coordinator for the cluster:</p><ul><li>All <strong>write operations</strong> go through the leader.</li><li>When a client sends a request (for example, updating user data, pushing new data), the leader appends this change as a <strong>log entry</strong>.</li><li>The leader then replicates this log entry to its followers. This can be thought of like a propagation stage and here majority of the followers should accept this change.</li></ul><p>A crucial point here is <strong>majority agreement</strong>. Also, the term mostly coined with majority is <strong>Quorum</strong> it is the minimum number of acceptances from the nodes in the group to achieve an agreement. Majority of the distributed environment like blockchain set it up to 51%. Thought it could be set dynamically depending on the number of active nodes in the environment. Note that 51% is an example and raft follows its own method.</p><p>If a <strong>majority of followers</strong> successfully replicate the log entry, the leader commits the change. Only then is the update considered durable and applied to the system state. If a majority is <em>not</em> reached, the change is rolled back.</p><p>This mechanism called <strong>log replication</strong> ensures that all nodes remain on the same page and that the system maintains <strong>strong consistency</strong>, not eventual consistency. Strong consistency has its very important usage in several applications where we need to see absolute data. (Ex-Banking)</p><h3>Heartbeats and Failure Detection</h3><p>Followers continuously stay in touch with the leader using lightweight messages called <strong>heartbeats</strong>. These heartbeats serve two purposes:</p><ol><li>Confirm that the leader is still alive.</li><li>Prevent unnecessary elections.</li></ol><p>If a follower stops receiving heartbeats (even for a few milliseconds), it assumes that the leader has failed. What is does then it announces for an election and all the followers then receive this information and then decide if a re-election is needed.</p><p>At this point, the follower transitions into a <strong>candidate</strong> and starts a new leader election. Every candidate has the opportunity to become a leader at this instance there is no hierarchy everyone is at the same level.</p><h3>Leader Election and Fault Tolerance</h3><p>One concern that immediately comes to mind is:<br> <strong>Doesn’t the leader become a bottleneck or single point of failure?</strong></p><p>Raft addresses this very clearly.</p><ul><li>Elections are triggered using <strong>randomized timeouts</strong>.</li><li>When a majority of nodes agree, a new leader is elected extremely quickly often within milliseconds.</li><li>During this process, all nodes temporarily become candidates, and one emerges as the new leader.</li></ul><p>Because of this fast re-election mechanism, system downtime is minimal. The system is designed with the assumption that <strong>a leader must exist at all times</strong>. When a leader fails the write operations are temporarily unavailable until a new leader is elected.</p><h3>Recovery and Log Synchronization</h3><p>If a follower crashes and later rejoins the cluster, Raft ensures safe recovery:</p><ul><li>The node compares its local logs with the leader’s logs.</li><li>Any missing or outdated entries are replicated.</li><li>The follower eventually catches up to the global state.</li></ul><p>This guarantees that no stale or inconsistent data survives in the system.</p><h3>State Management and Consistency</h3><p>In distributed systems, managing <strong>state</strong> is one of the hardest problems. State can be informally defined as the flow of some process. <br>Raft handles this by:</p><ul><li>Maintaining a <strong>global state</strong> through committed logs.</li><li>Allowing nodes to have <strong>local state</strong>, as long as it eventually matches the global state.</li><li>Ensuring that state transitions are linear and ordered.</li></ul><p>Unlike systems that rely on eventual consistency, Raft enforces consistency <strong>at every step</strong>, making it ideal for systems where correctness is critical.</p><h3>Sharding and Scalability</h3><p>In large-scale systems with millions of nodes, Raft clusters are typically <strong>sharded</strong>. Sharding is a partitioning technique that splits a large database into smaller, faster, and more manageable parts called “shards,” distributing them across multiple servers.</p><p>This leads to an interesting property:</p><ul><li>A node can be a <strong>leader in one shard</strong> and a <strong>follower in another</strong>.</li><li>Roles are dynamic any node can become a leader depending on the shard and election outcome.</li></ul><p>This design allows systems to scale horizontally while preserving strong consistency within each shard.</p><h3>Final Thoughts</h3><p>Raft beautifully balances <strong>simplicity, fault tolerance, and strong consistency</strong>. What impressed me the most is how naturally it handles failures leaders can fail, nodes can crash, networks can partition, yet the system continues to function with minimal disruption.</p><p>For distributed storage systems, databases, and coordination services where correctness matters more than availability, Raft is a powerful and practical choice.</p><p>Learning Raft didn’t just teach me a consensus algorithm it reshaped how I think about distributed systems altogether.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e366649ffb1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merge Islands Game: Design and Analysis of Algorithms]]></title>
            <link>https://medium.com/@arnavkumargupta777/merge-islands-game-design-and-analysis-of-algorithms-0303a537d78d?source=rss-53950c4655f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0303a537d78d</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Arnav Gupta]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 09:20:16 GMT</pubDate>
            <atom:updated>2025-09-14T09:20:16.512Z</atom:updated>
            <content:encoded><![CDATA[<h4>Design a terminal-based game using Disjoint Set Union with path compression</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k41anM25af7nmONQWWka1g.png" /></figure><h3>1. Introduction</h3><p>The Merge Island is one of the applications of Disjoint Set Union data structure also known as union-find. In this blog will be looking at the basic design, implementation, optimizations, time and space complexity of building a two-player merge island game using disjoint set union including path compression. We will also be looking at the implementation from the scratch and look at the code also some game theory at the end. Also, this whole game idea is inspired by the Leetcode problem “200. Number of Islands” and “827. Making a Large Island”.</p><p>The graphs represent important real-world application including graph connections, dynamic relations and optimizations making it a great choice for understanding algorithms.</p><h3>2. Problem Statement</h3><h4>2.1 Game Overview</h4><p><strong>Merge Islands</strong> is a two-player strategy game played on an n×n grid where:</p><ul><li>Players claim the cells alternatively.</li><li>Adjacent cells of the same player merge together into larger island.</li><li>When island of different player becomes adjacent the player with island with larger cell claims it.</li><li>Game runs until there is an island left to capture with only a winner.</li><li>Also, the defensive player has an advantage of early capture if two islands clash the defending player will take the opponent&#39;s island.</li></ul><h4>2.2 Technical Challenge</h4><p>The core algorithmic challenge involves:</p><ul><li>Dynamic Connectivity: At any particular time to answer the question if two island are connected.</li><li>Territory Merging: Efficiently merging the territory in least time possible.</li><li>Size Comparison: To find the size of the island during merging in constant time.</li><li>Updates: Maintain correct data after each move.</li></ul><h3>3. Union-Find Data Structure</h3><h4>3.1 Theoretical Foundation</h4><p>The main situation that leads to the creation of DSU was to answer the question if some node A and node B are connect at any given point of time. The Disjoint Set Union is a data structure with mainly two operations:</p><ul><li>Find(x): Used to find the parent node of x.</li><li>Union (x, y): Merges two nodes x and y.</li><li>Parent: Vector to store the parent of each cell.</li></ul><p>Although other functionality can also be added depending on the problem requirements. For this problem we have maintained a vector to store the size of the cell since so we don’t have to compute it repeatedly causing the time complexity to increase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJ4knWn4b-1qFRN2clkV9Q.png" /><figcaption>Figure of a union operation.</figcaption></figure><h4>3.2 Core Operations</h4><p><strong>3.2.1 Basic Structure</strong></p><p>This is the core structure for the DSU. We have 2 vector parent and size used to track the parent of each node and also the size. Initially the parent of each node will be themselves and their size will be 1.</p><pre>class DSU {<br>private:<br>    vector&lt;int&gt; parent, size;<br>public:<br>    DSU(int n) {<br>        parent.resize(n);<br>        size.resize(n, 1);<br>        for (int i = 0; i &lt; n; i++) parent[i] = i;<br>    }<br>}<br>};</pre><p><strong>3.2.2 Find Operation with Path Compression</strong></p><p>Before path compression, the time complexity for finding the parent of a cell was <strong>O(n)</strong> in the worst case, as we might have to traverse a chain of nodes that could be of length n. We can reduce this complexity by implementing <strong>union by rank/size</strong>, which keeps the tree balanced and reduces the complexity to O (<strong>log n)</strong> per operation, since the maximum depth of a balanced tree is logarithmic.</p><p>However, by implementing <strong>path compression</strong>, we can achieve <strong>O(α(n))</strong> amortized time per operation, where <strong>α(n)</strong> is the inverse Ackermann function. Path compression works by making every node on the path point directly to the ultimate parent (root) during the find operation. This flattens the tree structure and amortizes the cost of future operations. The inverse Ackermann function α(n) grows extremely slowly and is effectively constant for all practical values of n thus we can say that it becomes amortized.</p><pre>  int find(int x) {<br>        if (parent[x] != x)<br>            parent[x] = find(parent[x]);<br>        return parent[x];<br>    }</pre><p><strong>3.2.3 Union by Size</strong></p><p>We always attach the smaller tree as a subtree to the larger ones. It keeps the tree balance and helps to reduce the depth/ height of the tree. Ensures logarithmic operations. We first find the parent of the 2 nodes if they are same, they are already connected. If not, we attach the smaller to the larger.</p><pre>    void unite(int x, int y) {<br>        int px = find(x);<br>        int py = find(y);<br>        if (px == py) return;<br><br>        if (size[px] &lt; size[py]) swap(px, py);<br>        parent[py] = px;<br>        size[px] += size[py];<br>    }</pre><h3>4. Algorithm Design</h3><h4>4.1 Game State Representation</h4><p>Use 2-D vector, unordered map and some extra variable to keep a track of the state of the game.</p><pre>class Game {<br>private:<br>    int n;                                    // Grid size<br>    vector&lt;vector&lt;char&gt;&gt; board;               // Visual representation<br>    DSU dsu;                                  // Connectivity structure  <br>    unordered_map&lt;int, int&gt; componentOwner;   // Territory ownership<br>    int turn;                                 // Current player<br>}</pre><h4><strong>4.2 Core Algorithm: Territory Merging and Capture</strong></h4><p>Below is the detail algorithm for the implementation of the game.</p><pre>ALGORITHM: ProcessMove(row, col, player)<br>INPUT: Position (row, col) and current player<br>OUTPUT: Updated game state with territory changes<br><br>1. PLACE cell at (row, col) for current player<br>2. SET cellId = toId(row, col)<br>3. SET componentOwner[cellId] = player<br>4. <br>5. FOR each adjacent direction (up, down, left, right):<br>6.     IF adjacent cell is valid AND occupied:<br>7.         GET neighborId = toId(adjacent_row, adjacent_col)<br>8.         GET rootA = dsu.find(cellId)<br>9.         GET rootB = dsu.find(neighborId)<br>10.        <br>11.        IF rootA ≠ rootB:  // Different components<br>12.            GET sizeA = dsu.getSize(rootA)<br>13.            GET sizeB = dsu.getSize(rootB)<br>14.            GET ownerA = componentOwner[rootA]<br>15.            GET ownerB = componentOwner[rootB]<br>16.            <br>17.            CALL dsu.unite(cellId, neighborId)<br>18.            GET newRoot = dsu.find(cellId)<br>19.            <br>20.            IF ownerA = ownerB:  // Same player<br>21.                SET componentOwner[newRoot] = ownerA<br>22.            ELSE:  // Territory capture<br>23.                IF sizeA ≥ sizeB:<br>24.                    SET componentOwner[newRoot] = ownerA<br>25.                    PRINT &quot;Player ownerA captures territory&quot;<br>26.                ELSE:<br>27.                    SET componentOwner[newRoot] = ownerB  <br>28.                    PRINT &quot;Player ownerB captures territory&quot;<br>29. <br>30. SWITCH to next player</pre><h4>4.3 Islands Capture Mechanics</h4><p>The capture islands follow the rule: the larger island always captures the smaller one to its adjacent.</p><p>Some key details:</p><ul><li>Size comparison before merging to preserve the original size</li><li>Ownership is transferred after the merging</li><li>New updated list of islands is displayed.</li></ul><h3>5. Implementation Details</h3><h4>5.1 Optimization Techniques</h4><h4>5.1.1 Path Compression Analysis</h4><p><strong>Benefits:</strong></p><ul><li>Reduces tree height from O(n) to nearly O (1) amortized</li><li>Subsequent find operations become extremely fast</li><li>No additional space overhead</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*WPmShwqdu0hFOjyebG8Vow.png" /><figcaption>Path compression visualization</figcaption></figure><h4>5.1.2 Union by Size vs Union by Rank</h4><p>Here we have implemented union by size for our game due to its direct involvement in our game algorithm.</p><h4><strong>5.2 Memory Management</strong></h4><p>Space Complexity Analysis:</p><ul><li>Total Space O(n²) for n* n grid parent and size storage.</li><li>A map that grows dynamically during the game.</li></ul><pre>// Efficient representation<br>vector&lt;int&gt; parent(n*n);     // O(n²) space<br>vector&lt;int&gt; size(n*n);       // O(n²) space  <br>unordered_map&lt;int, int&gt; componentOwner;  </pre><h3>6. Complexity Analysis</h3><h4>6.1 Individual Operations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*tZYAH1caqFXmJUCrqe1aow.png" /></figure><p>Where α(n) is the <strong>inverse Ackermann function</strong> is an <strong>extremely slow-growing function. It is almost constant for all values of n.</strong></p><h4>6.2 Game Operation Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*lcPtB383KzrgM6aeidf11Q.png" /><figcaption>Detailed complexity</figcaption></figure><h3>7.Code Snippets</h3><p>This function below serves the main logic for the game. The main game function can be coded easy after understanding this function also can be customized according to the requirement.</p><pre> void checkAndMerge(int r, int c, char playerChar) {<br>        vector&lt;pair&lt;int, int&gt;&gt; dirs = {{0,1},{1,0},{0,-1},{-1,0}};<br>        int id = toId(r, c);<br>        int currentOwner = turn;<br>        componentOwner[dsu.find(id)] = currentOwner;<br><br>        // Check all adjacent cells<br>        for (auto dir : dirs) {<br>            int nr = r + dir.first, nc = c + dir.second;<br>            if (nr &lt; 0 || nr &gt;= n || nc &lt; 0 || nc &gt;= n) continue;<br>            if (board[nr][nc] == &#39;.&#39;) continue;<br><br>            int neighborId = toId(nr, nc);<br>            int rootA = dsu.find(id);<br>            int rootB = dsu.find(neighborId);<br><br>            if (rootA == rootB) continue; // Already in same component<br><br>            int ownerA = componentOwner[rootA];<br>            int ownerB = componentOwner[rootB];<br><br>            // Get sizes before union<br>            int sizeA = dsu.getSize(rootA);<br>            int sizeB = dsu.getSize(rootB);<br><br>            // Unite the components<br>            dsu.unite(id, neighborId);<br>            int newRoot = dsu.find(id);<br><br>            // Determine new owner based on territory capture rules<br>            if (ownerA == ownerB) {<br>                // Same owner - just merge normally<br>                componentOwner[newRoot] = ownerA;<br>            } else {<br>                // Different owners - larger territory captures smaller<br>                if (sizeA &gt;= sizeB) {<br>                    componentOwner[newRoot] = ownerA;<br>                    cout &lt;&lt; &quot;\n Player &quot; &lt;&lt; ownerA &lt;&lt; &quot; captures Player &quot; &lt;&lt; ownerB &lt;&lt; &quot;&#39;s territory! (Size &quot; &lt;&lt; sizeA &lt;&lt; &quot; vs &quot; &lt;&lt; sizeB &lt;&lt; &quot;)\n&quot;;<br>                } else {<br>                    componentOwner[newRoot] = ownerB;<br>                    cout &lt;&lt; &quot;\n Player &quot; &lt;&lt; ownerB &lt;&lt; &quot; captures Player &quot; &lt;&lt; ownerA &lt;&lt; &quot;&#39;s territory! (Size &quot; &lt;&lt; sizeB &lt;&lt; &quot; vs &quot; &lt;&lt; sizeA &lt;&lt; &quot;)\n&quot;;<br>                }<br>            }<br>        }<br>    }</pre><h3>8.Output Snippet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*lsqbbtY-eXahtibdHNiwmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*yt9lqvLK2dIacBsVllI8HQ.png" /></figure><h3>9. Conclusion</h3><h4>9.1 Key Findings</h4><ol><li><strong>Algorithmic Efficiency</strong>: Path compression and union by size reduce operation complexity from O(n) to O(α(n)), making the game responsive even on large grids.</li><li><strong>Practical Performance</strong>: The inverse Ackermann function α(n) is effectively constant for all realistic input sizes, providing near-optimal performance.</li><li><strong>Design Elegance</strong>: The DSU structure naturally models the game’s territory merging mechanics, leading to clean and maintainable code.</li><li><strong>Strategic Depth</strong>: Efficient algorithms enable complex strategic analysis while maintaining real-time gameplay.</li></ol><h4>9.2 Applications Beyond Gaming</h4><p>The techniques demonstrated in Merge Islands apply to numerous domains:</p><ul><li><strong>Network Connectivity</strong>: Tracking connected components in dynamic networks</li><li><strong>Image Processing</strong>: Connected component labeling in computer vision</li><li><strong>Social Networks</strong>: Community detection and relationship tracking</li><li><strong>Compiler Design</strong>: Live variable analysis and register allocation</li></ul><h3>10.References</h3><p>Some articles to better understand Disjoint Union set and some questions to improve the implementation of algorithm.</p><ul><li><a href="https://www.gabrielnivasch.org/fun/inverse-ackermann">Gabriel Nivasch — Inverse Ackermann</a></li><li><a href="https://www.geeksforgeeks.org/dsa/introduction-to-disjoint-set-data-structure-or-union-find-algorithm/">https://www.geeksforgeeks.org/dsa/introduction-to-disjoint-set-data-structure-or-union-find-algorithm/</a></li><li><a href="https://leetcode.com/problems/making-a-large-island/description/">Making A Large Island — LeetCode</a></li><li><a href="https://leetcode.com/problems/number-of-islands/description/">Number of Islands — LeetCode</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0303a537d78d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>