Design Versioned IDE Settings for Users and Teams
Company: Cursor
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Technical Screen
Design a service that stores IDE settings for both users and teams. A team can push settings to its members, while users may also have personal settings. Clients can go offline, edit local state, reconnect, and receive duplicate or delayed notifications.
Cover the data model, effective-setting resolution, versioning, APIs, synchronization, conflict behavior, and operational reliability. Make the precedence between team and user settings explicit rather than leaving it to arrival order.
### Constraints & Assumptions
- A user may belong to more than one team.
- Settings are key-value documents, and updates may touch one key or many keys.
- Push delivery is at least once; clients can miss notifications while offline.
- Clients must be able to recover by reading authoritative state.
- Historical versions are retained long enough for audit and rollback.
### Clarifying Questions to Ask
- Can a team setting be mandatory, or may a user always override it?
- How is precedence defined when several teams set the same key?
- Is offline editing required, and which conflict policy should users see?
- Are settings small documents or potentially large binary assets?
### What a Strong Answer Covers
- Defines immutable versions and a deterministic effective-settings function.
- Uses optimistic concurrency or another explicit conflict mechanism for writes.
- Treats push as an invalidation hint and provides snapshot plus delta recovery.
- Makes repeated, missing, and reordered events harmless through version checks.
- Handles offline edits, team-membership changes, rollback, and multi-team precedence.
- Includes authorization, auditability, compaction, monitoring, and safe schema evolution.
### Follow-up Questions
1. How would a client distinguish “no value” from an explicit deletion or reset?
2. What happens when a user changes teams while offline?
3. How would you roll out a new setting schema to old and new client versions?
Quick Answer: Design versioned IDE settings shared across users and multiple teams, including deterministic precedence and offline edits. Cover authoritative recovery, delayed or duplicate notifications, conflicts, membership changes, rollback, authorization, audit history, and safe schema evolution.