Cursor Software Engineer Interview Guide

Cursor software engineer interview prep: Merkle tree hashing and repo diffs, a transactional store, a streaming parser, scheduler design and the deep dive.

Topics: Cursor, Software Engineer, interview guide, Merkle tree, system design, technical screen, coding interview

Author: PracHub

Published: 11/23/2026

Cursor logo
Cursor · Software EngineerUpdated Nov 23, 2026 · Reviewed by PracHub

Cursor Software Engineer Interview Guide

Cursor software engineer interview prep: Merkle tree hashing and repo diffs, a transactional store, a streaming parser, scheduler design and the deep dive.

Questions in our bank by interview round

  • Technical Screen12 questions

On this page0% read
01 · Overview

Interviewing at Cursor

A Merkle tree built over a source repository, hashed so that two snapshots can be compared and the changed files found, is the problem Cursor software engineer candidates report again and again. Around it sits a smaller group of questions from the same world of code and tooling: an in-memory key-value store with transactions, a parser for markdown code fences that arrive in pieces, versioned editor settings shared between users and teams, two job schedulers and a project deep dive. If your screen is close, put most of your hours into the two Merkle sections below and work outward from there. Candidates place every question here in the technical screen, the scheduler designs and the career deep dive included, so this page can tell you a good deal about the screen and very little about anything that follows it.

Practice bank
12+ questions
Round types in our bank
1
Interview reports
2
02 · Difficulty

How hard is the Cursor Software Engineer interview?

From 12 labelled questions
  • Easy0%0 questions
  • Medium83%10 questions
  • Hard17%2 questions

Most questions land in the middle: hard enough to prepare for, rarely brutal.

Read 2 Cursor interview reports from candidates who went through this loop.

03 · Topic breakdown

What Cursor actually tests for

Share of 12 Software Engineer questions
  1. Software Engineering Fundamentals58% · 7
  2. System Design25% · 3
  3. Behavioral & Leadership8% · 1
  4. Coding & Algorithms8% · 1
04 · Question bank

The questions most likely to come up

12+ in the Cursor bank · sorted by popularity
  1. Design Versioned IDE Settings for Users and TeamsSystem DesignTechnical ScreenPremiumMedium
  2. Implement a Merkle-tree repo diffYou are given two snapshots of a source-code repository on disk, each represented by a root directory path. Implement a Merkle tree over the…Coding & AlgorithmsTechnical ScreenCodingHard
  3. Design an In-Memory Transactional Key-Value StoreSoftware Engineering FundamentalsTechnical ScreenPremiumMedium
  4. Connect a Project Deep Dive to Engineering Career DecisionsChoose a project for a technical deep dive, then explain how your interest in computing and later engineering decisions led you to that work. Connect…Behavioral & LeadershipTechnical ScreenMedium
  5. Design a CI/CD Job SchedulerSystem DesignTechnical ScreenPremiumMedium
  6. Unlock every Cursor questionModel solutions on all of them, plus the coding and SQL consoles.See Premium
  7. Implement Deterministic Merkle Hashing for a RepositorySoftware Engineering FundamentalsTechnical ScreenPremiumMedium
  8. Design a Durable Cron Job SchedulerDesign a durable cron job scheduler that runs recurring jobs according to a schedule. Explain schedule interpretation, dispatch, worker execution,…System DesignTechnical ScreenMedium
  9. Build a Streaming Markdown Code Fence ParserSoftware Engineering FundamentalsTechnical ScreenPremiumHard
  10. Build a Merkle Tree over a Directory with Hash Lookup and Tree DiffSoftware Engineering FundamentalsTechnical ScreenPremiumMedium
Practice 12+ Cursor questions

A Merkle tree built over a source repository, hashed so that two snapshots can be compared and the changed files found, is the problem Cursor software engineer candidates report again and again. Around it sits a smaller group of questions from the same world of code and tooling: an in-memory key-value store with transactions, a parser for markdown code fences that arrive in pieces, versioned editor settings shared between users and teams, two job schedulers and a project deep dive. If your screen is close, put most of your hours into the two Merkle sections below and work outward from there.

One repository problem, many wordings

Candidates place every question here in the technical screen, the scheduler designs and the career deep dive included, so this page can tell you a good deal about the screen and very little about anything that follows it.

The Merkle questions fall into two halves that are worth practicing separately. Some lead with the hash: make it deterministic, build the tree over what a repository contains, and explain the structure while you implement it. Others lead with the comparison: diff two snapshots of a repository on disk, return the hash of any folder or file on request, or start from the root hash, narrow down to the one file that was edited, then widen the search to every changed file inside the changed directories. In the coding version you are handed two root paths, and directories become inner nodes while files become leaves. Whichever wording you draw, expect to need both halves, because a diff is only as good as the hashes underneath it.

The other technical questions are pieces of infrastructure that must stay correct while new input keeps arriving, such as a write that may be rolled back or a scheduled run that came due while the scheduler was down, so list their awkward cases before you write any code.

The Merkle screen as candidates describe it

One candidate describes a 60-minute phone screen built entirely around the Merkle tree: represent a file system as a tree, write a function that returns a node's hash, write a second that compares two trees, and write every test yourself. In that version a directory could hold any number of children, so the binary tree from a textbook does not fit as-is. That candidate reports finishing every part and still being rejected, without saying why. Reaching the end is not a guarantee, so budget time for tests and for explaining your choices as you go.

Another candidate says the problem ran inside an actual repository, so they had to read real files from disk and lean on their language's standard library for walking directories and reading files. They felt the details mattered a lot even though it was the Merkle problem they had expected.

Rehearse under those conditions. Before the day, write a fixture that creates a scratch tree in a temporary directory (tmp_path in pytest, tempfile.TemporaryDirectory otherwise) with nested folders, an empty folder, an empty file, a binary file and two files that share a name in different folders. You can recreate that tree in seconds during the screen and point every test at it. Know the file calls you will reach for without looking them up: in Python os.scandir, Path.iterdir, is_dir, is_symlink, open(path, "rb") and hashlib.sha256 with repeated update calls; in Java Files.list, Files.isDirectory and MessageDigest; in Go os.ReadDir and crypto/sha256.

For an hour-long version, one workable split is five minutes agreeing on what counts as a change and what the diff returns, twenty on building and hashing the tree, twenty on the diff, and the remainder on tests and complexity. Write your first test before the diff function exists, so testing never depends on time left over.

Hashing a directory so two machines get the same answer

A hash helps with comparison only if the same contents produce the same root hash on every machine and every run. Most bugs in this family are quiet sources of nondeterminism, and naming them early is the strongest opening you have.

  • Order. Directory listings come back in whatever order the file system chooses. Sort children by name, using code point order instead of a locale-aware collation.
  • Encoding. The bytes you feed the hash function must be unambiguous. If a directory's hash is only its children's hashes glued together, a renamed file can leave the parent unchanged and an empty file can collide with an empty folder. Feed in a type tag, each child's name and its hash, with a separator or a length prefix so a name cannot run into the bytes beside it.
  • Reads. Open files in binary mode, so line endings and text encodings cannot alter the bytes, and read in fixed-size chunks so a large file never sits in memory whole.
  • Leaf scope. Hashing content alone gives two identical files in different folders the same hash, which helps with move detection and deduplication and complicates any lookup by hash. Hashing content plus path avoids that, at the price of making every move look like a deletion and an addition. Pick one and say why.
  • Exclusions. Ask about the .git folder, ignored files and symbolic links. Never follow a link blindly: a link pointing at an ancestor turns your recursion into an infinite loop.

When a version asks you to explain the structure, be ready to say why a tree beats a flat list of file hashes. Editing one file changes only the hashes on the path from that file to the root, so an incremental update recomputes a handful of nodes instead of the whole repository. Two trees whose hashes match at a folder are identical everywhere beneath it, which is what makes comparison cheap. A follow-up may ask you to keep node hashes in a map for lookup; decide first what that lookup returns when the same file content lives in three places.

Walking two trees down to the files that changed

Settle the output before you write the walk. Should the diff return added, removed and modified files as separate lists? Relative paths or node objects? Do directories appear in the result, or only files? In what order?

The walk has one rule that everything else depends on: when two nodes carry the same hash, stop. Never descend into a folder whose hashes match. To show that your diff respects this, add a test that edits one file deep inside a large tree and counts how many folders the diff descends into. That count should grow with the depth of the edit and stay flat as you add untouched folders, though the hash comparisons at each level still grow with how many children those folders hold.

The traps sit where the two trees disagree in shape:

  • Match children by name. Zipping two sorted child lists breaks the moment one side has an extra entry; use a dictionary keyed by name, or a merge walk over the sorted names.
  • A folder that exists on only one side means every file beneath it was added or removed. If the task wants changed files, report the files, which needs a small helper that lists every leaf under a node.
  • A path can be a file in one snapshot and a folder in the other. Treat it as a removal plus an addition, and test it, because most first drafts get it wrong.
  • Decide whether an empty folder that appears or disappears counts as a change, and say what you decided.
  • With content-only leaf hashes you can pair a removed file and an added file that share a hash and call it a move. Offer it as an extension and build it only if asked.

Be precise about cost. Building both trees reads every byte of both snapshots once, so the diff is cheap only after that work is done. When changes are sparse, the walk costs roughly the changed paths times their depth times the fan-out of the folders along them; in the worst case it visits the whole tree. The natural follow-up is how to avoid rereading an unchanged repository at all. The usual answer is a cache of leaf hashes keyed by path, size and modification time, trusted until one of those changes, which is the trade version control tools make.

A store that rolls back, settings in layers, fences that arrive in pieces

These three questions share one property: each holds state that the next input can overturn, and each turns on one early decision about how to represent that state.

The transactional key-value store. Before writing anything, ask for the exact operations and whether transactions nest. If they do, ask what an inner commit means while the outer transaction is still open. Then choose a representation and say what it costs. Copying the whole map when a transaction begins keeps reads simple and makes every begin as expensive as the store is large. A stack of change layers makes begin cheap and makes reads walk the stack. With layers, a delete inside a transaction needs a marker of its own, or an older value shows through from a lower layer. Handle a rollback or commit with no open transaction on purpose. If the store also answers an aggregate query, such as how many keys hold a given value, that count has to roll back with everything else.

The streaming code fence parser. Treat it as a line-oriented state machine fed chunks of any size. Keep the unfinished last line in a buffer, since a fence marker can be split across two chunks. Ask which fence rules apply. Under CommonMark, a fence is three or more backticks or tildes with up to three spaces of indentation, the opener may carry a language tag, and the closer must use the same character and be at least as long. Decide what you emit and when: plain text, a fence opening with its language, code, a fence closing. Then the latency question: how much do you hold back while a line is still ambiguous? Hold only the ambiguous tail and pass everything else through. If input ends with a fence still open, close it and say that you chose to. The test that catches most bugs feeds the same document through the parser split at every possible offset and checks that the output always matches a single-chunk parse.

Versioned settings for users and teams. This is a design question about data that is small, so spend your time on meaning. Ask about scopes and precedence: a team default a user can override, and possibly a team policy a user cannot. Ask what "versioned" covers: a history that can be rolled back, schema versions as settings are renamed or change type, or both. Then handle one user editing from two devices, one of them offline, and choose between per-key versions with last-writer-wins and a whole-document version checked on every write, including what the user sees when a write is rejected. An append-only change log per scope plus a materialized current view gives you history and fast reads, and clients can fetch resolved settings at startup and then ask for changes since the version they hold.

Picking the project you will defend in the deep dive

The behavioral question in this bank is a technical deep dive that starts before the project does. You choose the project, then trace how your early interest in computing and the engineering choices you made afterward brought you to it, instead of walking through your résumé in date order.

Pick a project with at least two decisions you could defensibly have made the other way, and a result you can put a number on. Then build the story backward from the project. Two or three earlier moments are enough, each a choice with its reason: the class or side project that pulled you toward systems work, the job you took for the problems it offered, the move from one part of the stack to another after a bug taught you something. Every link should explain a decision you made in the project itself.

For the technical half, pick the component you can take several levels deep, ideally one whose design traces back to a choice in your career story.

Cron jobs, CI builds and the run that came due during an outage

The two scheduler designs can share a skeleton, which you can draw once and adapt: durable run records, workers that can die mid-job and a scheduler that may restart at any moment.

For the durable cron scheduler, start with how a schedule turns into a time. Store each job with its next due time and compute the following one after each run, in the job's own time zone. Daylight saving produces a local time that never happens in spring and one that happens twice in the fall, so state which rule you apply. Dispatch comes next: a scheduler loop claims due jobs with a conditional update or a row lock that skips locked rows, writes a run record keyed by job and scheduled time so a retry cannot create a second run, and hands it to a worker that sends heartbeats while it works. A run whose heartbeats stop is retried once its lease expires, which means a job can execute twice, so the job itself must be safe to repeat. Then missed runs. After an outage, a job that came due six times can skip them all, run once, or run every missed slot; make that a per-job setting and defend a default. Running several scheduler instances for availability is the usual next step: row-level claims let them share work without a leader, and a lease-held leader is the other common choice.

A CI/CD scheduler adds dependencies and triggers. A build is a graph of steps (compile, then test shards in parallel, then deploy), and a step becomes ready when everything it depends on has passed. Workers carry labels for operating system or hardware, and a step waits for a worker whose labels match. Fair sharing across teams or repositories keeps one busy repository from starving the rest. When a newer commit lands on a branch, decide whether older runs on that branch get canceled. Retries need a policy that separates a flaky test from a real failure, and steps should hand artifacts to their successors through shared storage, never through one worker's local disk. Cron is triggered by time and its jobs are mostly independent, while CI is triggered by events and its steps depend on each other.

If you have built a job queue, a cron replacement or a build system, it can double as your deep-dive project, so practice the deep-dive question below alongside the two designs.

Batching file-watcher events before a re-index: one problem solved in full

Here is an original problem in the same territory, worked the way you would work it in a screen.

An editor watches a project folder and receives file events in order: created, modified, deleted, and renamed from one path to another. Re-indexing a file is expensive, so the indexer wants batches. Implement record and flush, where flush returns at most one entry per path describing its net change since the previous flush, then starts a new batch.

Start by clarifying. The coalescer never sees the disk, only events, so "net change" has to mean relative to the state at the last flush. Agree that events arrive in order on one thread, that paths are files (folders come later), and that the indexer handles created and modified the same way, by reading the file again, and handles deleted by dropping its entry.

Next, find the state. For each path you need two facts and a flag: whether it existed at the last flush, whether it exists now, and whether its contents may have changed. The first event for a path supplies the first fact. A creation means the file did not exist before; a modification or deletion means it did. With those facts, the output is a small table:

  • did not exist, exists now: created
  • existed, does not exist now: deleted
  • existed, exists now, contents touched: modified
  • did not exist and does not exist now: nothing, since the file came and went inside one batch

A rename becomes a deletion of the old path plus a creation of the new one. That forgets that the content moved, which costs one re-read; say so and come back to it.

CREATED, MODIFIED, DELETED = "created", "modified", "deleted"

class Coalescer:
    def __init__(self):
        self.state = {}  # path -> [existed_before, exists_now, touched]

    def _entry(self, path, first_kind):
        if path not in self.state:
            existed = first_kind != CREATED
            self.state[path] = [existed, existed, False]
        return self.state[path]

    def record(self, kind, path, new_path=None):
        if kind == "renamed":
            self.record(DELETED, path)
            self.record(CREATED, new_path)
            return
        entry = self._entry(path, kind)
        entry[1] = kind != DELETED
        if kind != DELETED:
            entry[2] = True

    def flush(self):
        out = []
        for path in sorted(self.state):
            before, now, touched = self.state[path]
            if now and not before:
                out.append((CREATED, path))
            elif before and not now:
                out.append((DELETED, path))
            elif before and now and touched:
                out.append((MODIFIED, path))
        self.state = {}
        return out

Then test the table and its corners. Create then modify gives created. Create then delete gives nothing. Delete then create gives modified, because the file existed at the last flush and its contents may differ now. Three modifications give one entry. Renaming a to b gives a deletion of a and a creation of b; renaming it back gives a single modification of a, which is conservative and fine, since a re-read costs less than a stale index. A modification with no earlier creation, which happens when the watcher missed an event, reports modified, harmless as long as the indexer treats modified as an upsert. Sorting the output by path keeps every test deterministic.

Each event costs constant time with a dictionary. A flush costs O(k log k) for the k paths touched since the last one, because of the sort; if the indexer does not need a stable order, drop the sort, compare sets in your tests, and the flush becomes linear.

In follow-ups, a deleted folder may arrive as a single event, so every tracked path under that prefix needs marking, which pushes you toward a sorted structure or a path trie. A branch checkout can touch thousands of files at once; past some threshold it is cheaper to drop the batch and rescan, comparing fresh file hashes against those stored at the last index, which is the Merkle comparison from earlier on this page. Timing is its own question: flush after a short quiet period, with a maximum wait so a file saved every second still gets indexed. Moves can be recovered by keeping the content hash of each deleted path and matching it against new files, so the indexer can reuse earlier work. A watcher that overflows and drops events should trigger a full rescan, since the batch can no longer be trusted.

A study plan: Merkle first, schedulers last

In week one, rebuild the Merkle tree from a blank file. Spend two days on the "Cursor Merkle hashing and construction questions" set, writing a deterministic directory hasher against your scratch-tree fixture from memory until it takes twenty minutes. Spend the next two on the "Cursor Merkle diff questions" set, adding the descent-counting test and the file-versus-folder test. On the fifth day, run one question from each set as a timed hour, talking out loud and writing every test yourself, then check your work against the list of failures below.

In week two, take the "Cursor transactional, streaming and settings questions" set. Give the key-value store forty-five minutes with nested transactions, build the fence parser with its split-at-every-offset test, and sketch the settings design on paper in thirty-five minutes, including a conflict between two devices. Use the last day to redo the Merkle variant you found hardest, in a different wording from the first attempt.

In week three, practice talking. Work the scheduler prompts in the "Cursor scheduler designs and the project deep dive" set aloud, forty minutes each, and give one whole session to missed runs and duplicate execution. Write your deep-dive story, time it and tell it to a friend who is allowed to interrupt. Two days before the screen, do a full mock of the Merkle problem, so the last thing you rehearse is the problem candidates report most.

Where Merkle and scheduler answers fall apart

  • Hashing children in listing order. The tree hashes one way on your laptop and another on the next machine, and the diff reports changes that do not exist.
  • Comparing paths that still carry each snapshot's root folder. The same file then has two different paths, and every file shows up as removed and re-added.
  • Rehashing every file under a folder each time the folder's hash is needed, instead of storing each child's hash once. The cost grows with depth times size, and it shows on a large repository.
  • Writing the test fixture by hand inside each test. One candidate had to write every test themselves, and a shared fixture is what makes ten small tests affordable inside an hour.
  • Testing the fence parser only with whole lines, which never puts a fence marker across a chunk boundary.
  • Computing the next cron time in the server's zone instead of the job's, which runs jobs at the wrong hour for users elsewhere and shifts them again whenever one of the two zones changes its clocks and the other does not.
  • Firing every missed run at once after an outage and flooding the workers, when the job only needed its latest run.
  • In the deep dive, describing what the team built without saying which decisions were yours.
15 · FAQ

Frequently asked questions

A Merkle tree over a repository. Candidates describe building a tree in which folders are inner nodes and files are leaves, computing a deterministic hash for each node, and comparing two snapshots to find which files changed. Some versions stress the hashing and an explanation of the structure; others stress the diff, hash lookups for any node, or narrowing from the root hash down to the edited files. Practice both halves, since a diff depends on the hashes beneath it.

One candidate who describes a 60-minute Merkle tree phone screen says they had to write all of the tests themselves, and another says the problem ran inside a real repository, reading actual files from disk. Prepare a fixture that builds a scratch directory with nested folders, an empty folder, an empty file and a binary file, and write your first test before the diff function exists so testing does not get squeezed out at the end.

Candidates report design questions from the technical screen: a durable cron scheduler, a CI/CD job scheduler, and versioned IDE settings for users and teams. Prepare one shared skeleton for the two schedulers, with durable run records, leases and heartbeats, run keys that make retries safe and a policy for missed runs. For the settings question, spend your time on precedence between team and user, version history and conflicting edits from two devices.

Sort each folder's children by name in code point order, never in the order the file system returns them. Feed the hash function an unambiguous encoding: a type tag for file or folder, each child's name and its hash, separated or length-prefixed. Read files in binary mode and in chunks. Decide whether symbolic links, ignored files and the version control folder are included, and never follow a link without guarding against cycles.

The reported one is a project deep dive. You pick a project, then connect how you got into computing and the engineering choices you made along the way to the decisions in that project, instead of reciting your career in order. Choose a project with at least two decisions you could have made differently and a measurable result, and be ready to go several levels deep on the component you know best.

Three weeks works if you already code most days. Spend the first week building and diffing Merkle trees over real folders under a one-hour limit, since that is the problem candidates report most. Use the second for the transactional store, the streaming fence parser and the settings design, and the third for the two scheduler designs and your deep-dive story, ending with a full Merkle mock two days before the screen.

CursorSoftware Engineerinterview guideMerkle treesystem designtechnical screencoding interview