CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· State Machine

File Sync States (Dropbox-style)

The states a file goes through in a sync client like Dropbox: detected, chunked, uploaded, synced, and conflict handling when two devices edit the same file.

More System Design Interview Classics templates

Drawing diagram…

What this diagram shows

  • Files are split into chunks so only changed parts upload
  • A version check detects edits from another device
  • Conflicts keep both copies instead of losing work

Prompt used

State machine for a file in a sync client: Detected when a change is seen, Chunking into 4 MB blocks, Uploading only new blocks, Committing the new version to the metadata server, Synced. If the server has a newer version from another device it becomes Conflict and a conflicted copy is saved. Network errors move to Waiting and retry.

Mermaid code
stateDiagram-v2
  [*] --> Detected: Local change seen
  Detected --> Chunking
  Chunking --> Uploading: New blocks found
  Chunking --> Committing: No new blocks
  Uploading --> Committing: Blocks stored
  Uploading --> Waiting: Network error
  Waiting --> Uploading: Retry
  Committing --> Synced: Version accepted
  Committing --> Conflict: Server has newer version
  Conflict --> Synced: Conflicted copy saved
  Synced --> Detected: Edited again
  Synced --> [*]

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

SequenceSystem Design Interview Classics

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

Data FlowSystem Design Interview Classics

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

C4 ArchitectureProSystem Design Interview Classics

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.