Home
← All questions

Design a drawing tool (like Excalidraw/Figma-lite) | Frontend System Design

HardPremiumSystem Design

Frontend System Design interview practice: Frontend system design for a canvas-based drawing/whiteboard application.

Problem

Design a drawing tool where users create shapes, draw freehand, move/resize elements, and (optionally) collaborate in real time.

Discussion areas

  • Rendering: Canvas/WebGL vs SVG vs DOM — trade-offs (Canvas scales for many elements; SVG is easy for hit-testing/selection). Often a hybrid.
  • Scene model: list/tree of shapes { id, type, x, y, w, h, rotation, style, z }; a render loop redraws on change.
  • Interaction: tool modes (select, rectangle, pen, text), pointer events, hit testing, selection handles, drag/resize/rotate, snapping.
  • History: command pattern for undo/redo (store reversible operations or state snapshots).
  • Performance: layer/dirty-rect redraws, requestAnimationFrame batching, virtualize off-screen elements, throttle pointermove.
  • Persistence: serialize the scene to JSON; export to PNG/SVG.
  • Collaboration (advanced): CRDT or OT for concurrent edits, presence cursors, conflict resolution over WebSocket.
Premium question

Unlock the full model solution for this question with Mentoxis Premium.

Unlock with Premium