<?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 Laksh Purbey on Medium]]></title>
        <description><![CDATA[Stories by Laksh Purbey on Medium]]></description>
        <link>https://medium.com/@themobilearchitects?source=rss-cacac592abb9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0sOVLQ2zwZpQhGGJX8nslQ.jpeg</url>
            <title>Stories by Laksh Purbey on Medium</title>
            <link>https://medium.com/@themobilearchitects?source=rss-cacac592abb9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:38:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@themobilearchitects/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[Swift Concurrency: 7 Mistakes Every iOS Developer Makes (and How to Avoid Them)]]></title>
            <link>https://medium.com/@themobilearchitects/swift-concurrency-7-mistakes-every-ios-developer-makes-and-how-to-avoid-them-21cedd20faa8?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/21cedd20faa8</guid>
            <category><![CDATA[concurrency]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 03:30:41 GMT</pubDate>
            <atom:updated>2026-08-07T03:30:41.639Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Swift’s <strong>async/await</strong> transformed asynchronous programming in iOS.</p><p>Gone are the days of deeply nested completion handlers and callback pyramids.</p><p>The code is cleaner.<br>The intent is clearer.<br>The compiler catches more mistakes.</p><p>Yet…</p><p>After reviewing production applications, leading mobile teams, and migrating large codebases from Combine and completion handlers, I noticed something interesting.</p><p>The most expensive concurrency bugs aren’t compiler errors.</p><p>They’re <strong>logic errors.</strong></p><p>These bugs don’t always crash your application.</p><p>Instead, they quietly create problems like:</p><ul><li>Duplicate network requests</li><li>Stale UI updates</li><li>Race conditions</li><li>Memory leaks</li><li>Random bugs that QA can’t reproduce</li><li>Battery drain</li><li>Performance degradation</li></ul><p>The compiler cannot protect you from poor concurrency design.</p><p>Understanding <strong>how Swift Concurrency actually works</strong> is far more important than simply learning the syntax.</p><p>Let’s explore the seven mistakes I encounter most frequently in production applications.</p><h3>Understanding Structured Concurrency</h3><p>Before jumping into mistakes, it’s important to understand Swift’s mental model.</p><p>Swift Concurrency revolves around four core concepts:</p><p>Task</p><p>├── async function</p><p>├── await suspension</p><p>└── returns value</p><p>Tasks represent units of asynchronous work.</p><p>When a task suspends at await, the underlying thread becomes free to execute other work.</p><p>That means:</p><p>async/await is <strong>not</strong> about creating more threads.</p><p>It’s about efficiently scheduling work.</p><h3>1. Fire-and-Forget Tasks</h3><h3>The Problem</h3><p>Many developers write:</p><p>Task {</p><p>await loadProfile()</p><p>}</p><p>It looks harmless.</p><p>Unfortunately, you’ve now created an <strong>unstructured task</strong>.</p><p>Nobody owns it.</p><p>Nobody can cancel it.</p><p>Nobody knows whether it finished.</p><p>If the user leaves the screen…</p><p>The task continues running.</p><h3>Why It’s Dangerous</h3><p>Imagine a Profile screen.</p><p>User opens Profile</p><p>↓</p><p>Task starts downloading profile</p><p>↓</p><p>User closes screen</p><p>↓</p><p>Download continues anyway</p><p>↓</p><p>Memory used unnecessarily</p><p>↓</p><p>Even worse…</p><p>If another Profile screen opens,</p><p>you now have <strong>two downloads</strong> happening simultaneously.</p><h3>❌ Bad Example</h3><p>class ProfileViewModel {</p><p>func load() {</p><p>Task {</p><p>await fetchProfile()</p><p>} } }</p><p>Every call creates a brand new task.</p><h3>✅ Better</h3><p>class ProfileViewModel {</p><p>private var profileTask: Task&lt;Void, Never&gt;?</p><p>func load() {</p><p>profileTask?.cancel()</p><p>profileTask = Task {</p><p>await fetchProfile()</p><p>} }</p><p>deinit {</p><p>profileTask?.cancel()</p><p>} }</p><p>Now:</p><ul><li>only one task exists</li><li>previous work is cancelled</li><li>lifecycle is managed</li></ul><h3>Architecture Tip</h3><p>Every long-running task should answer one question:</p><p><strong>Who owns this task?</strong></p><p>If the answer is “Nobody,” that’s usually a design smell.</p><h3>Visual Flow</h3><h3>2. Ignoring Cancellation</h3><p>One of the biggest misconceptions:</p><p>task.cancel()</p><p>does <strong>NOT</strong> stop execution immediately.</p><p>Swift cancellation is <strong>cooperative</strong>.</p><p>That means your code must voluntarily stop.</p><h3>Example</h3><p>let task = Task {</p><p>let image = try await downloadImage()</p><p>process(image)</p><p>}</p><p>Calling</p><p>task.cancel()</p><p>doesn’t magically terminate the task.</p><p>Execution continues unless cancellation is checked.</p><h3>Correct Approach</h3><p>let task = Task {</p><p>let image = try await downloadImage()</p><p>try Task.checkCancellation()</p><p>process(image)</p><p>}</p><h3>When Should You Check?</h3><p>Always after expensive work.</p><p>For example:</p><p>API Request</p><p>↓</p><p>Check Cancellation</p><p>↓</p><p>JSON Parsing</p><p>↓</p><p>Check Cancellation</p><p>↓</p><p>Image Processing</p><p>↓</p><p>Check Cancellation</p><p>↓</p><p>Update UI</p><h3>Practical Example</h3><p>func search(query: String) async throws -&gt; [Product] {</p><p>let products = try await api.search(query)</p><p>try Task.checkCancellation()</p><p>return products</p><p>}</p><p>This prevents stale search results.</p><h3>3. Updating UI from Background Threads</h3><p>UIKit and SwiftUI expect UI updates on the Main Actor.</p><p>Ignoring this leads to random UI behaviour.</p><h3>❌ Bad</h3><p>let image = await loadImage()</p><p>imageView.image = image</p><p>Depending on execution context,</p><p>this may not be on the Main Actor.</p><h3>✅ Better</h3><p>await MainActor.run {</p><p>imageView.image = image</p><p>}</p><p>Or simply:</p><p>@MainActor</p><p>class ProfileViewModel {</p><p>}</p><p>Now every UI operation is automatically isolated.</p><h3>Why MainActor Exists</h3><p>Background Task</p><p>↓</p><p>Download Data</p><p>↓</p><p>Switch to MainActor</p><p>↓</p><p>Update UI</p><p>Simple.</p><p>Predictable.</p><p>Safe.</p><h3>4. Creating Too Many Tasks</h3><p>This is surprisingly common.</p><p>for photo in photos {</p><p>Task {</p><p>await upload(photo)</p><p>} }</p><p>Looks fine.</p><p>Until…</p><p>500 Photos</p><p>↓</p><p>500 Tasks</p><p>↓</p><p>500 Uploads</p><p>↓</p><p>High CPU</p><p>↓</p><p>Battery Drain</p><p>↓</p><p>Poor User Experience</p><h3>Better Solution</h3><p>await withTaskGroup(of: Void.self) { group in</p><p>for photo in photos {</p><p>group.addTask {</p><p>await upload(photo)</p><p>} } }</p><p>Task groups provide structured concurrency and coordinated completion. If you need to <em>limit</em> concurrency (for example, only 4–8 uploads at a time), combine task groups with a semaphore-like actor or an async channel rather than launching hundreds of tasks at once.</p><h3>5. Forgetting Actor Isolation</h3><p>Shared mutable state is one of the oldest concurrency problems.</p><p>Imagine multiple tasks writing to the same dictionary.</p><p>cache[url] = image</p><p>At the same time:</p><p>Task A</p><p>writes cache</p><p>↓</p><p>Task B</p><p>writes cache</p><p>↓</p><p>Race Condition</p><h3>Solution</h3><p>actor ImageCache {</p><p>private var cache = [String: UIImage]()</p><p>func save(_ image: UIImage,</p><p>for key: String) {</p><p>cache[key] = image</p><p>} }</p><p>Actors guarantee only one task accesses the actor’s isolated state at a time, greatly reducing data races without manual locking.</p><h3>6. Capturing self Incorrectly</h3><p>Consider this:</p><p>Task {</p><p>self.loadData()</p><p>}</p><p>The task strongly captures self.</p><p>If the task is stored or long-lived, this can unintentionally keep the object alive.</p><h3>Better</h3><p>Task { [weak self] in</p><p>await self?.loadData()</p><p>}</p><p>However, this is <strong>not</strong> a universal rule.</p><p>If the task is structured and intentionally tied to the lifetime of self, a strong capture can be perfectly acceptable. Use [weak self] when the task may outlive the object or when retaining the object is undesirable.</p><h3>7. Thinking async/await Solves Everything</h3><p>This is the biggest misconception.</p><p>Developers often think:</p><p>“I migrated to async/await, therefore my app is thread-safe.”</p><p>Not true.</p><p>async/await improves <strong>syntax</strong>.</p><p>It does not automatically solve:</p><ul><li>duplicate requests</li><li>caching</li><li>race conditions</li><li>architecture</li><li>state management</li></ul><p>Good architecture still matters.</p><h3>Before</h3><p>Completion Handler Hell</p><p>↓</p><p>Nested Closures</p><p>↓</p><p>Difficult to Read</p><h3>After</h3><p>Structured Concurrency</p><p>↓</p><p>Cleaner Code</p><p>↓</p><p>Same Design Problems (if architecture is poor)</p><h3>Best Practices Checklist</h3><p>✅ Own every long-running Task</p><p>✅ Always support cancellation</p><p>✅ Check cancellation after expensive operations</p><p>✅ Use MainActor for UI</p><p>✅ Avoid launching hundreds of tasks</p><p>✅ Protect shared state with actors</p><p>✅ Understand task lifetime and object ownership</p><p>✅ Prefer structured concurrency over detached work</p><h3>Conclusion</h3><p>Swift Concurrency isn’t just a new syntax.</p><p>It’s a new way of thinking.</p><p>Once you understand:</p><ul><li>Task ownership</li><li>Structured concurrency</li><li>Cancellation</li><li>Actor isolation</li><li>MainActor</li><li>Task groups</li></ul><p>you’ll write applications that are:</p><ul><li>Faster</li><li>Safer</li><li>More scalable</li><li>Easier to maintain</li><li>More battery efficient</li></ul><p>The compiler can help enforce many concurrency rules — but great concurrent software still comes from thoughtful architecture and understanding how tasks interact over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YER77Gd5jlVHnakOk2q3WA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21cedd20faa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing a Social Media Feed at Scale: A Complete HLD + LLD Breakdown (Instagram-Style)]]></title>
            <link>https://medium.com/@themobilearchitects/designing-a-social-media-feed-at-scale-a-complete-hld-lld-breakdown-instagram-style-e93d19a15a3c?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e93d19a15a3c</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[engineering-leadership]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sat, 23 May 2026 12:22:14 GMT</pubDate>
            <atom:updated>2026-05-23T12:22:14.521Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>How do 500 million users get a personalized, sub-200ms feed every time they open the app? The answer lies in a carefully layered architecture — one tradeoff at a time.</blockquote><p>If you’ve ever opened Instagram, scrolled through posts from a hundred people you follow, and had it load in under a second, you’ve experienced one of the most complex distributed systems problems in modern software engineering.</p><p>Designing a social media feed isn’t just about fetching posts. It’s about <strong>pre-computation vs. real-time reads</strong>, <strong>cache invalidation strategies</strong>, <strong>celebrity user edge cases</strong>, <strong>media transcoding pipelines</strong>, and <strong>ranking algorithms</strong> — all stitched together under strict latency budgets.</p><p>In this article, we’ll go end-to-end: from high-level component architecture (HLD) down to schemas, algorithms, and API contracts (LLD). Whether you’re preparing for a system design interview or architecting a real product, this is the full picture.</p><h3>Setting the Stage: Requirements</h3><p>Before drawing boxes and arrows, we anchor on what we’re actually building.</p><h3>Functional Requirements</h3><ul><li>Users can create posts (images, videos, text)</li><li>Users can follow and unfollow other users</li><li>Users see a personalized feed of posts from accounts they follow</li><li>Feed supports engagement: likes, comments, shares</li><li>Posts appear in near real-time (within seconds of publishing)</li></ul><h3>Non-Functional Requirements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nRc4ddDRRnwpwJrRzrKYw.png" /></figure><h3>Part 1: High-Level Design (HLD)</h3><h3>The Core Architectural Components</h3><p>At its highest level, the system breaks into five domains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyL1c3rKk5nSwEeWJ6WMfQ.png" /></figure><p>Each service owns a single responsibility and communicates asynchronously through Kafka. This decoupling is what allows teams to scale, deploy, and fail independently.</p><h3>The Central Design Decision: How Do You Generate the Feed?</h3><p>This is the most consequential architectural choice in the entire system. There are three strategies:</p><h4>Strategy 1 — Push (Fan-out on Write)</h4><p>When User A posts, you immediately push that post into the feed list of every single follower. When User B opens the app, their feed is pre-computed and ready in Redis — just read and return.</p><p><strong>Pros:</strong> Extremely low read latency. Feed loads are just Redis lookups.</p><p><strong>Cons:</strong> If User A has 10 million followers, a single post triggers 10 million write operations. This is called <strong>write amplification</strong>, and it’s catastrophic at celebrity scale.</p><h4>Strategy 2 — Pull (Fan-out on Read)</h4><p>When User B opens the app, you dynamically fetch the latest posts from everyone they follow, merge the results, sort by score, and return the feed.</p><p><strong>Pros:</strong> No write amplification. Celebrities cost nothing extra on write.</p><p><strong>Cons:</strong> This is expensive at read time. At 50B reads/day, doing N database queries per read would melt your infrastructure.</p><h4>Strategy 3 — Hybrid (The Production Reality)</h4><p>Use <strong>push for regular users</strong> and <strong>pull for celebrities</strong>. Define a follower threshold (e.g., 1 million followers). Below the threshold, fan out on write. Above it, skip push and pull their posts at read time, merging with the pre-computed feed.</p><p><strong>This is what Instagram, Twitter, and most large-scale social platforms use.</strong> It’s more complex to implement, but it’s the only approach that works at true scale.</p><h3>Storage Architecture</h3><p>Different data access patterns require different storage engines:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEXKYrAOHwMeidBlOo_8nw.png" /></figure><p><strong>Key insight:</strong> There is no single database that can do all of this well. Polyglot persistence — using the right tool for the right job — is a hallmark of mature distributed systems.</p><h3>The Media Pipeline</h3><p>Every photo or video upload triggers a multi-step async pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*md5dB-ynxtCqsHkDHSKS9g.png" /></figure><p>This entire pipeline is async. The user gets a “processing” state, and the post becomes visible only once transcoding is complete. This is why you sometimes see “Video processing…” on newly uploaded reels.</p><h3>Part 2: Low-Level Design (LLD)</h3><p>Now we go deeper — into schemas, algorithms, API contracts, and the exact mechanics of how data flows.</p><h3>Data Model — Cassandra Schemas</h3><p>Cassandra’s data model must be designed around access patterns, not normalization.</p><pre>-- Posts table: partition by user_id, cluster by time descending<br>CREATE TABLE posts (<br>  post_id      UUID,<br>  user_id      UUID,<br>  media_url    TEXT,<br>  caption      TEXT,<br>  created_at   TIMESTAMP,<br>  like_count   COUNTER,<br>  comment_count COUNTER,<br>  PRIMARY KEY (user_id, created_at, post_id)<br>) WITH CLUSTERING ORDER BY (created_at DESC);</pre><pre>-- Pre-computed feed per user<br>CREATE TABLE user_feed (<br>  user_id      UUID,<br>  post_id      UUID,<br>  score        FLOAT,<br>  author_id    UUID,<br>  created_at   TIMESTAMP,<br>  PRIMARY KEY (user_id, score, post_id)<br>) WITH CLUSTERING ORDER BY (score DESC);</pre><pre>-- Follow relationships (adjacency list)<br>CREATE TABLE user_follows (<br>  follower_id  UUID,<br>  followee_id  UUID,<br>  followed_at  TIMESTAMP,<br>  PRIMARY KEY (follower_id, followee_id)<br>);</pre><p><strong>Why time-bucketed keys?</strong> Partitioning user_id alone would create unbounded &quot;hot&quot; partitions for prolific posters. In production, you&#39;d add a time bucket (e.g., year_month) to the partition key to keep partition sizes manageable.</p><h3>Feed Write Path — Step by Step</h3><p>Here’s exactly what happens when User A creates a post:</p><ol><li><strong>Post Service</strong> validates input, assigns a UUID, and saves to Cassandra</li><li><strong>Post Service</strong> publishes a post.created event to Kafka</li><li><strong>Feed Generator Worker</strong> consumes the Kafka event</li><li><strong>Graph Service</strong> returns the list of User A’s followers</li><li>For each follower:</li></ol><ul><li>Compute ranking score (see Ranking section)</li><li>Execute LPUSH feed:{follower_user_id} {post_id} in Redis</li><li>Execute LTRIM feed:{follower_user_id} 0 999 — keep only top 1,000 entries</li></ul><ol><li>If User A has &gt; 1M followers: skip steps 5–6, mark post for lazy pull</li><li><strong>The Notification Service</strong> reads from Kafka and delivers push notifications asynchronously</li></ol><p>The key insight is that steps 5–7 are all <strong>fire-and-forget</strong>. The user gets a response immediately after step 1–2. Feed distribution happens in the background.</p><h3>Feed Read Path — Step by Step</h3><p>Here’s what happens when User B opens the app:</p><pre>GET /v1/feed?user_id=B&amp;limit=20&amp;cursor=&lt;pagination_token&gt;</pre><ol><li><strong>Feed Service</strong> checks Redis key feed:{B} (the pre-computed list)</li><li><strong>Cache HIT:</strong></li></ol><ul><li>Fetch top 20 post_ids from Redis using LRANGE</li><li>Batch-fetch post metadata from Cassandra (SELECT WHERE post_id IN (...))</li><li>Enrich with author profile data from User Service</li><li>Sort by score, apply cursor-based pagination</li><li>Return response</li></ul><ol><li><strong>Cache MISS (cold start, new user, or stale TTL):</strong></li></ol><ul><li>Fetch User B’s following list from Graph Service</li><li>If any followed accounts are “celebrities” (&gt;1M followers): fetch their latest posts directly</li><li>Merge all posts, compute scores, sort</li><li>Store result in Redis with TTL = 10 minutes</li><li>Return response</li></ul><p><strong>Performance target:</strong> Cache HIT path should complete in &lt; 50ms. Cache MISS path may take up to 300ms, but is rare for active users.</p><h3>The Ranking Algorithm</h3><p>A naive chronological feed is easy to build but terrible for engagement. Here’s a simplified scoring function:</p><pre>def compute_ranking_score(post, viewer):<br>    # Recency: exponential decay with 6-hour half-life<br>    hours_elapsed = (now() - post.created_at).total_seconds() / 3600<br>    recency_score = math.exp(-0.693 * hours_elapsed / 6)</pre><pre>    # Engagement: logarithmic (avoids runaway viral amplification)<br>    engagement_score = (<br>        math.log(post.like_count + 1) +<br>        math.log(post.comment_count * 2 + 1) + #comments weighted 2x<br>        math.log(post.share_count * 3 + 1)   #shares weighted 3x<br>    )</pre><pre>    # Affinity: how often viewer interacts with this author<br>    affinity_score = viewer.interaction_history.get(post.author_id, 0.0)</pre><pre>    # Media type boost<br>    media_boost = 1.2 if post.media_type == &quot;video&quot; else 1.0</pre><pre>    return (<br>        0.40 * recency_score +<br>        0.30 * engagement_score +<br>        0.20 * affinity_score +<br>        0.10 * random.uniform(0.9, 1.1)  # small randomness for discovery<br>    ) * media_boost</pre><p>At scale, this heuristic function is replaced by a <strong>two-tower neural network</strong>: one tower encodes the user’s interest history, another encodes post features, and their dot product produces a relevance score. The retrieval phase uses approximate nearest neighbor search (ANN) to efficiently find candidate posts from billions of options.</p><h3>Like Counter at Scale — A Subtle Bottleneck</h3><p>Naive implementation: every like hits the database with UPDATE posts SET like_count = like_count + 1.</p><p>At scale, a viral post receiving thousands of likes per second creates a <strong>write hotspot</strong> that degrades the entire database cluster. The solution is a write-back cache with batching:</p><pre>User likes Post P<br>    ↓<br>Redis: INCR like_counter:{post_id}<br>    ↓<br>Kafka: publish { event: &quot;like.created&quot;, user_id: X, post_id: P }</pre><pre>Background flush job (runs every 30 seconds):<br>    ↓<br>Read Redis counters for all active posts<br>    ↓<br>Batch UPDATE Cassandra (single write per post, not per like)<br>    ↓<br>Reset Redis counters (atomic: read + delete)</pre><pre>Deduplication:<br>    ↓<br>Bloom filter per post: &quot;Has user X already liked post P?&quot;<br>    ↓<br>Prevents double-counting even under retry storms</pre><p>This reduces database writes from O(likes) to O(distinct_posts_liked_in_30s) — typically a 100x–1000x reduction.</p><h3>API Design</h3><p>All APIs are RESTful, versioned, idempotent, and authenticated via JWT + OAuth 2.0.</p><pre>POST   /v1/posts                           Create a post<br>GET    /v1/feed?cursor=&amp;limit=             Get paginated feed<br>POST   /v1/posts/{id}/like                 Like a post<br>DELETE /v1/posts/{id}/like                 Unlike a post<br>POST   /v1/users/{id}/follow               Follow a user<br>DELETE /v1/users/{id}/follow               Unfollow a user<br>GET    /v1/posts/{id}/comments?cursor=     Get paginated comments<br>POST   /v1/posts/{id}/comments             Add a comment<br>GET    /v1/users/{id}/posts?cursor=        Get a user&#39;s posts</pre><p><strong>Cursor-based pagination</strong> is used instead of offset-based (?page=2) because:</p><ul><li>Offset pagination breaks when new items are inserted (you skip or duplicate rows)</li><li>Cursors encode a stable position (timestamp + ID) that works correctly in real-time feeds</li></ul><h3>Scalability Tactics — Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdJ5JxY89xZDt365WCswxw.png" /></figure><h3>The Engineering Principles at Work</h3><p>Looking at the full design, five principles show up repeatedly:</p><p><strong>1. Separate read and write paths.</strong> The write path (post creation, fan-out) and read path (feed retrieval) are built independently and can scale independently.</p><p><strong>2. Event-driven architecture.</strong> Kafka sits at the center of the system. Every major action — post created, user followed, like recorded — is an event. Services subscribe to what they care about. This creates loose coupling and a built-in audit log.</p><p><strong>3. Cache as the primary read path.</strong> Redis isn’t just a performance optimization — it <em>is</em> the feed data store for read traffic. The database is authoritative, but clients rarely touch it directly.</p><p><strong>4. Async everywhere.</strong> Fan-out, media transcoding, push notifications, and counter flushing — none of these block the user’s request. They happen in the background, after a 200 OK is already returned.</p><p><strong>5. Graceful degradation over hard failure.</strong> If the Feed Generator falls behind, users see a slightly stale feed — not an error page. If the Ranking Service is slow, fall back to chronological order. Design for partial failure, not just success.</p><h3>The Leadership Perspective: Architecture is Organizational</h3><p>Here’s what doesn’t appear in system design diagrams but matters enormously in practice:</p><p><strong>The hybrid fan-out strategy requires dedicated ownership.</strong> You need a team that understands the celebrity threshold, monitors write amplification, and tunes the cutoff as your user base evolves. If you don’t have that bandwidth, a simpler pull-on-read model with aggressive caching is defensible.</p><p><strong>Cassandra requires operational expertise.</strong> It’s extraordinarily powerful for this use case, but tuning compaction, managing partition sizes, and handling cluster failures requires skilled operators. If your team is small, start with PostgreSQL and migrate later.</p><p><strong>Kafka is infrastructure, not just a queue.</strong> Treat it like a database. Design your topics, retention policies, and consumer groups with the same care you’d give a schema.</p><p>The best architecture is the one your team can <strong>build, operate, and evolve</strong>. A theoretically perfect design that your team can’t maintain is a liability, not an asset.</p><h3>Conclusion</h3><p>Designing a social media feed at scale is fundamentally an exercise in tradeoffs:</p><ul><li><strong>Push vs. Pull</strong> — write simplicity vs. read simplicity</li><li><strong>Freshness vs. Latency</strong> — real-time accuracy vs. pre-computed speed</li><li><strong>Complexity vs. Maintainability</strong> — optimal performance vs. team capacity</li></ul><p>The architecture we’ve walked through — hybrid fan-out, Redis-first reads, Cassandra for durability, Kafka for event propagation, async processing everywhere — is battle-tested at companies like Instagram, Twitter, and LinkedIn.</p><p>But no architecture is universal. The right design depends on your traffic patterns, your team’s strengths, and the specific tradeoffs your product can tolerate.</p><p><strong>What would you change?</strong> If you’ve built or operated a feed system at scale, I’d love to hear where reality diverged from the textbook. Drop a comment below.</p><p><em>If you found this useful, follow for more deep-dives into distributed systems, mobile backend architecture, and engineering leadership.</em></p><p>#SystemDesign #SoftwareArchitecture #DistributedSystems #BackendEngineering #HLD #LLD #Instagram #ScalableArchitecture#EngineeringLeadership #TechLeadership</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5x5IhuW_9YODzOi-oIYmIw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e93d19a15a3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS In-App Purchase: The Complete Production Flow (Beyond the Buy Button)]]></title>
            <link>https://medium.com/@themobilearchitects/ios-in-app-purchase-the-complete-production-flow-beyond-the-buy-button-c421d87b2f4a?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c421d87b2f4a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[in-app-purchase]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sat, 02 May 2026 05:12:40 GMT</pubDate>
            <atom:updated>2026-05-02T05:12:40.280Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Most tutorials stop at </em>“user taps buy”<em> <br>Real apps? They need a full monetization pipeline</em></blockquote><p>If you’ve ever implemented In-App Purchases (IAP) in an iOS app, you already know the truth:</p><p><strong>It’s not just a button.</strong></p><p>It’s payments, backend validation, edge cases, state management, and user trust — all stitched together into one critical system.</p><p>This guide walks you through the <strong>real, production-ready IAP flow</strong> — the one you actually need in shipping apps.</p><h3>The Big Picture</h3><p>Before diving in, here’s the full pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*5ctwBUrosmaA6RP8" /></figure><p><strong>Flow:</strong></p><ol><li>Apple Developer setup</li><li>Xcode configuration</li><li>App Store product setup</li><li>StoreKit integration</li><li>Purchase flow</li><li>Validation (device/server)</li><li>Unlock + persistence</li><li>Restore purchases</li><li>Testing (Sandbox)</li><li>Production release</li></ol><h3>1. Apple Developer Setup (Foundation First)</h3><p>Everything starts here.</p><p>You’ll need:</p><ul><li>App ID with <strong>In-App Purchase capability enabled</strong></li><li>Valid certificates &amp; provisioning profiles</li></ul><p>Common mistake: forgetting to enable IAP capability = <strong>products won’t load later</strong></p><h3>2. Xcode Configuration</h3><p>Inside your project:</p><ul><li>Enable <strong>In-App Purchase capability</strong></li><li>Ensure <strong>Bundle ID matches App Store Connect</strong></li><li>Add StoreKit framework (if not using StoreKit 2 implicitly)</li></ul><pre>import StoreKit</pre><h3>3. Create Products in App Store Connect</h3><p>This is where monetization actually lives.</p><h3>Types of Products:</h3><ul><li><strong>Consumable</strong> → coins, credits</li><li><strong>Non-consumable</strong> → lifetime unlock</li><li><strong>Auto-renewable subscriptions</strong> → premium plans</li></ul><h3>Required Setup:</h3><ul><li>Product ID (used in code)</li><li>Pricing tier</li><li>Localization</li><li>Subscription groups (for subscriptions)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*oEjCBxot5Ecb1Bvn" /></figure><p>💡 <strong>Pro Tip:</strong><br>Never hardcode product details in the app — fetch dynamically.</p><h3>4. Local Testing with StoreKit Config</h3><p>Skip backend. Skip network.</p><p>Use .storekit file in Xcode:</p><ul><li>Simulate products locally</li><li>Test purchase flows instantly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*O85ELcA3R6KnXZUA" /></figure><p>This is <strong>massively underrated</strong> for fast iteration.</p><h3>5. Fetch Products (Dynamic UI)</h3><h3>StoreKit 2 (Recommended):</h3><pre>let products = try await Product.products(for: [&quot;com.app.premium&quot;])</pre><p>Display products dynamically in UI.</p><p>Why this matters:</p><ul><li>Pricing changes don’t require app updates</li><li>Localization handled automatically</li></ul><h3>6. Purchase Flow</h3><p>When the user taps <strong>Buy</strong>:</p><ol><li>Call purchase API</li><li>Apple shows a payment sheet</li><li>The transaction result comes back</li></ol><pre>let result = try await product.purchase()</pre><h3>Possible outcomes:</h3><ul><li>Success ✅</li><li>User cancelled ❌</li><li>Pending ⏳ (Ask to Buy, etc.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*x1EmCKT7Lnb3d7rD" /></figure><h3>7. Validation &amp; Unlock (Critical Step)</h3><p>This is where many apps go wrong.</p><h3>Two approaches:</h3><h4>Option A: On-device validation</h4><ul><li>Quick</li><li>Less secure</li></ul><h4>Option B: Server-side validation (Recommended)</h4><ul><li>Send receipt to backend</li><li>Validate with Apple servers</li><li>Return entitlement</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*qxeHCA7rbcHVr7dC" /></figure><p>💡 <strong>Golden Rule:</strong></p><blockquote><em>Never trust the client.</em></blockquote><h3>Unlock Logic</h3><p>After validation:</p><h4>Enable feature</h4><h4>Store state:</h4><ul><li>UserDefaults (basic)</li><li>Keychain (secure)</li><li>Backend (best)</li></ul><h3>8. Restore Purchases</h3><p>Required for:</p><ul><li>Reinstall</li><li>New device</li><li>Logged-in users</li></ul><pre>try await AppStore.sync()</pre><p>Always provide a <strong>Restore Purchases</strong> button.</p><h3>9. Sandbox Testing</h3><p>Before production:</p><ul><li>Create Sandbox Apple ID</li><li>Test purchases without real money</li><li>Subscriptions renew faster (minutes instead of months)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*jjSfQR7chtxLGThs" /></figure><p>Expect weird behaviors. Sandbox is not perfect.</p><h3>10. Production Release</h3><p>Final steps:</p><ul><li>Submit the app for review</li><li>Apple tests IAP flow</li><li>Products go live</li></ul><p>Now you’re handling real payments.</p><h3>Real-World Lessons (From Production Apps)</h3><h3>1. Always Validate on Backend</h3><p>Client-side validation = easy to hack</p><h3>2. Handle Edge Cases</h3><p>You <em>will</em> see:</p><ul><li>Cancelled payments</li><li>Pending transactions</li><li>Network failures</li><li>Duplicate callbacks</li></ul><h3>3. Log Everything</h3><p>Transactions, states, failures.</p><p>This saves hours during debugging.</p><h3>4. Keep UI Responsive</h3><p>Never block UI during purchase.</p><p>Bad UX = lost revenue.</p><h3>5. Use StoreKit 2</h3><p>If targeting modern iOS:</p><ul><li>Cleaner API</li><li>Async/await</li><li>Built-in verification</li></ul><h3>Reality Check</h3><p>IAP is not:</p><blockquote><em>“Tap button → unlock feature”</em></blockquote><p>It’s:</p><ul><li>Payments system</li><li>Security layer</li><li>State machine</li><li>Revenue engine</li></ul><h3>Senior vs Junior Mindset</h3><p><strong>Junior Developer:</strong></p><ul><li>Implements purchase flow</li></ul><p><strong>Senior Developer:</strong></p><ul><li>Designs a reliable monetization system</li><li>Handles failures gracefully</li><li>Ensures revenue integrity</li></ul><h3>Final Thoughts</h3><p>If you’re building a paid app, your IAP system is:</p><blockquote><em>💰 Your business model in code</em></blockquote><p>Treat it like infrastructure, not a feature.</p><h3>💬 Want More?</h3><p>Comment <strong>“IAP,”</strong> and I’ll share:</p><ul><li>Backend receipt validation flow</li><li>Production-ready Swift code</li><li>Subscription handling strategies</li></ul><p>#iOSDevelopment #Swift #StoreKit #InAppPurchase #MobileMonetization #AppStore #iOSDev #Subscriptions #SoftwareEngineering #BuildInPublic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SmN3zv4ZMUsovb_VVYNtyQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c421d87b2f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Day One to Production: How We Plan & Deliver Projects as a Team]]></title>
            <link>https://medium.com/@themobilearchitects/from-day-one-to-production-how-we-plan-deliver-projects-as-a-team-7a12edbff545?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a12edbff545</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 06:23:44 GMT</pubDate>
            <atom:updated>2026-04-25T06:23:44.621Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>A lot of teams don’t fail because they lack talent.<br>They fail because they lack structure.</em></blockquote><p>I’ve seen highly skilled engineers struggle to ship. Deadlines slip. Features break. Stakeholders lose confidence.</p><p>Not because the team couldn’t build — but because they didn’t <strong>plan, align, and iterate properly</strong>.</p><p>Over time, I’ve refined a simple, practical framework as a Team Lead that helps take any project from <strong>idea → production → scale</strong> without chaos.</p><p>This isn’t theory. This is what actually works in real teams.</p><h3>1. Start With Absolute Clarity (Before Writing Code)</h3><p>Most teams rush into coding.</p><p>That’s the first mistake.</p><p>Before a single line of code is written, we ensure:</p><ul><li>Clear understanding of the <strong>problem</strong></li><li>Defined <strong>scope</strong></li><li>Measurable <strong>success metrics</strong></li></ul><h3>Example:</h3><p>Let’s say we’re building a <strong>food delivery feature</strong>.</p><p>Bad approach:</p><blockquote><em>“Let’s add ordering functionality.”</em></blockquote><p>Better approach:</p><ul><li>What problem are we solving?</li><li>Who is the user?</li><li>What defines success? (orders/day, conversion rate, retention)</li></ul><p>Without this clarity, teams build fast — but in the wrong direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aEANk3DpvxgImr2SLSIgNg.png" /></figure><h3>2. Design First, Build Later</h3><p>A common anti-pattern:</p><blockquote><em>Devs start coding while design is still evolving.</em></blockquote><p>This leads to:</p><ul><li>Rewrites</li><li>Misalignment</li><li>Frustration</li></ul><p>Instead, we enforce:</p><ul><li>Final UI/UX mocks</li><li>Complete user flows</li><li>Edge case discussions</li><li>API contracts finalized</li></ul><p>Development starts only after:<br>✅ Design is locked<br>✅ QA has reviewed flows</p><h3>Example:</h3><p>For a login system:</p><ul><li>What happens when the password is wrong?</li><li>What about network failure?</li><li>What about session expiry?</li></ul><p>If these aren’t defined early, engineers end up guessing — and guessing leads to bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elB-OgMsOjmROAfWvYA5UQ.png" /></figure><h3>3. Parallel Tech Preparation</h3><p>While design is being finalized, engineering doesn’t sit idle.</p><p>We use that time to prepare:</p><ul><li>Define architecture (MVVM, Clean Architecture, etc.)</li><li>Set up project structure</li><li>Configure environments (dev, staging, prod)</li><li>Establish coding standards</li></ul><h3>Why this matters:</h3><p>When design is ready, development doesn’t start from zero — it accelerates immediately.</p><h3>Example:</h3><p>In a mobile app:</p><ul><li>Base navigation setup</li><li>Network layer ready</li><li>Logging &amp; analytics integrated</li></ul><p>So when feature work starts, it’s plug-and-play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cD2qCX3H4nV_ypln1vGo5Q.png" /></figure><h3>4. Feature-Based Planning (Not Task Chaos)</h3><p>Instead of random task assignment, we break everything into <strong>features</strong>.</p><p>Each feature includes:</p><ul><li>UI</li><li>Backend integration</li><li>Edge cases</li><li>Testing</li></ul><h3>Example:</h3><p>Instead of:</p><ul><li>“Build API”</li><li>“Create UI”</li><li>“Handle errors”</li></ul><p>We define:<br> “User Profile Feature.”<br> “Payment Flow Feature.”<br> “Search Experience Feature.”</p><p>Each feature has:</p><ul><li>Owner</li><li>Timeline</li><li>Dependencies</li></ul><p>This creates <strong>ownership + accountability</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4C9bNx5w8Muxav4-MZjvig.png" /></figure><h3>5. Weekly Demos = Real Progress</h3><p>Most teams work in isolation and present at the end.</p><p>That’s risky.</p><p>We follow a simple rule:</p><blockquote><em>If it’s not demoed, it’s not done.</em></blockquote><p>Every week:</p><ul><li>Demo completed features</li><li>Show real working builds</li><li>Collect feedback from Product/CTO</li></ul><h3>Why this works:</h3><ul><li>Issues are caught early</li><li>Stakeholders stay aligned</li><li>No last-minute surprises</li></ul><h3>Example:</h3><p>We once avoided a major redesign because a weekly demo revealed:</p><blockquote><em>“This flow is confusing for users.”</em></blockquote><p>Fixing it early saved weeks of rework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-nx_RgLCFzu-tJdbOKApA.png" /></figure><h3>6. CI/CD &amp; QA Pipeline (Set It Early)</h3><p>Many teams treat CI/CD as a “later” task.</p><p>That’s a mistake.</p><p>We set up pipelines early:</p><ul><li>Automated builds</li><li>Continuous integration</li><li>Regular QA distribution</li></ul><h3>Benefits:</h3><ul><li>Faster feedback</li><li>Early bug detection</li><li>Stable releases</li></ul><h3>Example:</h3><p>Every code merge:</p><ul><li>Triggers build</li><li>Runs checks</li><li>Sends build to QA</li></ul><p>So bugs don’t pile up — they get caught instantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bB6B5K_j15jGBRWO4bR9Vg.png" /></figure><h3>7. Stabilization Phase (No Shortcuts Here)</h3><p>This is where discipline matters most.</p><p>Before launch:</p><ul><li>Full regression testing</li><li>Performance optimization</li><li>Edge case validation</li></ul><h3>What we don’t do:</h3><p>❌ “It works on my machine.”<br>❌ “Let’s fix after release.”</p><h3>Example:</h3><ul><li>Slow loading screens?</li><li>Memory issues?</li><li>Crash scenarios?</li></ul><p>Fix them now — not after users complain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yqd9vBNA-zK_gPZ8wd-boQ.png" /></figure><h3>8. Launch With Monitoring (Not Blind Release)</h3><p>Launching isn’t the end — it’s the beginning of real validation.</p><p>We release with:</p><ul><li>Monitoring tools</li><li>Crash tracking</li><li>Analytics</li></ul><h3>What we track:</h3><ul><li>User behavior</li><li>Performance metrics</li><li>Drop-offs</li></ul><h3>Example:</h3><p>After launch, we noticed:</p><blockquote><em>Users were abandoning checkout at payment step.</em></blockquote><p>That insight helped improve conversion significantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejCT1ag7fzDMbf34oIbaIg.png" /></figure><h3>9. Post-Production: The Real Work Begins</h3><p>Many teams relax after launch.</p><p>That’s when great teams double down.</p><p>We treat production as:<br>- Continuous improvement phase</p><h3>Priorities:</h3><ul><li>Fix critical bugs immediately</li><li>Release quick patches</li><li>Iterate based on real data</li></ul><h3>Example:</h3><p>Critical crash?<br>→ Fix same day<br>→ Release patch<br>→ Monitor impact</p><p>Speed matters here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pa6yjxwg2QTblZcpsSnaWQ.png" /></figure><h3>The Real Secret: It’s Not About Coding Faster</h3><p>Here’s what I’ve learned:</p><blockquote><em>Great products aren’t built by writing more code.<br>They’re built by making fewer mistakes.</em></blockquote><p>And that comes from:</p><ul><li>Planning smarter</li><li>Validating early</li><li>Iterating continuously</li></ul><h3>Final Thoughts</h3><p>A strong team doesn’t just build features<br>It builds <strong>systems that make building easier</strong>.</p><p>This framework works because it:</p><ul><li>Reduces uncertainty</li><li>Improves collaboration</li><li>Creates predictable delivery</li></ul><p>And most importantly, it builds trust.</p><h3>Over to You</h3><p>How does your team handle:</p><ul><li>Planning?</li><li>Feedback cycles?</li><li>Production releases?</li></ul><p>Different teams, different approaches — <br>I’d love to hear yours 👇</p><p>#ProjectManagement #TechLeadership #SoftwareDevelopment #Agile #Startup #Engineering #MobileDevelopment #TeamWork</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mdVrWLnrnRyyTdmsLMJmUw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a12edbff545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Guide to App Versioning & Release]]></title>
            <link>https://medium.com/@themobilearchitects/the-complete-guide-to-app-versioning-release-a44dafb0594d?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a44dafb0594d</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 15:00:32 GMT</pubDate>
            <atom:updated>2026-04-22T15:12:31.785Z</atom:updated>
            <content:encoded><![CDATA[<p>From GitHub Tag to App Store Launch</p><p>Shipping an app isn’t just about writing code — it’s about releasing it professionally.</p><p>One of the most misunderstood parts of software delivery is versioning + release flow.<br>You’ve seen versions like:</p><p>1.0.0</p><p>2.1.3</p><p>0.9.5</p><p>But what do they actually mean — and how do real teams go from code → users?</p><p>Let’s break it down step-by-step.</p><h3>What is Versioning?</h3><p>At its core, most teams follow Semantic Versioning:</p><p>MAJOR.MINOR.PATCH</p><h4>Example:</h4><h4>1.0.0</h4><ul><li><strong>MAJOR</strong> → Breaking changes</li><li><strong>MINOR</strong> → New features</li><li><strong>PATCH</strong> → Bug fixes</li></ul><h3>🔍 Version Breakdown (Visual)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qCNL1Hbw2AJ3eRSf2r7Kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*blYpo015qd6Cruwb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*tGCjTvWSsq1ol-ln" /></figure><h3>Why 1.0.0 Matters</h3><p>1.0.0 is a milestone.</p><p>It signals:</p><p>“This product is stable and ready for real users.”</p><p>Before that, your app typically evolves like:</p><p>0.1.0 → Initial setup 0.5.0 → Core features 0.9.0 → Beta stage 1.0.0 → Production launch 🚀</p><h3>🛠️ The Real Release Pipeline</h3><p>Before touching GitHub or any app store, professional teams follow a strict release process.</p><h3>🔄 Release Flow Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7y-Wryj1mz8vWIWT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hZNTdFaO67t7n02D" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zfc6RJFks5X_EAMJ" /></figure><h3>Develop → Code Freeze → QA → Tag → Build → Publish → Monitor</h3><h3>Step 1: Code Freeze</h3><ul><li>No new features</li><li>Only critical fixes</li></ul><h3>Step 2: QA Testing</h3><ul><li>Functional testing</li><li>Performance validation</li><li>Crash checks</li></ul><h3>Step 3: Final Build</h3><ul><li>Production-ready build generated</li></ul><h3>🧾 Step 4: GitHub Tagging</h3><p>Before release, you lock your code version using Git tags.</p><h3>CLI Commands</h3><p>git add .</p><p>git commit -m &quot;Release: v1.0.0&quot;</p><p>git tag -a v1.0.0 -m &quot;Initial production release&quot;</p><p>git push origin main</p><p>git push origin v1.0.0</p><h3>Why Tagging Matters</h3><ul><li>Creates a <strong>snapshot of code</strong></li><li>Enables <strong>rollback</strong></li><li>Keeps releases <strong>traceable</strong></li></ul><h3>🔁 Git Flow (Visual)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i4CnLvBLorU1kDQs" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7IF3mYkp4p41hBEW" /></figure><h4>Code → Commit → Tag → Push → Release Snapshot</h4><h3>📱 Step 5: Android Versioning</h3><h4>Inside your Android project:</h4><p>defaultConfig { versionCode 1 versionName &quot;1.0.0&quot; }</p><h3>Key Difference:</h3><ul><li><strong>versionCode</strong> → Internal (must increase every release)</li><li><strong>versionName</strong> → User-visible</li></ul><h3>Play Store Release</h3><ul><li>Build signed .aab</li><li>Upload to Play Console</li><li>Add release notes</li><li>Publish</li></ul><h3>Step 6: iOS Versioning</h3><h4>In Xcode:</h4><p>Version → 1.0.0 Build → 1</p><h3>🚀 App Store Release</h3><ul><li>Archive build</li><li>Upload via Organizer</li><li>Add metadata (screenshots, description)</li><li>Submit for review</li></ul><h3>📲 Mobile Release Flow (Visual)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*Ui88D1xoIsnUkwJt" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TjzuKP04CzPk1pOD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EWDtMuPnDB6-EMnH" /></figure><p>Build → Upload → Review → Publish</p><h3>Step 7: Release Notes</h3><p>Never skip this.</p><h4>Example:</h4><p>Version 1.0.0 - Initial release - User authentication - Dashboard &amp; analytics - Performance improvements</p><h3>What Happens After Launch?</h3><p>Your work doesn’t stop at 1.0.0.</p><p>Version evolution: 1.0.1 → Bug fixes 1.1.0 → Features 2.0.0 → Major redesign</p><h3>Version Timeline (Visual)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3XllfKOYt7o_dK5r" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MDPocTHLvvQ4uMVN" /></figure><h3>⚠️ Common Mistakes</h3><ul><li>Skipping Git tags</li><li>Reusing version numbers</li><li>Not updating Android versionCode</li><li>No release notes</li><li>Launching without QA</li></ul><h3>💡 Pro Tips from Production Teams</h3><ul><li>Keep versions consistent across platforms</li><li>Maintain a CHANGELOG.md</li><li>Automate builds with CI/CD</li><li>Monitor crashes after release</li><li>Always prepare a hotfix (1.0.1)</li></ul><h3>🧩 The Clean Release Formula</h3><h4>Develop → Test → Tag → Build → Publish → Monitor 🚀</h4><h3>🏁 Final Thoughts</h3><p>Shipping an app is not just technical — <br>It’s process, discipline, and consistency.</p><p>If you get this right, you don’t just launch apps…</p><h4>👉 You build reliable products that users trust.</h4><p>#iosdeveloper #androiddeveloper #softwareengineering #mobiledevelopment #programming #github #appdevelopment #techcareers #ProjectManagement #TechLeadership #SoftwareDevelopment #Agile #Startup #Engineering #MobileDevelopment #TeamWork</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a44dafb0594d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FCM Token System Architecture — iOS Notification]]></title>
            <link>https://medium.com/@themobilearchitects/fcm-token-system-architecture-ios-notification-d988818e4c57?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d988818e4c57</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 04:46:54 GMT</pubDate>
            <atom:updated>2026-04-19T04:46:54.903Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Architecture Overview (Production Level)</h3><p><strong>Flow:</strong></p><pre>iOS App → Firebase SDK → FCM Token<br>                     ↓<br>                 Your Backend API → Store Token<br>                     ↓<br>               Send Notification (via Firebase Admin / HTTP v1 API)<br>                     ↓<br>                    APNs → Device</pre><p>Key idea:</p><ul><li><strong>Firebase = messaging layer</strong></li><li><strong>Your backend = source of truth (tokens + logic)</strong></li></ul><h3>2. Firebase Setup</h3><h3>Step 1: Create Project</h3><ul><li>Go to Firebase Console</li><li>Create project</li></ul><h3>Step 2: Add iOS App</h3><ul><li>Add bundle ID</li><li>Download GoogleService-Info.plist</li><li>Add to Xcode project</li></ul><h3>3. iOS Project Configuration</h3><h3>Enable Capabilities in Xcode</h3><ul><li>Push Notifications</li><li>Background Modes → Remote notifications</li></ul><h3>4. APNs Setup (CRITICAL for Production)</h3><h3>Go to:</h3><p>Apple Developer Account</p><h3>Create:</h3><ul><li>APNs Auth Key (.p8)</li><li>Key ID + Team ID</li></ul><h3>Upload to Firebase:</h3><ul><li>Firebase → Project Settings → Cloud Messaging</li><li>Upload .p8</li></ul><p>Use <strong>Auth Key (not certificates)</strong> → better for scaling</p><h3>5. Install Firebase SDK</h3><h3>Swift Package Manager</h3><pre>https://github.com/firebase/firebase-ios-sdk</pre><p>Add:</p><ul><li>FirebaseMessaging</li></ul><h3>6. AppDelegate Setup (Important)</h3><pre>import UIKit<br>import Firebase<br>import FirebaseMessaging</pre><pre>@main<br>class AppDelegate: UIResponder, UIApplicationDelegate {</pre><pre>    func application(<br>        _ application: UIApplication,<br>        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?<br>    ) -&gt; Bool {<br>        <br>        FirebaseApp.configure()<br>        <br>        UNUserNotificationCenter.current().delegate = self<br>        Messaging.messaging().delegate = self<br>        <br>        application.registerForRemoteNotifications()<br>        <br>        return true<br>    }<br>}</pre><h3>7. Request Notification Permission</h3><pre>import UserNotifications</pre><pre>func requestPermission() {<br>    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in<br>        print(&quot;Permission granted:&quot;, granted)<br>    }<br>}</pre><p>Call this on first launch (not aggressively)</p><h3>8. Get FCM Token (VERY IMPORTANT)</h3><pre>extension AppDelegate: MessagingDelegate {<br>    <br>    func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {<br>        guard let token = fcmToken else { return }<br>        print(&quot;FCM Token:&quot;, token)<br>        <br>        sendTokenToBackend(token)<br>    }<br>}</pre><h3>9. Send Token to Backend API</h3><pre>func sendTokenToBackend(_ token: String) {<br>    let url = URL(string: &quot;https://api.yourapp.com/save-token&quot;)!<br>    <br>    var request = URLRequest(url: url)<br>    request.httpMethod = &quot;POST&quot;<br>    <br>    let body: [String: Any] = [<br>        &quot;token&quot;: token,<br>        &quot;user_id&quot;: &quot;123&quot;<br>    ]<br>    <br>    request.httpBody = try? JSONSerialization.data(withJSONObject: body)<br>    <br>    URLSession.shared.dataTask(with: request).resume()<br>}</pre><h3>10. Backend (Node.js Example — Production Style)</h3><p>Use Firebase Admin SDK</p><pre>npm install firebase-admin</pre><pre>const admin = require(&quot;firebase-admin&quot;);</pre><pre>admin.initializeApp({<br>  credential: admin.credential.cert(require(&quot;./serviceAccount.json&quot;))<br>});</pre><pre>// Send notification<br>async function sendPush(token) {<br>  await admin.messaging().send({<br>    token: token,<br>    notification: {<br>      title: &quot;Hello&quot;,<br>      body: &quot;Production notification 🚀&quot;<br>    },<br>    apns: {<br>      payload: {<br>        aps: {<br>          sound: &quot;default&quot;<br>        }<br>      }<br>    }<br>  });<br>}</pre><h3>11. Database Design (Production)</h3><p>Store tokens like:</p><pre>{<br>  &quot;user_id&quot;: &quot;123&quot;,<br>  &quot;device_id&quot;: &quot;ios_abc&quot;,<br>  &quot;fcm_token&quot;: &quot;xxxx&quot;,<br>  &quot;platform&quot;: &quot;ios&quot;,<br>  &quot;updated_at&quot;: &quot;timestamp&quot;<br>}</pre><p>Important:</p><ul><li>One user = multiple devices</li><li>Always update the token (it changes!)</li></ul><h3>12. Handle Token Refresh</h3><pre>Messaging.messaging().token { token, error in<br>    if let token = token {<br>        sendTokenToBackend(token)<br>    }<br>}</pre><h3>13. Foreground Notification Handling</h3><pre>extension AppDelegate: UNUserNotificationCenterDelegate {<br>    <br>    func userNotificationCenter(<br>        _ center: UNUserNotificationCenter,<br>        willPresent notification: UNNotification<br>    ) async -&gt; UNNotificationPresentationOptions {<br>        return [.banner, .sound]<br>    }<br>}</pre><h3>14. Testing</h3><h3>Use Firebase Console:</h3><ul><li>Send a test message using the FCM token</li></ul><h3>15. Production Pitfalls (Most People Miss This)</h3><h3>Common mistakes:</h3><ul><li>Not uploading APNs key → notifications fail silently</li><li>Not handling token refresh</li><li>Sending to old tokens</li><li>Not enabling background modes</li><li>Using a sandbox instead of production APNs</li></ul><h3>16. Advanced Production Setup</h3><h3>Topics / Segmentation</h3><pre>admin.messaging().subscribeToTopic(tokens, &quot;premium_users&quot;);</pre><h3>Retry Strategy</h3><ul><li>If FCM fails → retry with exponential backoff</li></ul><h3>Analytics</h3><p>Use:<br>Firebase Analytics</p><h3>Security</h3><ul><li>Never expose the FCM server key in the app</li><li>All push logic from the backend only</li></ul><h3>17. Production Checklist</h3><p>✔ APNs key uploaded<br>✔ Push capability enabled<br>✔ Token saved in backend<br>✔ Token refresh handled<br>✔ Backend retry logic<br>✔ Logs + monitoring</p><h3>Real-World Tip</h3><p>If you’re building something like <strong>Netflix or large-scale apps</strong>:</p><ul><li>Don’t send notifications directly from Firebase Console</li><li>Always go through backend → control + personalization</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLSDuo21se9sJk3c9bC1-w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d988818e4c57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real Video Streaming System Design (Netflix-level)]]></title>
            <link>https://medium.com/@themobilearchitects/real-video-streaming-system-design-netflix-level-ae6fb30adde4?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae6fb30adde4</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 04:38:58 GMT</pubDate>
            <atom:updated>2026-04-19T04:38:58.827Z</atom:updated>
            <content:encoded><![CDATA[<p>At scale, a streaming app is NOT just a mobile app — it’s a distributed system.</p><h3>High-Level Flow</h3><pre>Upload → Encoding → Storage → CDN → Mobile Player</pre><h3>Core Components</h3><h3>1. Video Pipeline</h3><ul><li>Upload video</li><li>Transcode into multiple bitrates (240p → 4K)</li><li>Package into HLS/DASH</li></ul><p>This enables <strong>adaptive bitrate streaming (ABR)</strong> — critical for smooth playback</p><h3>2. CDN (Most Important)</h3><ul><li>Use CDN (CloudFront, Akamai)</li><li>Cache videos near users</li></ul><p>Without CDN = buffering + slow start</p><h3>3. Backend (Microservices)</h3><ul><li>Auth service</li><li>Recommendation service</li><li>Playback service</li><li>Analytics</li></ul><p>Netflix uses <strong>modular microservices for scalability</strong></p><h3>4. Client (iOS App)</h3><ul><li>Fetch video metadata</li><li>Load HLS stream</li><li>Adaptive playback</li><li>Prefetch next video</li></ul><h3>Key Performance Metrics</h3><p>You MUST optimize for:</p><ul><li><strong>TTFF (Time to First Frame)</strong> ⬅️ most important</li><li><strong>Rebuffering ratio</strong></li><li><strong>FPS (60fps scrolling)</strong></li><li><strong>Startup latency</strong></li></ul><p>Even a 1–2 sec delay kills engagement.</p><h3>2. iOS Architecture (Production Ready)</h3><h3>Recommended Architecture</h3><pre>SwiftUI (UI Layer)<br>   ↓<br>ViewModel (State + Logic)<br>   ↓<br>Player Manager (AVPlayer wrapper)<br>   ↓<br>Networking + Cache Layer</pre><h3>Modular Design (Like Netflix)</h3><p>Split features:</p><ul><li>Home Feed Module</li><li>Player Module</li><li>Download Module</li><li>Analytics Module</li></ul><p>Netflix uses modular architecture for scalability.</p><h3>3. Smooth Scrolling Video (MOST IMPORTANT)</h3><p>This is where most apps fail.</p><h3>Common Mistakes</h3><ul><li>Creating new AVPlayer on every scroll</li><li>Loading video only when visible</li><li>Doing work on the main thread</li><li>No caching</li></ul><h3>Real Strategy (Used by TikTok / YouTube)</h3><h3>1. Preload Next Videos</h3><pre>preload(videoIndex + 1)<br>preload(videoIndex + 2)</pre><p>You should ALWAYS be ahead of the user.</p><h3>2. Player Pool (CRITICAL)</h3><p>Instead of creating players:</p><pre>class PlayerPool {<br>    var players: [AVPlayer] = []<br>}</pre><p>Reuse players across cells.</p><h3>3. Use AVQueuePlayer</h3><ul><li>Pre-buffer next item</li><li>Smooth transitions</li></ul><h3>4. Background Thread Loading</h3><p>Never block UI:</p><pre>DispatchQueue.global().async {<br>   loadVideo()<br>}</pre><h3>5. Only 1 Active Video</h3><p>Pause others:</p><pre>if isVisible {<br>    player.play()<br>} else {<br>    player.pause()<br>}</pre><h3>6. Use HLS (.m3u8)</h3><pre>let url = URL(string: &quot;https://cdn.com/video.m3u8&quot;)</pre><p>Enables adaptive bitrate → no buffering</p><h3>4. Production Swift + SwiftUI Example</h3><h3>🎬 Player Manager</h3><pre>final class VideoPlayerManager: ObservableObject {<br>    static let shared = VideoPlayerManager()</pre><pre>    private var cache: [URL: AVPlayerItem] = [:]</pre><pre>    func player(for url: URL) -&gt; AVPlayer {<br>        if let item = cache[url] {<br>            return AVPlayer(playerItem: item)<br>        }</pre><pre>        let asset = AVURLAsset(url: url)<br>        let item = AVPlayerItem(asset: asset)<br>        cache[url] = item</pre><pre>        return AVPlayer(playerItem: item)<br>    }<br>}</pre><h3>🎥 SwiftUI Video Cell</h3><pre>struct VideoCell: View {<br>    let url: URL<br>    @State private var player: AVPlayer?</pre><pre>    var body: some View {<br>        VideoPlayer(player: player)<br>            .onAppear {<br>                player = VideoPlayerManager.shared.player(for: url)<br>                player?.play()<br>            }<br>            .onDisappear {<br>                player?.pause()<br>            }<br>    }<br>}</pre><h3>📜 Smooth Scrolling Feed</h3><pre>ScrollView {<br>    LazyVStack {<br>        ForEach(videos, id: \.self) { video in<br>            VideoCell(url: video.url)<br>                .frame(height: 400)<br>        }<br>    }<br>}</pre><h3>Advanced Optimizations (Production Level)</h3><h3>1. Pre-warm Player</h3><pre>player.currentItem?.preferredForwardBufferDuration = 5</pre><h3>2. Smart Prefetching</h3><ul><li>Based on scroll velocity</li><li>AI prediction (Netflix level)</li></ul><h3>3. Offline Cache</h3><ul><li>Store segments locally</li><li>Resume instantly</li></ul><h3>4. Analytics Tracking</h3><p>Track:</p><ul><li>buffering</li><li>drop frames</li><li>playback failures</li></ul><h3>5. Adaptive Bitrate Logic</h3><p>Let the player auto-adjust quality dynamically</p><ul><li>Prevents buffering under a poor network</li></ul><h3>Reality Check (Important)</h3><p>If you want Netflix-level smoothness:</p><p>You need:</p><ul><li>CDN + backend infra</li><li>Optimized encoding pipeline</li><li>Advanced player logic</li><li>Heavy testing (low-end devices)</li></ul><p>It’s not just UI — it’s <strong>system + infra + client working together</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iy-jNSiI3VKHLt4RoYrCtQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae6fb30adde4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Most Senior Mobile Engineers Fail the Managerial Round (And How to Fix It)]]></title>
            <link>https://medium.com/@themobilearchitects/why-most-senior-mobile-engineers-fail-the-managerial-round-and-how-to-fix-it-d4083e1e411b?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4083e1e411b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[behavioural-science]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 02:19:30 GMT</pubDate>
            <atom:updated>2026-04-18T02:19:30.303Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re a Senior iOS or Android Engineer preparing for interviews, there’s one uncomfortable truth:</p><p>You can clear coding rounds.<br>You can design scalable architectures.</p><p>…but still get rejected.</p><p>Why?</p><p>Because the <strong>managerial (behavioral) round</strong> is a completely different game.</p><p>It’s not testing how well you code.<br>It’s testing how well you <strong>think, lead, and influence</strong>.</p><h3>The Shift: From Developer → Owner</h3><p>Most engineers prepare like this:</p><ul><li>Revise Swift / Kotlin</li><li>Practice DSA</li><li>Build side projects</li></ul><p>But in the managerial round, none of that matters if you can’t demonstrate:</p><ul><li>Ownership</li><li>Decision-making</li><li>Communication</li><li>Business alignment</li></ul><p>At the senior level, you’re expected to act like a <strong>mini-CEO of your module</strong>.</p><h3>What Interviewers Are Actually Evaluating</h3><p>Behind every behavioral question, interviewers are silently checking:</p><ul><li>Can you <strong>handle ambiguity</strong>?</li><li>Can you <strong>work across teams</strong> (PM, Design, Backend)?</li><li>Can you <strong>take responsibility</strong> when things go wrong?</li><li>Can you <strong>mentor and elevate others</strong>?</li><li>Can you <strong>balance speed vs quality</strong>?</li></ul><p>If your answers don’t reflect this, you’ll sound like a mid-level engineer.</p><h3>Real Questions (And What Strong Answers Look Like)</h3><h3>1. Tell me about a project you’re proud of.</h3><p>Most candidates describe features.</p><p>Strong candidates describe <strong>impact</strong>.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I built a video editing feature using modern frameworks.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I led the development of a video editing module used by 100K+ users.<br>We improved rendering performance by 35% and reduced crash rates significantly.<br>I coordinated with backend and product teams to ensure smooth rollout and scalability.”</em></blockquote><p>Always highlight:</p><ul><li>Scale</li><li>Metrics</li><li>Collaboration</li><li>Ownership</li></ul><h3>2. How do you handle conflicts in your team?</h3><p>Conflict is inevitable — avoidance is a red flag.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I try to stay calm and avoid arguments.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“When conflicts arise (e.g., architecture decisions), I bring the discussion back to product goals.<br>I encourage data-backed reasoning and ensure everyone is heard before aligning on a solution.”</em></blockquote><p>Show:</p><ul><li>Emotional intelligence</li><li>Structured thinking</li><li>Team-first mindset</li></ul><h3>3. Have you mentored others?</h3><p>Senior engineers multiply impact through others.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“Yes, I helped juniors sometimes.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I mentor developers through code reviews, pair programming, and structured onboarding.<br>In my previous team, I helped junior engineers become independent contributors within a few months.”</em></blockquote><p>Show:</p><ul><li>Intentional mentorship</li><li>Measurable growth</li></ul><h3>4. How do you handle tight deadlines?</h3><p>Working late is not leadership.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I work extra hours to finish tasks.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I prioritize high-impact features, break down scope, and communicate trade-offs early.<br>This ensures we deliver value on time without compromising long-term maintainability.”</em></blockquote><p>Show:</p><ul><li>Prioritization</li><li>Communication</li><li>Strategic thinking</li></ul><h3>5. How do you ensure code quality?</h3><p>Code quality is not just personal — it’s systemic.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I write clean and maintainable code.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I establish strong engineering practices like code reviews, CI/CD pipelines, linting, and modular architecture.<br>Quality is enforced through systems, not individuals.”</em></blockquote><p>Show:</p><ul><li>Systems thinking</li><li>Team-wide impact</li></ul><h3>6. Tell me about a failure.</h3><p>This is where many candidates lose credibility.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I can’t think of any major failure.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I underestimated integration complexity in a release, which caused delays.<br>After that, I improved estimation by factoring unknowns and introduced better planning practices.”</em></blockquote><p>Show:</p><ul><li>Accountability</li><li>Learning mindset</li></ul><h3>7. Why should we hire you?</h3><p>This is your positioning moment.</p><p><strong>Weak Answer:</strong></p><blockquote><em>“I have strong experience in iOS and Android.”</em></blockquote><p><strong>Strong Answer:</strong></p><blockquote><em>“I bring both technical depth and leadership.<br>I focus on building scalable systems while enabling teams to move faster with better quality.”</em></blockquote><p>Show:</p><ul><li>Business value</li><li>Leadership identity</li></ul><h3>The Biggest Mistake Senior Engineers Make</h3><p>They answer questions like:</p><blockquote><em>“What did </em>I<em> do?”</em></blockquote><p>Instead of:</p><blockquote><em>“What </em>impact<em> did I create?”</em></blockquote><h3>A Simple Framework That Works (Use This in Every Answer)</h3><p>Use this structure:</p><p><strong>1. Context</strong> — What was the situation?<br><strong>2. Action</strong> — What did YOU do?<br><strong>3. Impact</strong> — What changed because of you?</p><p>This keeps answers:</p><ul><li>Structured</li><li>Clear</li><li>Impact-driven</li></ul><h3>Final Thought</h3><p>At the Senior level, your job is not just to write code.</p><p>It’s to:</p><ul><li>Make decisions under uncertainty</li><li>Align teams toward outcomes</li><li>Build systems that scale</li><li>Elevate people around you</li></ul><p>If your answers don’t reflect that…</p><p>You’re not being evaluated as a Senior.</p><h3>Beyond</h3><p>If you’re preparing for Senior Mobile Engineer roles (iOS / Android),<br>Start preparing beyond code.</p><p>Because the real interview is not about syntax.</p><p>It’s about <strong>how you think, lead, and deliver impact</strong>.</p><p><strong>Follow for more insights on Mobile Architecture, System Design, and Engineering Leadership.</strong></p><p>#SwiftUI #iOSDevelopment #Swift #CleanCode #SOLIDPrinciples #MobileDevelopment #SoftwareEngineering #AppArchitecture #MVVM #Programming #Developers #TechWriting #SystemDesign #interview #Behaviour #communication</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfQj0k8uGk2QWYa0k-mpTA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4083e1e411b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS CI/CD Setup with Fastlane (Step-by-Step)- How We Reduced Release Time from 2 Hours to 10…]]></title>
            <link>https://medium.com/@themobilearchitects/ios-ci-cd-setup-with-fastlane-step-by-step-how-we-reduced-release-time-from-2-hours-to-10-f45a4486ef22?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f45a4486ef22</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 17:20:42 GMT</pubDate>
            <atom:updated>2026-04-16T17:20:42.437Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS CI/CD Setup with Fastlane (Step-by-Step)- How We Reduced Release Time from 2 Hours to 10 Minutes</h3><p>Shipping an iOS app used to take me <strong>2–3 hours</strong>.</p><ul><li>Archive in Xcode</li><li>Fix signing issues</li><li>Upload manually</li><li>Wait… retry… repeat</li></ul><p>And sometimes?</p><p>💥 <em>“Code signing failed.”</em><br>💥 <em>“Provisioning profile mismatch.”</em></p><p>Sound familiar?</p><h3>The Breaking Point</h3><p>One day, I had to release an urgent hotfix.</p><p>What should’ve taken <strong>10 minutes… took 3 hours</strong>.</p><p>That’s when I decided:</p><blockquote><em>❌ No more manual releases<br>✅ Time to automate everything</em></blockquote><p>That’s when I discovered <strong>Fastlane</strong></p><h3>What is Fastlane (in simple terms)?</h3><p>Think of it like:</p><p>A <strong>robot that builds, signs, and uploads your app</strong></p><p>Instead of this:</p><pre>Click → Wait → Fix → Retry</pre><p>You do this:</p><pre>fastlane beta</pre><h3>The Goal</h3><p>Here’s what I wanted:</p><pre>Git Push → Auto Build → Upload to TestFlight → Done</pre><p>No Xcode. No manual steps.</p><h3>Step 1: Install Fastlane</h3><pre>brew install fastlane</pre><h3>Step 2: Initialize the Project</h3><pre>fastlane init</pre><p>Choose:</p><ul><li>“Automate TestFlight”</li></ul><p>This creates:</p><ul><li>Fastfile</li><li>Appfile</li></ul><h3>Step 3: Fix Code Signing (BIGGEST PAIN)</h3><p>This is where most developers struggle.</p><p>Solution?</p><p>Use match (part of Fastlane)</p><h3>Setup Match</h3><pre>fastlane match init</pre><p>Choose:</p><ul><li>Git storage</li></ul><h3>What Match Does</h3><p>Instead of:</p><p>❌ Certificates on different machines<br>❌ Broken builds in CI</p><p>👉 It creates:</p><pre>Encrypted repo:<br>- Certificates<br>- Provisioning profiles</pre><h3>Generate Certificates</h3><pre>fastlane match development<br>fastlane match appstore</pre><p>👉 Now your signing is:<br>✅ Centralized<br>✅ Consistent<br>✅ CI-ready</p><h3>Step 4: Create Build Lane</h3><p>Edit Fastfile:</p><pre>platform :ios do</pre><pre>  desc &quot;Build &amp; Upload to TestFlight&quot;<br>  lane :beta do<br>    match(type: &quot;appstore&quot;)</pre><pre>    increment_build_number</pre><pre>    build_app(<br>      scheme: &quot;YourApp&quot;,<br>      export_method: &quot;app-store&quot;<br>    )</pre><pre>    upload_to_testflight<br>  end</pre><pre>end</pre><h3>Step 5: Run Your First Automation</h3><pre>fastlane beta</pre><p>What happens:</p><ul><li>App builds</li><li>Signing applied</li><li>Uploaded to TestFlight</li></ul><p>🎉 Done.</p><h3>Real Workflow (After Setup)</h3><p>Before:</p><pre>Manual build → Upload → Errors → Retry</pre><p>After:</p><pre>Code → fastlane beta → TestFlight</pre><h3>Step 6: Add CI/CD (GitHub Actions)</h3><p>Using GitHub Actions</p><h3>.github/workflows/ios.yml</h3><pre>name: iOS CI/CD</pre><pre>on:<br>  push:<br>    branches: [main]</pre><pre>jobs:<br>  build:<br>    runs-on: macos-latest</pre><pre>    steps:<br>      - uses: actions/checkout@v3</pre><pre>      - name: Install dependencies<br>        run: |<br>          bundle install<br>          pod install</pre><pre>      - name: Run Fastlane<br>        run: bundle exec fastlane beta</pre><h3>Required Secrets</h3><p>Add in GitHub:</p><pre>MATCH_PASSWORD<br>MATCH_SSH_KEY</pre><h3>Step 7: TestFlight Distribution</h3><p>Upload goes to TestFlight</p><p>From there:</p><ul><li>Internal testing</li><li>External testers</li><li>QA validation</li></ul><h3>Step 8: Production Release</h3><p>Add another lane:</p><pre>lane :release do<br>  match(type: &quot;appstore&quot;)</pre><pre>  build_app(scheme: &quot;YourApp&quot;)</pre><pre>  upload_to_app_store(<br>    submit_for_review: true<br>  )<br>end</pre><h3>Real Results</h3><p>After implementing this:</p><p>✅ Release time: <strong>2 hours → 10 minutes</strong><br>✅ Zero signing issues<br>✅ No manual steps<br>✅ Faster hotfixes</p><h3>What I Learned (Important)</h3><h3>1. Code signing is the real problem</h3><p>match solves it</p><h3>2. CI/CD is not optional</h3><p>It’s required for scaling</p><h3>3. Automate early</h3><p>Saves massive time later</p><h3>Final Takeaway</h3><blockquote><em>Don’t waste time clicking “Archive” in Xcode<br>Build a pipeline that works for you</em></blockquote><h3>Let’s Discuss</h3><p>Are you still releasing manually?<br>Or using automation like Fastlane?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Igi1zSjnn_M7WXG64FBA8Q.png" /></figure><p>#iOSDevelopment #Swift #Fastlane #CICD #MobileDev #AppDevelopment #DevOps #TestFlight #Automation #SoftwareEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f45a4486ef22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your SwiftUI Navigation Breaks (And How to Fix It with State Architecture)]]></title>
            <link>https://medium.com/@themobilearchitects/why-your-swiftui-navigation-breaks-and-how-to-fix-it-with-state-architecture-40525767ac01?source=rss-cacac592abb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/40525767ac01</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Laksh Purbey]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 11:06:26 GMT</pubDate>
            <atom:updated>2026-04-15T11:06:26.736Z</atom:updated>
            <content:encoded><![CDATA[<p>SwiftUI navigation looks simple…<br>until it suddenly isn’t.</p><ul><li>Screens reset randomly</li><li>The navigation stack disappears</li><li>State gets lost when switching tabs</li></ul><p>Sound familiar?</p><p>You’re not alone.</p><p>And here’s the truth most developers miss:</p><blockquote><em>It’s NOT a SwiftUI problem<br> It’s a </em><strong><em>state architecture problem</em></strong></blockquote><h3>The Real Problem</h3><p>Most developers structure navigation like this:</p><pre>NavigationStack {<br>    ScreenA()<br>}</pre><p>Then push screens:</p><pre>NavigationLink(&quot;Go&quot;, destination: ScreenB())</pre><p>It works… at first.</p><p>But as your app grows:</p><ul><li>You add tabs</li><li>You add async data</li><li>You add deep links</li></ul><p>💥 Everything starts breaking.</p><h3>Why This Happens</h3><p>SwiftUI navigation is <strong>state-driven</strong></p><p>Not imperative like UIKit</p><p>That means:</p><pre>Navigation = State</pre><p>If your state is not stable → navigation breaks</p><h3>Common Mistake (This breaks apps)</h3><pre>struct HomeView: View {<br>    var body: some View {<br>        NavigationStack {<br>            ScreenA()<br>        }<br>    }<br>}</pre><pre>Problem:</pre><ul><li>NavigationStack is recreated</li><li>The state is lost</li><li>Navigation resets</li></ul><h3>The Correct Mental Model</h3><p>Instead of thinking:</p><p>“Push screen”</p><blockquote>Think:</blockquote><p>“Update navigation state”</p><h4>The FIX: State-Driven Navigation</h4><h4>Step 1: Create Navigation State</h4><pre>class HomeViewModel: ObservableObject {<br>    @Published var path: [String] = []<br>}</pre><h4>Step 2: Bind NavigationStack</h4><pre>struct HomeView: View {<br>    @StateObject var vm = HomeViewModel()</pre><pre>    var body: some View {<br>        NavigationStack(path: $vm.path) {<br>            ScreenA()<br>                .navigationDestination(for: String.self) { value in<br>                    ScreenB()<br>                }<br>        }<br>    }<br>}</pre><h4>Step 3: Navigate via State</h4><pre>vm.path.append(&quot;goToB&quot;)</pre><p>No NavigationLink needed</p><h3>Why This Works</h3><p>Because now:</p><pre>NavigationStack = controlled by state</pre><p>So when:</p><ul><li>View reloads</li><li>Tab switches</li><li>App updates</li></ul><p>Navigation stays intact</p><h3>Before vs After</h3><h4>Before</h4><pre>View → NavigationStack → Screens</pre><p>UI controls navigation → fragile</p><h4>After</h4><pre>State → NavigationStack → Screens</pre><p>State controls navigation → stable</p><h3>Real-World Scenario (Tabs Issue)</h3><h4>Problem:</h4><ul><li>Go: Home → A → B</li><li>Switch tab</li><li>Come back</li></ul><p>💥 You’re back at the root</p><h3>Fix:</h3><p>Each tab should have its own:</p><pre>@StateObject ViewModel<br>NavigationStack(path:)</pre><p>Result:</p><p>Navigation preserved per tab</p><h3>Advanced: Global State</h3><p>For apps like video or music:</p><p>Keep the shared state globally</p><pre>AppState<br> ├── PlayerState<br> ├── Session</pre><p>So:</p><ul><li>The video keeps playing</li><li>Navigation doesn’t break</li></ul><h3>Senior-Level Insight</h3><blockquote><em>SwiftUI doesn’t break navigation<br>Developers break state</em></blockquote><h3>Final Architecture</h3><pre>AppState<br>   ↓<br>TabView<br>   ↓<br>Each Tab:<br>   ↓<br>ViewModel (@StateObject)<br>   ↓<br>NavigationStack(path:)</pre><h3>Why This Matters</h3><p>Without this:</p><p>Random bugs<br>Poor UX<br>Hard to scale</p><p>With this:</p><p>Predictable navigation<br> Clean architecture<br> Production-ready apps</p><h3>Final Takeaway</h3><p>If your SwiftUI navigation is breaking:</p><p>Don’t debug UI<br>Fix your <strong>state architecture</strong></p><h3>Let’s Discuss</h3><p>Have you faced navigation issues in SwiftUI?<br>How did you fix them?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1zaJzg0UZxxplcQUlOz9UQ.png" /></figure><p>#SwiftUI #iOSDevelopment #Navigation #MobileArchitecture #CleanCode #AppArchitecture #SoftwareEngineering #MVVM #Developers #Programming</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40525767ac01" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>