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
55

Frontend System Design · Lesson 55 of 86 · 4 min

Graceful Degradation and Fallback UIs

This is how you demonstrate you build for reality, not just the happy path.

After this, you'll be able to articulate a clear strategy for application resilience. You won't just say "we should handle errors"; you'll specify how and where to build fault tolerance into the UI, from the component level to the entire application.

Distinguish Graceful Degradation from Fallback UIs

These terms are often used interchangeably, but they aren't the same. Using them correctly in an interview signals precision.

Graceful degradation is a top-down, proactive strategy. You build the full-featured experience assuming a modern environment (latest browser, fast network), then systematically remove or simplify features for less capable environments. The core functionality remains, but the bells and whistles are stripped away.

Fallback UIs are a reactive strategy. They are specific, alternative UIs displayed when a part of your application fails at runtime. This isn't about browser capability; it's about handling transient states like network errors, API failures, or component crashes.

The interview question: "How do these concepts relate to Progressive Enhancement?"

Your answer: "Progressive Enhancement is the inverse of Graceful Degradation. You start with a baseline of core content and functionality that works everywhere, then add layers of enhancement for more capable browsers. Graceful Degradation starts with the enhancements and subtracts them. Fallback UIs are a tool used within either strategy to handle runtime errors."

Implement Component-Level Fault Tolerance

A single, non-critical component should never crash your entire application. The primary tool for preventing this in React is the Error Boundary. It's a class component that catches JavaScript errors in its child component tree and renders a fallback UI.

The trap: Candidates often forget this pattern exists and suggest try...catch inside functional components, which only works for imperative code (like event handlers), not for errors during rendering.

An Error Boundary is your answer to "How do you design a dashboard where a failing third-party widget doesn't take down the whole page?" You wrap each independent widget in its own ErrorBoundary.

Here is a minimal, reusable ErrorBoundary.

import React, { Component, ErrorInfo, ReactNode } from 'react';

interface Props {
  children: ReactNode;
  fallbackUI: ReactNode;
}

interface State {
  hasError: boolean;
}

class ErrorBoundary extends Component<Props, State> {
  public state: State = {
    hasError: false,
  };

  public static getDerivedStateFromError(_: Error): State {
    return { hasError: true };
  }

  public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
    // You would log this to a service like Sentry here.
    console.error("ErrorBoundary caught an error:", error, errorInfo);
  }

  public render() {
    if (this.state.hasError) {
      return this.props.fallbackUI;
    }

    return this.props.children;
  }
}

export default ErrorBoundary;

This component is a container. If anything inside it throws an error during render, the boundary catches it, logs it, and displays your predefined fallbackUI instead of a white screen.

Handle Data States Beyond a Simple Spinner

When a component fetches data, it exists in more states than just "loading" and "done". A robust design accounts for all of them. Your goal is to manage user perception and prevent layout shifts.

  1. Loading State: A spinner is the minimum. A skeleton UI is better. It mimics the shape of the eventual content, reducing perceived load time and preventing the page from jumping around when the real content appears. This is crucial for Core Web Vitals, specifically Cumulative Layout Shift (CLS).

  2. Error State: Don't just show "Error". Show an inline message explaining what failed (e.g., "Could not load recommendations") and provide a retry button. A full-page reload is a blunt instrument; a targeted refetch for the failed component is a much better user experience.

  3. Empty State: The API call succeeded, but returned no data. This is not an error. Instead of a blank space, render a clear message ("No products found matching your filter") and, if appropriate, a call to action ("Clear filters").

The trap: Only mentioning a loading spinner. Senior candidates discuss the UX and performance trade-offs between spinners, skeletons, and the importance of stable empty states.

Degrade Features Based on Environment

You can't assume every user has access to every browser API. Graceful degradation requires you to check for features before you use them. This is called feature detection.

For example, instead of just using the IntersectionObserver API for infinite scroll, you build a system that degrades gracefully if it's not available.

This flow ensures the core function—loading more content—is always available, even if the implementation is less efficient on older browsers.

The interview question: "How would you design a component that uses the Web Share API?"

Your answer: "First, I'd check if navigator.share is available. If it is, I'd render a button that calls it. If not, I'd gracefully degrade. The fallback could be a button that copies the URL to the clipboard, or it could show a set of traditional mailto: and social media links. The component's public API wouldn't change, but its rendered output would adapt to the environment."

This demonstrates an understanding of building for a heterogeneous web, not just a single browser. It's about resilience and reach.

Try it

Take a simple component that fetches and displays data. Implement fallbacks for its loading, error, and empty states. For the loading state, build a simple CSS-only skeleton UI that approximates the final content's layout.

Next: You'll learn how to measure the real-world impact of these failures with Real User Monitoring (RUM).

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

Error Reporting: Sentry and LogRocket

Next

Real User Monitoring (RUM)