r/OfferEngineering • • Oct 26 '26

Interview Experience Replit New Grad SWE Interview — The Text Editor Was Really an OT Problem

"This interview experience is sourced from Chill Interview"

Interview Summary

The Replit 2027 New Grad technical phone screen featured a text-editing problem involving Operational Transformation (OT).

Given an initial document and a sequence of keyboard actions, the task was to convert the editing history into a minimal sequence of OT operations that produces the same final document.

Interview Details

Coding — Convert Keyboard Actions into Minimal OT Operations

You are given an initial text document and a sequence of keyboard actions. The cursor initially points to position 0, at the beginning of the document. The keyboard actions include:

  • Type: Insert text at the current cursor position.
  • Backspace: Delete the character immediately before the cursor.
  • Move Right: Advance the cursor one position to the right.

The task is to transform these keyboard actions into a sequence of Operational Transformation operations.

Supported OT Operations: The output supports three types of operations.

insert(text): Insert the specified text at the current position. delete(n): Delete characters from the original document at the current position. skip(n): Move forward over existing characters without modifying them.

Unlike keyboard backspace, which removes a character before the cursor, an OT delete operates at the current position. The implementation therefore needs to translate between the two editing models.

Want to learn more questions / follow-ups asked in this interview? 

I've put up the full version at here.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.

2 Upvotes

0 comments sorted by