Software Engineer • Junior-Level
Software Engineer • Junior-Level
High QualityPrep Other Coding Questions Asked by Replit
Continue with targeted prep from Replit's coding question bank.
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.
**Requirement — Preserve the Final
Unlock Full Details
Create a free account to unlock this interview experience report.