InterviewLegend

Design IDE Settings Sync for Users and Teams

Signature problem
Alex Chen24 min readGuide updated
In this lesson
  • Model users, teams and their settings as versioned layers that merge the same way on every device
  • Sync each editor with small change deltas, with notifications as hints and pulls as the truth
  • Work through precedence, offline edits, conflicts and rollback before the interviewer asks

Understanding the problem

The prompt

Something like this: design a system that stores IDE settings. It has two kinds of entity, users and teams, and a team's settings can be pushed to the users under it. Keep every editor a user runs in sync.

No prompt turns up more often in the Cursor (Anysphere) system design screen. Two candidates got it in 2026. In July a software engineer who was switching jobs had it as a phone screen and passed. In October a recruiter let an ML engineer choose between a coding screen and a design screen, and they picked design and got the same question. One July 2026 version of the prompt has users in more than one team and calls the settings versioned. The interviewer pushes on many details, and versioning and sync are the two named outright. The rest of this lesson covers the details most likely to come up next: how team and user values combine, edits made offline, conflicts and rollback.

It looks small, and in bytes it is. A settings file is a few kilobytes of keys and values. The hard part is meaning. When a team sets tab size to 2 and a member already chose 4, someone has to decide what the member's editor shows. It has to decide the same way on every machine the member uses. That answer can't change when one of them was offline for a week.

The Cursor angle
This sits right on Cursor's product. Cursor is built on the VS Code codebase, and its team dashboard already lets admins set privacy, model access and team rules for members. Expect the interviewer to care more about what a member sees, and why, than about servers.

Requirements

Functional requirements

Open with the two entities from the prompt and ask the questions that change the design. Can a user belong to more than one team? Assume yes, since one 2026 version of the prompt says so. Does "pushed" mean the team's value replaces the member's, or only fills in where the member hasn't chosen? A good design supports both and lets the admin pick per setting. Does the team need settings members can't override at all? Ask about an organization level above teams, too.

In scope

  • A user reads and changes their own settings from any of their devices
  • A team admin sets team settings, as defaults or as required, and members get them
  • Every editor shows the same effective settings for the same user
  • Edits made offline are kept and merged when the device reconnects
  • Every change is versioned, so it can be audited and undone

Below the line (call it out, then skip)

  • Installing extensions or themes, which sync as names only
  • Settings that live in a repo, which git already versions
  • Single sign-on and how users get added to a team
  • Secrets such as API keys, which belong in a separate vault

Non-functional requirements

The editor must never wait on this service to start. It reads the local copy and syncs in the background, so an outage means stale settings for a while and nothing worse. That one rule puts availability ahead of everything else on the read side. Correctness here means determinism. Given the same layers and the same team membership, every device must compute the same result. Precedence can't depend on which notification arrived first. Freshness can be loose. An online member should see a team change within a few seconds, and an offline one on reconnect. Nobody needs strong consistency across devices, as long as they all converge. Writes are rare next to reads. A person changes a setting now and then, but every editor launch reads them all. Ask for user and team counts. If the interviewer has none, say the design holds because the data per user is tiny and a team push is one write.

The object model, in words

The key idea is the layer. A layer is a set of settings owned by one user or one team. It holds keys and their values, and a version number that goes up by one on every change. A team's entries also carry a mode. A default fills in where the member hasn't chosen, and a required value wins over anything the member sets. Each user owns one personal layer. Each team owns one team layer, plus a list of members and which of them are admins. Then there's the change, which records one edit to one key. It keeps the old and new value plus who made it and from which device. It also notes the version the edit produced. Changes are kept in order. Audit and rollback both read from that one ordered list.

The thing we never store is a user's effective settings. Those get computed by merging the user's layer with the layers of every team they belong to. Stored copies would go stale the moment a team changed, and computing the merge is cheap because the layers are small. Each device remembers the last version it saw of each layer, and that number drives sync.

Where each record lives
TableFields
layerslayer_id · owner_type (user or team) · owner_id · version · updated_at
entrieslayer_id · key · value · mode (default or required) · changed_at_version
changeslayer_id · version · key · old_value · new_value · author_id · device_id · change_id
membershipsteam_id · user_id · role (member or admin) · joined_at
All four live in Postgres, keyed by layer id. The changes table is append-only. An entry remembers the version that last changed it, which is what makes per-key conflict checks possible.

The API

Five calls cover it. Writes always say which version the device built on, so the server can tell a fresh edit from one made against old data. Sync takes the versions a device already has and returns only what's newer.

The interface
RequestFire-and-forget
EditorSettings APIpull everything newer than what this device has
GET /sync?known={layer_id: version, ...}
changes per layer, or a snapshot if the device is far behind
EditorSettings APIupload edits made on this device
PUT /users/me/settings { base_version, changes }
new version, plus any keys that conflicted
Each change carries a change_id, so a retried upload is never applied twice.
Admin dashboardSettings APIchange team settings (admins only)
PUT /teams/{team_id}/settings { base_version, changes }
new version
Admin dashboardSettings APIundo a bad change
POST /layers/{layer_id}/rollback { to_version }
new version
A rollback is a new version with old contents. The counter never goes backwards.
Connection gatewayEditornudges when a layer changes
WebSocket /events
messages of the form { layer_id, version }

The architecture end to end

The design splits into a write path that commits changes and a notify path that tells devices to come and get them. Keeping them apart is what makes lost or repeated notifications harmless. A notification says only "this layer is now at version 42." The device then pulls the change itself. In the diagram, blue is outside the system (the editor and the admin), violet is a service we run and amber moves events. Green is stored state.

Loading diagram...

1) Start the editor. The Editor on each device reads its Local settings copy and computes effective settings before the window paints. Nothing on this path touches the network. Then, in the background, it opens a socket to the Connection gateway and calls sync with the version of each layer it holds. The Settings API answers with whatever changed while the editor was closed, often nothing at all. The cost of a cold start is one small request, and an outage only means the editor runs on yesterday's settings.

2) Change a personal setting. The user sets font size to 14. The editor applies it at once and writes it to the local copy with the version it was made against. Then it uploads. The API checks the key hasn't moved since that version and commits it to the Settings store. That one transaction bumps the layer to version 42, records the change and writes an outbox row. The Change feed picks the row up. Whether two devices editing at once collide is the second deep dive.

3) Reach the other devices. The Notify service reads "user layer is at version 42," finds that user's online devices, and nudges each through its gateway. Each device compares 42 with what it has. If it's newer, the device calls sync and gets back just the one change. A notification that arrives twice, or late, is harmless because the device checks the version first. The pull, never the nudge, is what moves data.

4) Push a team setting. An admin marks format on save as required on the Team admin dashboard. The API checks the Team directory that this caller is an admin there, then commits one change. That is one write no matter how many members there are. The fan-out that follows is of tiny nudges, one per online member device. Each device pulls the change and recomputes. How the team's value beats the member's own choice is the first deep dive.

Technology choices

  • The Settings store is Postgres. The data is small and relational (layers, members, ordered changes), and a write has to update an entry, bump a version and append a change together, which is what transactions are for. Run a synchronous replica so an acknowledged change survives losing the primary. Every query starts from a layer id, so if one database ever runs out of room, split the tables by layer id across several.
  • The Change feed is an outbox table read into Kafka. The naive version commits to Postgres and then publishes an event. If the API crashes between those two steps, the change is saved but nobody hears about it. Writing the event as a row in the same transaction closes that gap, and a relay process copies outbox rows to Kafka. Kafka keeps events in order per key, so keying by layer id means version 42 is never delivered after 43.
  • The Team directory is the memberships table, cached in Redis for the notify service. Membership changes rarely and gets read on every team push, which suits a cache. If Redis is down, notify reads from Postgres directly and runs slower. Pushes still arrive, just later.
  • The Connection gateway speaks WebSockets, and the Notify service keeps a Redis map of which gateway each online device is on. A WebSocket is a connection that stays open so the server can send a message whenever it wants, so a team push reaches open editors in seconds. If the map is lost, devices still catch up on their next sync. As a backstop, editors also run a slow background sync every few minutes.
  • The Local settings copy is a JSON file in the editor's user data folder plus a small queue of unsent edits, both on disk. Write the file to a temporary name and rename it into place, so a crash mid-write never leaves a half-written file the editor can't parse.

Name the popular tool, then defend the category behind it. Swap Postgres for any store with transactions, or Kafka for any ordered log, and the design still works. What the interviewer wants to hear is why each piece is there.

Potential deep dives

How do team settings and a user's own settings combine?

Take one member, Ana. Her team sets tab size to 2 and requires format on save. Months ago, Ana set tab size to 4 and turned format on save off. She is also on a second team that sets the theme to light, while her first team says dark. The interviewer wants to know what her editor shows for each of those, and what changes when she leaves one team. "The team's settings get pushed" can mean copy, override or fill in, and this is where you pin it down.

BadCopy the team values into every member's settings

Approach

When an admin pushes, write the team's values into each member's personal settings. The editor reads one flat layer and never needs a merge.

Challenges

It wipes out Ana's tab size of 4 with no way to get it back. A push to a team of thousands becomes thousands of writes, and a crash halfway leaves the team half updated. Nobody can tell whether a value came from Ana or from the team. When she leaves, the team's values stay behind in her settings forever. And the next push can't tell which copies Ana edited since, so it overwrites those too.

GoodSeparate layers, merged on read

Approach

Store the team layer once. Every device holds Ana's own layer plus each of her team layers and computes effective settings by putting her values over the team's. A push is one write to the team layer. Leaving a team just drops that layer from her merge, with nothing to clean up.

Challenges

It treats every team value as a suggestion, and some aren't. An admin who turns on a privacy setting needs it to stay on. Two teams that disagree about the theme need a tie rule. That rule has to be written down, or two devices will break the tie differently depending on the order they loaded layers.

GreatLayers with a mode per key and one fixed order

Approach

Each team entry is marked default or required. Effective settings come from one function, shared by the editor and the server, that checks layers in a fixed order. Required team values come first, then the user's own values, then team defaults, then the editor's built-in default. When two teams compete at the same step, the most recently changed entry wins. An organization could instead give each team a priority. Pick one rule and state it. The function returns the value and where it came from, so the editor can show "set by your team" and a lock icon.

Challenges

Two teams can both require different values for the same key, and a member of both gets the newer one. Warn the second admin when they save. A required key also hides Ana's own value without deleting it. Keep it stored, so it comes back if the lock is lifted or she leaves the team.

if any of the user's teams requires it: newest required team value
elif the user set it: the user's value
elif any of the user's teams sets a default: newest team default
else: the editor's built-in default
The Cursor angle
Cursor's own team rules work this way. Its docs apply rules in the order Team, then Project, then User, with earlier sources winning when guidance conflicts. Admins choose per rule whether members can turn it off. Pointing out that settings could follow the same model shows you've used the product.

How do versions keep every device in sync?

Versioning and sync are the two details candidates name outright, so expect the most time here. The setup is three devices for one user, each editing now and then, each sometimes asleep. They must end up identical, and no edit may vanish.

BadUpload the whole file, last upload wins

Approach

Each device uploads its full settings file whenever anything changes and downloads the stored file on a timer. Whatever was uploaded last is the truth.

Challenges

Say the laptop changes font size while the desktop changes the theme. When the desktop uploads second, its file still has the old font size, so the laptop's edit silently disappears. Polling on a timer is either slow, so changes take minutes to appear, or fast, so millions of idle editors poll for nothing.

GoodLayer versions, conditional writes and change deltas

Approach

Every committed change bumps the layer's version by one. A device uploads only the keys edited on it, along with the version it built on. If that still matches the server's, the write goes in. Otherwise the server refuses and returns what's newer, and the device merges and retries. Sync asks for the changes after the version the device holds. Nudges carry only a version, and a device ignores any number it already has, so late or repeated nudges do nothing.

Challenges

A whole-layer version is too coarse. The laptop and desktop editing different keys still collide, and one of them has to retry for no real reason. A device that slept for a year asks for every change since, which could be a lot of rows.

The Good tier's real flaw is that it treats any concurrent edit as a conflict. Settings change one key at a time, so the check should be one key at a time too.

GreatPer-key checks, idempotent uploads and snapshots

Approach

Every entry remembers the version that last changed it. A change to font size is accepted if font size hasn't changed since the device's base version, whatever else happened in between. So edits to different keys never collide. Each uploaded change carries a change id the device generated. If the device times out and retries, the server sees an id it has already applied and skips it. Changes stay in the log for a fixed window, such as 90 days. A device further behind gets a snapshot of the layer at its current version and starts over from there.

Challenges

The snapshot must match its version exactly, so read both in one transaction. Two devices changing the same key at the same time is a real conflict. That's the next deep dive.

device holds: user layer v41, team-web layer v17
GET /sync?known=user:41,team-web:17
<- user layer v42: editor.fontSize = 14
<- team-web layer v18: formatOnSave = true (required)
device saves both, recomputes effective settings

Under all of this sits one rule. Nudges are hints, and sync is the truth. The real-time updates lesson uses the same split, where the push channel says which record has a new version and a normal read fetches its contents. Lose every nudge for an hour and devices still converge on their next sync.

What happens to edits made offline?

Ana's laptop goes offline on a long flight. She switches to a light theme and sets tab size to 3. Later that day her desktop at home, still running, changes tab size to 2. Her team makes format on save required. When the laptop lands and reconnects, it uploads its queue: two edits, each tagged with the version it was made against. The server sorts each one into a case.

1

Nobody else touched the key, so apply it

The theme hasn't changed on the server since the laptop's base version, so the edit goes straight in. This should be the common case, since people rarely change the same setting on two machines in the same week.

2

Another device changed the same key

Tab size changed on the desktop too. Pick a rule and apply it the same way every time. Last writer wins per key is the usual choice for settings, where a value is small and replaced whole. Record the losing value in the change history so it can be restored.

3

The key is now required by a team: store it, but it has no effect

If the laptop had also turned format on save off, keep that in Ana's layer, since her choice is still hers. The merge shows the team's required value, and the editor marks it as locked. If the lock is lifted, her value returns.

4

The device was away longer than the log

If the laptop's base version is older than the retained change log, the server sends fresh snapshots first. Its queued edits are then checked against the snapshot versions, key by key, the same way.

"Last writer" needs a definition. The laptop's clock may be wrong, and its edits arrive hours after they were made. Order by arrival at the server and the laptop's older edit beats the desktop's newer one, which surprises the user. Order by device clock and a laptop set a day ahead wins every argument. A hybrid logical clock fixes both. That is a timestamp each device keeps close to real time, but never lets go backwards, and moves past any later time it hears from the server. Edits then sort roughly by when they were made, and ties break on the device id.

A per-key last-writer-wins value is already the simplest kind of CRDT, a data type that merges the same way on every replica. Bigger CRDTs, like the ones collaborative editors use for text, would be overkill. Settings values are short and replaced whole. The one exception is a setting that is itself a list or a map, such as file patterns to exclude from search. Merge those one entry at a time, so adding a pattern on one device and another pattern elsewhere keeps both.

The Cursor angle
Cursor's VS Code migration page points people moving between machines to exporting and importing a profile by hand. That chore is the problem this design solves. Use the offline laptop as your running example. It makes every conflict rule concrete and fits a product engineers carry between machines.

How do we roll back a bad team push?

The team layer sits at version 52. An admin pushes a required formatter setting with a typo, which makes it version 53, and every member's editor starts reformatting files wrong on save. The fix has to go out as fast as the mistake did, and it has to reach devices that already applied the bad version.

BadRestore the old row and lower the version

Approach

Restore the team layer's earlier contents from history or a backup and set its version back to 52.

Challenges

Every device that saw version 53 now holds a higher number than the server. When the next nudge says 52, they ignore it as old news, so the fix never reaches them. Worse, the next real edit reuses 53 with different contents. Two devices that both say "version 53" can now hold different settings.

GreatRollback is a new version with old contents

Approach

Rolling back to 52 writes version 54, whose entries match version 52, computed from the change log. It travels the normal path: one commit, one outbox row, nudges, pulls. Devices treat it like any other change, because it is one. History shows the bad push and the rollback as two entries, with who did each.

Challenges

A rollback should usually cover only the keys the bad change touched. Rolling back the whole layer would also undo good edits made since. The dashboard can offer both, defaulting to per change. Members who changed a value since stay untouched, because their own layer was never involved.

The same change log is the audit trail. Every row says who changed what and when, and from which device. The table only ever grows. Keep team-layer history for as long as the organization needs for audits. Personal history can be trimmed sooner, behind the snapshot.

Membership, permissions and changing the schema

Membership changes are settings changes in disguise. When Ana joins a team, the notify service tells her devices to fetch the team layer, and her effective settings change on the next merge. When she leaves, her devices drop that layer and recompute. Model the user's list of teams as another versioned record, so a device that was offline during a leave still finds out on sync. Permissions are checked on the server every time. Only admins of a team can write its layer, and only members can read it. The client's claim about its own role means nothing.

Settings themselves change shape over releases. A key gets renamed, or a boolean grows into three options. Store a schema version with each layer and migrate on read, so an old entry is translated when loaded. Old editor builds that don't know a new key just carry it along unread and never delete it. A safe rule is that the server never drops keys it doesn't understand.

Practice the core in code

The piece an interviewer can poke hardest is the precedence rule, so here it is as one class you can run. It stores user and team layers, handles joining and leaving teams, and answers what a user's editor should show and where the value came from.

The network, the devices and conflicts are left out. One version counter shared by the whole store stands in for the change log, and it is also what breaks ties between teams. What's left is the part every device must agree on: the same inputs always give the same answer.

1

Layered settings store: users, teams and required values

Medium
Problem
Editor settings come in layers. Each user has their own settings, and each team has settings it pushes to its members. A team entry is either a default, which a member can override, or required, which a member can't.

Write a class SettingsStore. set_user(user_id, key, value) and set_team(team_id, key, value, required) store a value, replacing any earlier entry for that key in that layer. Every set call takes the next number from one version counter shared by the whole store, starting at 1, and returns it.

join(user_id, team_id) and leave(user_id, team_id) return true if membership changed and false otherwise. get(user_id, key) returns [value, source], where source is "user" or a team id, or null if nothing applies.

Required entries from the user's teams win first. Then the user's own value. Then team defaults. When several of the user's teams compete at the same step, the entry with the highest version wins.

Input encoding. A test case is a JSON array of operations. The first entry is ["SettingsStore", []] and each later entry is [method, [args]]. The expected array holds each operation's return, with null for the constructor.
  1. SettingsStore()
  2. join("ana", "web")→ true
  3. set_team("web", "tabSize", "2", false)→ 1
  4. get("ana", "tabSize")→ ["2","web"]
  5. set_user("ana", "tabSize", "4")→ 2
  6. get("ana", "tabSize")→ ["4","user"]

A team default applies until Ana picks her own value. Then her value wins and the source says so.

How this uses the pattern

Keep three maps: user values, team entries with their mode and version, and each user's set of teams. The get method walks the precedence order and, at each team step, keeps the entry with the highest version.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Layered settings store: users, teams and required values

Loading...
Click "Run" to execute your code
The Cursor angle
This is the precedence function from the design, the one the editor and the server must share. The bugs that show up here are the ones interviewers probe: a required value losing to the user, a stored user value deleted by a lock, or a tie between teams broken by whichever loop ran first. Say the order out loud before you code.
Take it further
Natural extensions bring the rest of the design back. Add changes_since(user_id, version) that returns the keys whose effective value may have changed, which is what sync would send. Add a rollback that writes a new version with old contents. Then talk about where this runs: the same function on every device and on the server.

Follow-ups to be ready for

Settings per machine. Some values only make sense on one device, like a font that exists on the desktop or a path to a local tool. Let a key be marked as device-only, stored in the local copy and never uploaded. Sync then skips it, and every machine keeps its own value.

Settings that live in the repo. A project's own config travels with its code. Cursor's project rules, for example, live in a folder in the repo and are versioned by git. Keep those out of this service. The editor merges them in at the project step, between team and user, the same way Cursor's rules are ordered.

Rolling out a team change slowly. For a risky change, an admin could push to one group of members first, watch for complaints, then widen it. That's a target list on the change, and the merge only applies it to members on the list. It pairs naturally with rollback.

Size and abuse. Cap the size of a layer and the number of keys, and rate limit uploads per device. A buggy extension that writes a setting on every keystroke would otherwise flood the change log and nudge every device the user owns, many times a second.

What is expected at each level

Cursor posts two engineering titles, Software Engineer and Sr. Software Engineer, and this prompt has gone to a bachelor's-degree engineer switching jobs and to a PhD ML engineer alike. It's a screen, usually 45 to 60 minutes, so keep the setup short and get to the details.

Software Engineer

Roughly 80/20 breadth to depth. You get to separate user and team layers on your own and sketch the tables. A team push should come out as one write. You know that devices keep a local copy and sync later. Precedence and conflict rules can come out with some prompting. The bar: a complete, working design where you can say what Ana's editor shows and why.

Sr. Software Engineer

Closer to 50/50, and you lead. You raise the default versus required split and the multi-team tie rule before being asked. Versions, conditional writes and deltas come out clearly, along with why nudges are only hints, and you spot the dual-write gap the outbox closes. Last writer gets a proper definition, with clock skew and a hybrid clock, and rollback is a forward version. The bar: you handle the offline laptop end to end, and the interviewer only redirects.

If a recruiter mentions staff scope, add the parts nobody prompts: schema changes across old editor builds, staged team rollouts, and why lowering a version counter breaks every device.

Key Takeaways

  • ✓Store user and team settings as separate versioned layers, and compute effective settings by merging them, never by copying.
  • ✓One precedence order on every device: required team values, then the user, then team defaults, with the newest entry breaking ties.
  • ✓Sync with deltas after a known version. Nudges only say a layer changed, so lost or repeated ones are harmless.
  • ✓Check offline edits per key, keep losing values in history, and roll back by writing a new version.
Cursor interview guide

Know what Cursor asks before you walk in.

9 coding · 4 system design · 16 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Cursor System Design Interview QuestionsHad your Cursor interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.