Enable secure offline reservation caching

Quick Overview

This question evaluates a candidate's ability to design offline-capable web architectures, covering Progressive Web Apps, Service Workers, IndexedDB schema and metadata, synchronization and conflict-resolution strategies, and client-side encryption and privacy protections for reservation data.

Enable secure offline reservation caching

Company: Airbnb

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

If the app must support offline caching of reservation information, how would you design it? Specify what to cache in IndexedDB, how the Service Worker intercepts requests, background sync and retry policies, versioning and invalidation, and conflict resolution after reconnect. Address security: which data is sensitive, how to encrypt at rest in the browser, key derivation and storage, token lifetimes/refresh, PII minimization, and protections against XSS/CSRF leaking cached data. Describe testing and auditing plans.

Quick Answer: This question evaluates a candidate's ability to design offline-capable web architectures, covering Progressive Web Apps, Service Workers, IndexedDB schema and metadata, synchronization and conflict-resolution strategies, and client-side encryption and privacy protections for reservation data.

|Home/System Design/Airbnb
Airbnb logo
Airbnb
Aug 12, 2025, 12:00 AM
hardSoftware EngineerOnsiteSystem Design
20
0

System Design: Offline Caching for Reservations (PWA)

Design a web application that supports offline access to reservation information. The app is a progressive web app (PWA) that uses a Service Worker and IndexedDB. Assume users need to see their upcoming reservations and critical trip details when offline.

Specify the following:

Data Caching

  1. What data to cache in IndexedDB (e.g., reservations list, details, assets). Identify which fields are necessary offline and which must never be cached.
  2. How to structure the IndexedDB stores and metadata to support consistency and encryption.

Networking and Synchronization

  1. How the Service Worker intercepts requests to serve cached data and update in the background (e.g., stale-while-revalidate for GETs).
  2. Background sync for queued writes (e.g., modifications/cancellations). Define retry strategy, backoff/jitter, idempotency, and when to give up.
  3. Versioning and cache invalidation using ETags/If-None-Match or If-Match, TTLs by data type, and cache busting on logout.
  4. Conflict resolution after reconnect: how to detect conflicts and merge or surface them to the user.

Security and Privacy

  1. Identify sensitive data (PII/secrets) vs. non-sensitive.
  2. How to encrypt cached data at rest in the browser (algorithms, key hierarchy), key derivation and storage, and how keys are unsealed on login.
  3. Token lifetimes and refresh strategy compatible with a Service Worker.
  4. PII minimization choices: what to omit or mask.
  5. Protections against XSS/CSRF exfiltrating cached data and secrets.

Testing and Auditing

  1. A test plan covering offline/online transitions, sync correctness, encryption, and failure injection.
  2. A security review and audit plan, including logging/telemetry without leaking PII.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...