PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Amazon

Design a keyboard and mouse input system

Last updated: Jun 15, 2026

Quick Overview

An Amazon software-engineer system-design screen: design a system that captures keyboard and mouse events and reconstructs exactly what the user typed. It tests low-latency event capture, total ordering across multiple devices, IME/composition and grapheme-safe text reconstruction, mouse selection and clipboard/undo-redo, plus durable persistence with deterministic crash-safe replay.

  • hard
  • Amazon
  • System Design
  • Software Engineer

Design a keyboard and mouse input system

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

##### Question Design an input processing system that captures keyboard and mouse events and can reliably reconstruct **what the user typed** (answering "what did the user input?"). The system must support multiple input devices, preserve a total ordering of events across them, persist an event log, and allow replay to derive the final text. Cover the following: 1. **Event capture and modeling** — handle key down/up, key repeat (auto-repeat), modifier keys, backspace/delete, and text composition. Define the data models for low-level events, normalized/canonical events, derived high-level operations, and sessions. 2. **Mouse and selection** — handle mouse clicks, movement, scroll, double-click (and word/line selection), drag-based text selection, and cursor movement. 3. **Clipboard and editing** — support copy, cut, and paste, plus undo and redo with sensible transaction grouping. 4. **Text reconstruction and IME** — reconstruct user-visible text from the text-input pipeline (TextInput / composition commit), correctly handling IME composition sequences (CompositionStart/Update/End), dead keys, and Unicode grapheme clusters (emoji, combining marks). Do **not** infer text from raw key codes. 5. **Ordering, timestamps, and concurrency** — maintain monotonic timestamps and a total order across multiple devices; discuss event queues, buffering/back-pressure, and thread-safety. 6. **Robustness** — handle debouncing (key/button bounce, mouse-move coalescing), double-click detection, and lost or duplicated events. 7. **APIs** — expose an interface such as `recordEvent(event)`, `getCurrentText()`, `getSelectionRange()`, `undo()`, `redo()`, plus session control and replay (`startSession`, `endSession`, `replay`). 8. **Persistence, recovery, and replay** — persist an append-only event log, support deterministic replay to rebuild final text, and recover correctly after a crash (snapshots + write-ahead log). 9. **Quality** — describe the high-level components, latency/throughput/memory targets, a testing strategy, and failure handling.

Quick Answer: An Amazon software-engineer system-design screen: design a system that captures keyboard and mouse events and reconstructs exactly what the user typed. It tests low-latency event capture, total ordering across multiple devices, IME/composition and grapheme-safe text reconstruction, mouse selection and clipboard/undo-redo, plus durable persistence with deterministic crash-safe replay.

Related Interview Questions

  • Design a Log Collection System - Amazon (medium)
  • Design Human Avoidance for Warehouse Robots - Amazon (medium)
  • Design a High-Availability Load Balancer - Amazon (hard)
  • Design a Ride-Hailing Matching System - Amazon (medium)
  • Design a cloud database write path and recovery - Amazon (hard)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
4
0
Question

Design an input processing system that captures keyboard and mouse events and can reliably reconstruct what the user typed (answering "what did the user input?"). The system must support multiple input devices, preserve a total ordering of events across them, persist an event log, and allow replay to derive the final text. Cover the following:

  1. Event capture and modeling — handle key down/up, key repeat (auto-repeat), modifier keys, backspace/delete, and text composition. Define the data models for low-level events, normalized/canonical events, derived high-level operations, and sessions.
  2. Mouse and selection — handle mouse clicks, movement, scroll, double-click (and word/line selection), drag-based text selection, and cursor movement.
  3. Clipboard and editing — support copy, cut, and paste, plus undo and redo with sensible transaction grouping.
  4. Text reconstruction and IME — reconstruct user-visible text from the text-input pipeline (TextInput / composition commit), correctly handling IME composition sequences (CompositionStart/Update/End), dead keys, and Unicode grapheme clusters (emoji, combining marks). Do not infer text from raw key codes.
  5. Ordering, timestamps, and concurrency — maintain monotonic timestamps and a total order across multiple devices; discuss event queues, buffering/back-pressure, and thread-safety.
  6. Robustness — handle debouncing (key/button bounce, mouse-move coalescing), double-click detection, and lost or duplicated events.
  7. APIs — expose an interface such as recordEvent(event) , getCurrentText() , getSelectionRange() , undo() , redo() , plus session control and replay ( startSession , endSession , replay ).
  8. Persistence, recovery, and replay — persist an append-only event log, support deterministic replay to rebuild final text, and recover correctly after a crash (snapshots + write-ahead log).
  9. Quality — describe the high-level components, latency/throughput/memory targets, a testing strategy, and failure handling.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.