Frontend School
DashboardProblemsLearnPracticeMock InterviewReportsStatsBuy Credits
DashboardProblemsLearnPracticeMock Interview
Frontend System Design Roadmap
  1. 1.HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
  2. 2.TCP and TLS Handshakes: Connection Setup Costs
  3. 3.Browser Network Stack and Connection Pooling
  4. 4.GET vs POST and Idempotency in HTTP
  5. 5.The Critical Rendering Path (CRP)
  6. 6.DOM, CSSOM and the Render Tree
  7. 7.Layout, Paint and Compositing
  8. 8.Reflows and Repaints Explained
  9. 9.Event Loop: Call Stack, Task and Microtask Queues
  10. 10.Async JavaScript: Promises and async/await
  11. 11.Web Workers: Multi-threading in the Browser
  12. 12.Browser Storage: Cookies, Web Storage, IndexedDB
  13. 13.Client-Side Storage: Limits and Security Risks
  14. 14.Choosing the Right Client-Side Storage
  15. 15.HTTP Caching: Cache-Control, ETag, Last-Modified
  16. 16.Browser-Level Caching Mechanisms
  17. 17.Cache Invalidation for Frontend Apps
  18. 18.Structuring a Large Single-Page App
  19. 19.Component-Based Architecture Principles
  20. 20.Props, State and Component Lifecycle
  21. 21.Module Bundling Basics
  22. 22.Core Web Vitals: LCP, INP and CLS
  23. 23.FCP and Time to Interactive (TTI) Explained
  24. 24.Measuring Performance: Lighthouse and WebPageTest
  25. 25.Asset Compression and Minification Basics
  26. 26.What Is a CDN and How Does It Work?
  27. 27.CDN Benefits: Latency, Availability, Offload
  28. 28.CDN Cache Behavior and Invalidation
  29. 29.Global State vs Local Component State
  30. 30.State Patterns: Redux, Zustand and Context
  31. 31.Data Fetching: React Query and SWR
  32. 32.Immutable Data in Frontend State
  33. 33.SSR vs CSR: Rendering Trade-offs
  34. 34.Hydration and Time to First Byte (TTFB)
  35. 35.Static Site Generation (SSG) for Speed and SEO
  36. 36.Incremental Static Regeneration (ISR)
  37. 37.Micro-Frontends: Core Principles
  38. 38.Micro-Frontend Integration Strategies
  39. 39.Communication Between Micro-Frontends
  40. 40.Micro-Frontends: Pros and Cons for Large Teams
  41. 41.Real-Time: Polling, SSE and WebSockets
  42. 42.Real-Time Use Cases: Chat, Alerts, Live Data
  43. 43.Designing a Real-Time Data Flow
  44. 44.Scaling WebSocket Connections
  45. 45.Responsive Images: srcset, sizes and picture
  46. 46.Modern Image Formats: WebP, AVIF, JPEG XL
  47. 47.Lazy Loading Images and Videos
  48. 48.Video Streaming: HLS, DASH, Adaptive Bitrate
  49. 49.REST and GraphQL for Frontend Engineers
  50. 50.Batching, Throttling and Debouncing API Calls
  51. 51.Handling API Errors in the Frontend
  52. 52.Authentication Flows: OAuth and JWT
  53. 53.Global Error Boundaries in React
  54. 54.Error Reporting: Sentry and LogRocket
  55. 55.Graceful Degradation and Fallback UIs
  56. 56.Real User Monitoring (RUM)
  57. 57.CORS: Cross-Origin Resource Sharing
  58. 58.Preventing XSS (Cross-Site Scripting)
  59. 59.CSRF Protection for Frontend Apps
  60. 60.Content Security Policy (CSP)
  61. 61.Storing Auth Tokens: Cookies vs localStorage
  62. 62.PWA Manifest and Installability
  63. 63.Service Workers: Lifecycle and Caching Strategies
  64. 64.Offline Support and Background Sync
  65. 65.Push Notifications for Web Apps
  66. 66.Webpack vs Vite vs Parcel
  67. 67.Code Splitting, Tree Shaking, Asset Optimization
  68. 68.Module Resolution and Hot Module Replacement
  69. 69.Monorepo Tooling: Nx and Lerna
  70. 70.Atomic Design for Component Libraries
  71. 71.Theming and Customization in Design Systems
  72. 72.Accessibility in Component Libraries
  73. 73.Component Library Docs, Testing and Versioning
  74. 74.Publishing and Consuming a Component Library
  75. 75.Full-Text Search: Levenshtein and Fuzzy Matching
  76. 76.Indexing Large Datasets in the Browser
  77. 77.Search Performance: Debouncing and Web Workers
  78. 78.Integrating Backend Search Services
  79. 79.Choosing a Chart Library: D3, Chart.js, Recharts
  80. 80.Rendering Large Datasets: Canvas vs SVG
  81. 81.Interactive, Responsive Data Visualizations
  82. 82.Data Fetching and Aggregation for Dashboards
  83. 83.A/B Test Design and Rollout Strategies
  84. 84.Client-Side vs Server-Side A/B Testing
  85. 85.Feature Flags and Remote Configuration
  86. 86.Experiment Data Collection and Analytics
Frontend System Design Roadmap
37

Frontend System Design · Lesson 37 of 86 · 4 min

Micro-Frontends: Core Principles

In an interview, you'll be asked to justify the complexity of micro-frontends. Your answer must center on two principles: independent deployment and technology agnosticism.

Micro-frontends are a solution to an organizational scaling problem. They exist to let large numbers of developers, working in separate teams, ship features for a single application without stepping on each other's toes. If you aren't solving that problem, a monolith is simpler and better.

When you propose this architecture, you are trading technical simplicity for organizational velocity. The interviewer wants to see that you understand this trade-off. The entire pattern is built on two core ideas that enable this velocity.

Principle 1: Independent Deployment

Each micro-frontend must be buildable, testable, and deployable to production independently. A change in the "product-details" micro-frontend should not require a rebuild or redeployment of the "shopping-cart" micro-frontend.

This is the primary benefit. It allows teams to release features on their own schedule. It decouples release cycles, reduces coordination overhead, and isolates risk. If one team's deployment fails, it can be rolled back without affecting the rest of the application.

This is achieved through separate CI/CD pipelines, typically triggered by changes in a specific part of a monorepo or in a dedicated repository for that micro-frontend.

# .github/workflows/deploy-product-listing.yml

name: Deploy Product Listing Micro-frontend

on:
  push:
    branches:
      - main
    # Trigger this workflow ONLY on changes within this micro-frontend's directory
    paths:
      - 'packages/product-listing/**'

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'

      - name: Install, Build, and Test
        run: |
          cd packages/product-listing
          npm ci
          npm run build
          npm run test

      - name: Deploy to CDN
        run: |
          # This step uploads the built bundle(s) to a static host like S3 or a CDN.
          # The container app will load this artifact by a specific versioned URL.
          echo "Deploying build artifacts..."
          # Example: aws s3 sync ./dist s3://my-mfs/product-listing/v1.2.3

This separation is the key to team autonomy.

In an interview, frame this as a business advantage. "Independent deployment allows us to ship value to customers faster. A bug fix in the checkout flow doesn't have to wait for a feature freeze in the product search team. It reduces risk and shortens the feedback loop."

Principle 2: Technology Agnosticism

Different micro-frontends can be built with different technology stacks. One team can use React, another Vue, and a third can use Svelte or even vanilla JavaScript. A team can also upgrade its part of the application to a new version of a framework (e.g., React 18 to 19) without forcing every other team to upgrade.

This is a powerful feature, but it's also where the biggest risks lie.

The main reasons to leverage this are:

  1. Incremental Migration: You can strangle a legacy monolith by building new features as micro-frontends in a modern stack. This avoids a high-risk, all-or-nothing rewrite.
  2. Team Expertise: It allows teams to use the tools they are most productive with, or the best tool for a specific job.

Here is a simplified view of how a container application might load two micro-frontends built with different frameworks.

<!DOCTYPE html>
<html>
<head>
    <title>Micro-Frontend Shell</title>
</head>
<body>
    <h1>Our E-Commerce Site</h1>

    <!-- Mount points for each micro-frontend -->
    <div id="product-listing-container"></div>
    <div id="shopping-cart-container"></div>

    <!--
      In a real system, a script here (the "shell" or "orchestrator")
      would dynamically fetch and mount the micro-frontend bundles.
      This might use a library like single-spa or a runtime mechanism
      like Webpack Module Federation.
    -->
    <script>
        function mountMicroFrontend(containerId, bundleUrl, mountFnName) {
            const script = document.createElement('script');
            script.src = bundleUrl;
            script.onload = () => {
                // Each micro-frontend exposes a global function to render itself
                if (window[mountFnName]) {
                    window[mountFnName](document.getElementById(containerId));
                }
            };
            document.body.appendChild(script);
        }

        document.addEventListener('DOMContentLoaded', () => {
            mountMicroFrontend(
                'product-listing-container',
                'https://cdn.myapp.com/product-listing/v1.2.3/main.js', // React bundle
                'mountProductListing'
            );
            mountMicroFrontend(
                'shopping-cart-container',
                'https://cdn.myapp.com/shopping-cart/v2.1.0/main.js', // Vue bundle
                'mountShoppingCart'
            );
        });
    </script>
</body>
</html>

The trap: Candidates often praise technology agnosticism without acknowledging the costs. An interviewer will immediately probe on this. Be prepared to discuss two major drawbacks:

  1. Bundle Size: If the React team ships React and the Vue team ships Vue, you're sending two frameworks down to the user. This gets worse with shared utilities like lodash or date-fns. The solution involves externalizing common dependencies via tools like Webpack Module Federation's shared config, import maps, or a global UMD build loaded by the shell.
  2. Inconsistent User Experience: Different teams using different component libraries can lead to a disjointed, Frankenstein-like UI. The solution is a robust, framework-agnostic design system. All teams must consume the same design tokens (colors, spacing, typography) and ideally use a shared library of web components or framework-specific wrappers around a core component set.

The Trade-offs You Must Name

When you advocate for micro-frontends, you are also signing up for their complexity. You must be the first one to bring up the downsides in an interview.

  • Operational Complexity: You now have N repositories, N build pipelines, and N deployments to manage. Versioning, rollback, and monitoring become more complex.
  • UX Fragmentation: Maintaining a consistent look and feel requires strong governance and a mature design system. Without it, the app feels broken.
  • Cross-Cutting Concerns: How do you handle authentication, routing, internationalization, and analytics consistently? These are typically owned by the container application (the "shell"), which provides APIs for the micro-frontends to use.
  • Inter-App Communication: How does the "add to cart" button in the product-listing micro-frontend update the shopping-cart micro-frontend? This requires a clear contract, often using Custom Events on the window object, a shared event bus, or passing callbacks from the shell.

Acknowledging these challenges shows you have a realistic understanding of the architecture, not just a theoretical one.

Try it

In 15 minutes, sketch out a plan for a team that wants to migrate a large, legacy jQuery e-commerce site to React. They can't afford a full rewrite. How would you use the principles of micro-frontends to allow them to build the new "Product Detail Page" in React while the rest of the site remains in jQuery? Focus on how you would ensure independent deployment and handle the technology mix on a single page.

Next: We will cover the specific patterns for making these independent parts work together in Micro-Frontend Integration Strategies.

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

Incremental Static Regeneration (ISR)

Next

Micro-Frontend Integration Strategies