What belongs in a micro-frontend shell (host) app, and what should stay out?

AdvancedMicro-frontends interview questionBy , updated 21 November 2026

Short answer

The shell, or host, should own only what every micro-frontend needs and no single team owns: booting the page, top-level routing, finding and loading remotes, the signed-in session, shared libraries, the page frame and failure handling. Business features, domain data and shared mutable state stay out. A good test: if a team has to change the shell to ship a feature, the shell owns too much.

Why the shell has to stay thin

Every app depends on the shell, so the shell is the one deploy that can break everyone at once. The more it contains, the more often it changes, and the more teams end up queuing for its release. A thin shell changes rarely, is easy to test, and lets the other apps move at their own speed, which is the whole reason for splitting the frontend. Micro-frontends: when do they help and when do they hurt? explains why that independence is the payoff.

What belongs in the shell

Bootstrapping. The HTML document, the entry script, polyfills if any, and the async boundary that federated apps need before shared modules are ready.

Top-level routing. The shell maps URL prefixes to apps, mounts the active one and unmounts the previous one. Each app routes inside its own prefix. See routing in micro-frontends.

Remote discovery and loading. The shell reads a manifest or import map that says where each app's current build lives, then loads it on demand. Keeping URLs in a runtime manifest rather than in the shell's build is what makes independent deploys and rollbacks possible.

Session and identity. Sign-in, token refresh and the current user live in one place. Apps receive the user and a way to get a token; they do not each implement login.

Shared runtime libraries. The shell provides the single copy of React, the router and anything else that must be a singleton. Version rules for those are covered in sharing React without loading it twice.

The page frame. The outer layout, and often the top navigation and footer. Some organisations make the header its own micro-frontend owned by a platform team, which is fine; what matters is that one owner decides the frame.

Failure handling. An error boundary and timeout around every remote, a fallback when an app fails to load, and the shared 404 and error pages.

Cross-cutting services. Telemetry setup, feature flag evaluation, locale and theme. The shell initialises them once and hands apps a small API, so every error report carries the app name and build id.

The contract between shell and apps

Make the boundary explicit. A mount function with a typed set of inputs is easy to version and test:

// published by the shell as a small types package
export interface MountContext {
  basePath: string;                       // "/account"
  user: { id: string; roles: string[] } | null;
  getToken(): Promise<string>;
  navigate(to: string): void;             // cross-app navigation through the shell
  events: { emit(type: string, detail: unknown): void; on(type: string, fn: (d: unknown) => void): () => void };
  flags: { isOn(name: string): boolean };
}

export type MountFn = (el: HTMLElement, ctx: MountContext) => () => void; // returns unmount

Everything an app gets from the shell goes through this object. Nothing is read from window globals, and nothing is imported from the shell's source. Additive changes to the context are safe; removing or renaming a field is a breaking change that needs a new version alongside the old one. For how apps talk to each other through that event channel, see how micro-frontends communicate.

What should stay out

  • Business features. A checkout step, a search filter or a dashboard widget belongs to the team that owns that domain, even if several pages show it.
  • Domain state. A global store that every app reads and writes couples their releases together. Each app owns its data and fetches it from APIs.
  • The design system's components. Ship them as a versioned package or a federated shared module with clear version ranges, not as code inside the shell that apps reach into.
  • A shared "utils" grab bag. It grows without an owner, and every change to it becomes a shell release.
  • Per-app configuration. API endpoints and feature settings for one app belong in that app's own config, not in the shell build.
  • Global CSS beyond a reset and tokens. Anything more leaks into every app; see isolating CSS in micro-frontends.

Grey areas

Some pieces could go either way, and the answer depends on ownership more than on code:

Piece In the shell when Outside when
Top navigation It is simple and rarely changes A team iterates on it often
Notifications or a cart badge Only the count is shown It has real behaviour, so it becomes a small remote
Permissions Coarse checks, such as "signed in" or "is admin" Fine-grained rules that only one domain understands
Analytics Setup, page views and context Domain events, which each app sends itself

Common follow-up questions

Should the shell be built with a framework?

It can be, and usually is the same framework as the apps so shared singletons line up. Some teams write the shell with very little framework code so it can host apps on different frameworks during a migration.

Can the shell render on the server?

Yes. The shell can render the frame and the active app's HTML on the server, but then the composition layer has to know how to server-render each app, which adds a contract on top of the client one.

Who owns the shell?

A platform team, usually, with a short review path for small changes. If nobody owns it, it becomes the place where everyone puts things that have no other home.

How does a shell handle a remote that fails to load?

It catches the failed import, shows a fallback inside that area, reports the error with the app name, and keeps the rest of the page working. Building that behaviour is part of building a micro-frontend orchestrator.

Mistakes to avoid

  • Letting the shell accumulate features because it is the one place every page loads

  • Passing data to apps through window globals instead of a typed mount context

  • Hard-coding remote URLs in the shell's build, so every app deploy needs a shell deploy

  • A shared global store that turns independent apps back into a monolith

  • Shipping the shell without an error boundary around each remote

Practise it in code

Interviewers rarely stop at the definition. These questions open in an editor with tests.

  1. Design a micro-frontend shell with independent deployment and shared dependency versioningHard60 minFree
  2. Design a super-app shell like Paytm or PhonePe that hosts mini-apps: loading, isolation, shared sign-in and versioningHard55 min
  3. Build a micro-frontend orchestrator: app lifecycles, route matching, queued navigations and broken appsHard60 min
  4. Design a large enterprise React application with micro-frontends, permissions, and deployment strategiesHard60 min
  5. Resolve Module Federation shared dependencies: semver ranges, singletons, strictVersion and fallbacksHard60 min