Scrivio Interview library
LeadershipPrincipal6 min read · updated 13 November 2026

A document product built on a central server with operational transformation now gets requests for full offline editing on laptops and phones and for end-to-end encrypted documents. The core team proposes rewriting the sync engine on CRDTs.

As the senior technical leader, how do you decide whether to rewrite the collaboration engine, and how would you reduce the risk if you go ahead?

I would first size the demand: how many users need long offline sessions or end-to-end encryption, and what revenue or retention depends on it, because short offline gaps can be handled in today's OT design by queuing operations. If the demand is real, a CRDT engine is the right technical direction, since it lets clients merge offline edits and lets the server sync data it cannot read, but it brings metadata growth, a migration of every existing document and merges that are correct but surprising. So I would run it as a multi-year program behind an unchanged document API, start with a new document type or a contained feature, run both engines in shadow, convert documents gradually with tooling, and agree success measures and an exit point before starting.

Why this question is asked

Rewriting the core engine of a product is one of the riskiest decisions a technical leader can approve. The collaboration engine sits under every feature, every document every customer has ever written depends on it, and a mistake shows up as lost or corrupted work, the one failure users never forgive. Interviewers ask this to see whether we can separate a team's enthusiasm from the business need, and whether we know how to de-risk a rewrite if it is justified. In this answer, we will size the demand, weigh what CRDTs give and cost, understand the true scope, and then plan the risk reduction and the measures that decide success.

1Start With the Demand, Not the Technology

Two different requests arrived together, and they should be sized separately. Offline editing ranges from a train tunnel of two minutes to a week on a plane. End-to-end encryption means the server stores documents it cannot read, which matters to specific customers such as law firms, healthcare and governments.

I would ask product and sales for numbers: how many active users go offline for more than an hour, how many deals were lost or blocked for lack of encryption, and what those customers are worth. If the answer is that 2 percent of users want long offline sessions and no large deal depends on encryption, the right answer may be to improve today's engine. If a segment worth, say, 15 percent of revenue requires encryption within two years, the rewrite becomes a strategic investment.

2What Today's Design Can Already Do

A server-ordered OT engine already supports short offline gaps: the client queues operations with their base revision and, on reconnect, rebases them against the operations it missed. With good conflict handling this covers minutes to hours of offline work in most documents. It struggles with long divergence, many offline editors on the same document, and anything where the server must not read the content, because OT transforms positions on the server and therefore needs to see the operations.

Showing the team this boundary clearly is important. It turns a debate about technologies into a question about which of these needs the business actually has.

3What CRDTs Give and What They Cost

A CRDT engine lets any replica merge any set of edits in any order to the same result, so laptops and phones can edit for days and merge later, and the server can store and relay encrypted operations without interpreting them. Those are exactly the two requested features.

The costs are real. Per-character identifiers and tombstones grow document size; libraries compress them, but a large document with years of history can still use several times its plain size, and cleaning tombstones needs coordination. Every existing document must be converted, with its history, comments and suggestions. And CRDT merges are correct but can surprise users: two people offline for a week each restructure the same section, and the merged result contains both versions interleaved in a way neither expected. The product needs a design for showing and resolving such merges, not just an algorithm.

Today's engine against a CRDT engine
NeedServer-ordered OT todayCRDT engine
Offline for minutesworks by queuing operationsworks
Offline for days, many editorsfragile, large rebasesdesigned for it
End-to-end encryptionnot possible, server transformspossible, server only relays
Memory per documentclose to text sizelarger, needs compaction
Migration effortnoneevery document and feature
The rewrite is justified only if the rows where CRDTs win matter to the business.

4Understanding the Real Scope

The engine is not one component. Comments anchor to text ranges, suggestions are pending edits, formatting spans ranges, permissions decide who may send which operations, and search, export, version history and the mobile apps all read the document model. Changing the engine changes all of them. I would therefore treat this as a multi-year program, not a project, with a dedicated team that includes people who know the current OT engine deeply and people with CRDT experience, and with explicit time for the features around the engine, which is where most of the work hides.

5Reducing the Risk

The first protection is a stable boundary: the document API that every feature uses stays the same, and both engines implement it. Then we start where failure is cheap, either with a new document type, such as a notes product that needs offline use, or with a contained feature, such as offline mode for personal documents. That gives the new engine real users without putting the main product at stake.

Next we run both engines in shadow on real traffic: every operation applied to the OT engine is also applied to the CRDT engine, and we compare the resulting documents continuously. Differences are investigated until they are explained. Only then do we convert documents gradually, with tools that convert, verify and can roll back each document, starting with internal users, then small customers, and leaving the largest and oldest documents for last.

Step throughA staged path for the new engine
  1. Keep the document API stableboth engines behind it
  2. Launch on a new document typereal users, contained risk
  3. Shadow on main trafficcompare documents continuously
  4. Measures met for 3 months?
    YesConvert documents gradually with rollbackNoFix, or stop at the agreed exit point
  5. Retire the OT engineonly after conversion is complete

5 steps in order. Play them, or step through them one at a time.

Every stage can stop without harming existing documents.

6Agreeing Success Measures and an Exit Point

Before any code is written, we agree what success means and when we stop. Measures I would use are conflict reports per thousand documents, data-loss reports (target zero), operation latency at the 99th percentile, memory and storage per document compared with today, and load time for large documents. The exit point is concrete: if after, say, 12 months the shadow engine still shows unexplained differences or uses more than three times the memory, we stop, keep the learnings and perhaps the new document type, and invest in the existing engine instead. Writing this down early protects the team from the sunk-cost pressure that makes rewrites drag on.

7Follow-up questions

What if the team says the OT engine is too painful to maintain anyway?

That is a valid input, but it is a separate argument with its own evidence: incident counts, time to add a feature, defects in transform code. If maintenance cost is high, a refactor of the existing engine may deliver much of the benefit with less risk, and I would compare that option explicitly.

Can we offer encryption without a full rewrite?

Partially. Some products encrypt documents at rest with customer-managed keys, which satisfies many compliance needs while the server can still read content in memory. True end-to-end encryption, where the server never sees plaintext, does require an engine that merges on clients, so for those customers the CRDT path is the real answer.

How do you keep the business informed during a multi-year program?

With milestones that deliver something usable, such as the new document type in the first year, and a regular report on the agreed measures. That way the decision to continue is reviewed with data at each stage rather than made once and defended forever.

8Conclusion

In this answer, we saw that the decision starts with sizing the demand for long offline sessions and end-to-end encryption, because short offline gaps already work with today's OT engine. CRDTs are the right direction when those needs are real, but they bring metadata growth, migration of every document and surprising merges, and the engine touches every feature, so the rewrite is a multi-year program. We reduce the risk with a stable document API, a contained first use, shadow comparison, gradual conversion with tooling, and success measures and an exit point agreed in advance.

What to say in the interviewAbout 90 seconds aloud

Open with

I would not decide on the technology first. I would size the demand: how many users need offline sessions longer than an hour, and which deals or customers depend on end-to-end encryption.

Then, if they want more

Short offline gaps already work in our OT design by queuing operations and rebasing on reconnect, so if the demand is small I would improve what we have. If it is real, CRDTs are the right direction, because they merge edits in any order on the client and let the server relay encrypted operations it cannot read.

But I would be honest about the cost: metadata and tombstones grow documents, every existing document has to be converted, and some merges are correct but surprising, so the product needs a way to show them. The engine touches comments, suggestions, formatting, permissions and export, so I would run it as a multi-year program with people who know both models.

To reduce risk I would keep the document API stable, launch first on a new document type or offline personal documents, run both engines in shadow and compare results, and convert documents gradually with tools that verify and roll back.

And before starting, we agree measures such as data-loss reports, conflict reports, latency and memory per document, with an exit point if we miss them.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "As the senior technical leader, how do you decide whether to rewrite the collaboration...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/94f243df87/