Sanjaay Gowda T S
Microsoft Corporation practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Maintain a shared document through retries

Software engineeringHardConcept

Original practice scenario: Design a hypothetical cloud document editor where users insert text concurrently and connections drop. What must an edit protocol guarantee before discussing implementation choices?

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Start with convergence, stable operation identity and an explicit user-visible conflict policy. Reliable delivery does not imply that independently ordered text edits produce the same document.

Work through it

  1. Describe operations using stable character or position references and track the document revision or causal state against which each edit was created.
  2. Choose a consistent transformation or replicated-data approach, then define how concurrent inserts, deletes and undo interact.
  3. Deduplicate retried operations, persist acknowledgments and replay from checkpoints; test all arrival permutations for a small set of conflicting edits.

Tradeoffs to discuss

  • Central ordering simplifies reasoning but adds coordination; local-first editing improves offline responsiveness while increasing metadata and reconciliation complexity.

Common pitfalls

  • Undo should reverse the user intention rather than blindly restoring an obsolete document snapshot.
  • Include cursor movement and deleted anchors in tests instead of validating only final text length.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub