← Google Interview Insights

Google·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Apr 2026

Summary

Google system design round for a software engineer role, focused entirely on building a collaborative notes service. The depth they expected was pretty serious, covering everything from conflict resolution strategies to how you'd scale a hot document with thousands of concurrent editors.

Questions Asked (7)

Q1

Design a collaborative notes service that supports real-time multi-user editing, offline sync, and basic version recovery.

System DesignTechnical Trade-offsData Modeling
Author's notes

This was the core question and it ate the whole session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, consistency, conflict resolution) and then design a high-level architecture that separates real-time collaboration, offline sync, and versioning concerns. Focus on data modeling with CRDTs or OT for conflict-free merging, and describe how offline edits are synced and versions are stored for recovery.

Pro tip: Emphasize trade-offs between consistency and availability, and propose a hybrid approach (e.g., CRDTs for text, version vectors for causality) to show depth. Also, mention how you'd handle Google-scale challenges like sharding and latency.

1. Clarify Requirements and Scope

Ask about expected scale (users per document, concurrent editors), consistency needs (strong vs eventual), offline duration, and version recovery granularity. This sets the stage for design decisions.

2. High-Level Architecture

Outline components: client apps, real-time collaboration service (WebSocket servers), sync service, storage layer (document store, version store), and conflict resolution engine. Consider using a pub/sub system for scalability.

3. Data Modeling and Conflict Resolution

Choose a data model: CRDTs (e.g., Yjs) or OT for text; version vectors for causality. Explain how operations are merged, and how offline edits are represented and synced upon reconnection.

4. Offline Sync and Version Recovery

Describe offline storage on client (IndexedDB), sync protocol (delta sync, conflict detection), and versioning strategy (snapshots + operation log). Explain how to recover a previous version (e.g., by replaying operations or restoring snapshot).

5. Scalability, Reliability, and Trade-offs

Discuss sharding by document ID, replication for fault tolerance, and trade-offs (e.g., CRDT overhead vs OT complexity). Mention monitoring, rate limiting, and security (access control).

Key Points to Mention

  • CRDTs vs OT: trade-offs in complexity, performance, and offline support
  • Version vectors or Lamport timestamps for causality and conflict detection
  • Offline sync protocol: operation-based sync, delta compression, and conflict resolution
  • Version recovery: snapshots + operation log, time-travel, and storage optimization
  • Scalability: sharding, WebSocket connection management, and pub/sub for real-time updates
  • Data consistency models: eventual consistency for collaboration, strong consistency for version metadata

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle concurrent edits from multiple users without losing anyone's changes?

System DesignTechnical Trade-offs
Author's notes

I knew last-write-wins was wrong here and said so immediately, which seemed to land well.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what type of data (text, structured, binary), what consistency guarantees are needed, and what user experience is expected. Then discuss common concurrency control strategies like optimistic locking, operational transformation (OT), and conflict-free replicated data types (CRDTs), explaining their trade-offs. Finally, propose a concrete solution tailored to the scenario, highlighting how it prevents data loss and ensures convergence.

Pro tip: Demonstrate awareness of real-world systems: mention that Google Docs uses OT and that CRDTs are used in distributed databases like Redis and Riak. Also, emphasize the importance of user experience—sometimes showing conflicts to users is better than silently resolving them.

1. Clarify Requirements

Ask about the data model, expected concurrency level, consistency requirements (strong vs eventual), and user experience goals (e.g., real-time collaboration vs offline editing).

2. Identify Core Challenges

Explain the fundamental problem: concurrent operations can conflict, leading to lost updates or inconsistent state. Mention issues like race conditions, network partitions, and latency.

3. Evaluate Strategies

Compare approaches: pessimistic locking (simple but poor UX), optimistic locking with versioning (good for low contention), OT (complex but real-time), and CRDTs (eventual consistency, offline-friendly). Discuss trade-offs in complexity, latency, and consistency.

4. Propose a Solution

Recommend a specific approach based on requirements. For example, for a collaborative editor, use OT with a central server; for a distributed system, use CRDTs. Explain how it handles conflicts and ensures no changes are lost.

5. Address Edge Cases and Scalability

Discuss handling network partitions, offline edits, and scaling to many users. Mention techniques like version vectors, tombstones, and garbage collection.

Key Points to Mention

  • Optimistic concurrency control with version numbers or timestamps
  • Operational Transformation (OT) and its use in Google Docs
  • Conflict-free Replicated Data Types (CRDTs) and their properties (commutativity, idempotence)
  • Last-write-wins (LWW) and its limitations
  • User experience considerations: merge conflicts, undo/redo, and presence indicators
  • Trade-offs between consistency, availability, and partition tolerance (CAP theorem)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Why would you choose CRDTs over Operational Transformation, or the other way around?

Technical Trade-offsSystem Design
Author's notes

Follow-up to the concurrency question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both CRDTs and OT, then compare them across key dimensions like consistency model, network requirements, and complexity. Conclude with a recommendation based on the specific use case, emphasizing that the choice depends on factors like offline support, scalability, and centralization.

Pro tip: Demonstrate awareness of real-world systems: mention that Google Docs uses OT with a central server, while CRDTs are used in decentralized systems like Automerge or Yjs. This shows you understand practical trade-offs beyond theory.

1. Define the concepts

Briefly explain what CRDTs (Conflict-free Replicated Data Types) and OT (Operational Transformation) are, focusing on their core purpose: enabling collaborative editing.

2. Compare key dimensions

Contrast them on consistency (strong eventual vs. sequential), network topology (peer-to-peer vs. client-server), and complexity (OT requires central server and transformation functions; CRDTs are more complex data structures but work offline).

3. Discuss trade-offs

Highlight that OT is mature, efficient for text, but requires a central server and can be tricky with concurrency; CRDTs are decentralized, support offline, but have higher memory overhead and can be complex to implement.

4. Apply to use cases

Give examples: choose OT for centralized, real-time collaborative editors (e.g., Google Docs); choose CRDTs for decentralized, offline-first apps (e.g., local-first software, peer-to-peer collaboration).

5. Conclude with a recommendation

State that the choice depends on requirements: if you need a central server and efficient text editing, OT; if you need decentralization and offline support, CRDTs.

Key Points to Mention

  • Consistency models: OT provides strong consistency with a central server; CRDTs provide strong eventual consistency.
  • Network topology: OT typically requires a central server; CRDTs can operate in peer-to-peer or decentralized networks.
  • Complexity: OT requires transformation functions and can be complex with many operations; CRDTs have complex data structures but simpler merge logic.
  • Offline support: CRDTs naturally support offline editing and merging; OT struggles with offline without a central server.
  • Scalability: OT can be efficient with a central server but may bottleneck; CRDTs scale better in distributed systems but have metadata overhead.
  • Real-world examples: Google Docs uses OT; Automerge, Yjs, and some decentralized apps use CRDTs.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you handle clients that go offline, make edits locally, and then reconnect?

System DesignTechnical Trade-offs
Author's notes

Talked about buffering operations locally with idempotency keys, then replaying them against the server on reconnect.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as the type of data, consistency needs, and scale. Then propose a solution using a sync protocol with conflict resolution, offline storage, and change tracking. Finally, discuss trade-offs and potential optimizations.

Pro tip: Emphasize that conflict resolution should be domain-specific and that you would involve product managers to define acceptable behavior. Also, mention the importance of idempotency and versioning to handle retries and out-of-order updates.

1. Clarify Requirements

Ask about the data model, consistency requirements (strong vs eventual), expected offline duration, and scale. This shows you don't jump to solutions.

2. Design Offline Support

Propose local storage (e.g., IndexedDB, SQLite) and a change log to track edits made while offline. Ensure the client can queue operations.

3. Sync Protocol

Outline how the client syncs on reconnect: send local changes, receive remote changes, and reconcile. Use version vectors or timestamps to detect conflicts.

4. Conflict Resolution

Discuss strategies like last-write-wins, operational transformation, or CRDTs. Explain that the choice depends on data type and business rules.

5. Trade-offs and Edge Cases

Address trade-offs (e.g., complexity vs consistency), handle partial failures, and consider security (e.g., authentication during sync).

Key Points to Mention

  • Conflict resolution strategies (LWW, OT, CRDTs) and their trade-offs
  • Versioning and change tracking (e.g., vector clocks, timestamps)
  • Idempotency and retry mechanisms for sync operations
  • Data consistency models (strong vs eventual) and their implications
  • Scalability considerations (e.g., sync frequency, payload size)
  • Security and authentication during offline and sync

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you recover a note to an earlier version?

System DesignData Modeling
Author's notes

Periodic snapshots plus the operation log in between.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what kind of note (collaborative document, personal note), what granularity of versions, and what recovery means (full restore vs. selective revert). Then propose a versioning system that stores immutable snapshots or deltas, and describe how to retrieve and apply a specific version. Finally, discuss trade-offs like storage cost, performance, and conflict resolution.

Pro tip: Emphasize that versioning should be designed as an append-only log with immutable entries, and mention that you'd use a combination of periodic snapshots and incremental deltas to balance storage and recovery speed.

1. Clarify Requirements

Ask questions to understand the scope: Is this a single-user or collaborative note? How many versions must be retained? What is the expected recovery time? Should recovery be a full revert or allow cherry-picking changes?

2. Design Versioning Model

Propose a data model: store each version as an immutable snapshot or as a sequence of deltas (e.g., operational transforms or CRDTs for collaboration). Consider using a version tree for branching.

3. Storage and Retrieval Strategy

Decide on storage: use a database with versioned rows, a blob store for snapshots, or a log-structured store. Implement efficient retrieval by indexing versions and using snapshots to avoid replaying all deltas.

4. Recovery Process

Describe the steps to recover: given a version ID, fetch the nearest snapshot and apply deltas up to that version, then present it to the user. For collaborative notes, handle conflicts by merging or creating a new branch.

5. Trade-offs and Edge Cases

Discuss trade-offs: storage overhead vs. recovery speed, retention policies, and handling concurrent edits. Mention garbage collection for old versions and access control for recovery.

Key Points to Mention

  • Immutable append-only version history to ensure auditability and prevent data loss.
  • Use of snapshots and deltas to optimize storage and recovery time.
  • Version identifiers (e.g., timestamps, sequence numbers, or UUIDs) and indexing for fast lookup.
  • Conflict resolution strategies for collaborative editing (OT, CRDT, or three-way merge).
  • Retention policies and garbage collection to manage storage costs.
  • Access control and permissions for who can recover versions.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

How would you scale the collaboration service if a single note had thousands of simultaneous viewers?

System DesignTechnical Trade-offs
Author's notes

This was the curveball at the end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as read/write ratio, latency, consistency, and scale. Then propose a scalable architecture that separates concerns: use a fan-out service to distribute updates, partition viewers across multiple servers, and employ a pub/sub system for real-time communication. Discuss trade-offs between consistency, latency, and cost, and consider optimizations like batching, delta compression, and edge caching.

Pro tip: Demonstrate awareness of Google's infrastructure by mentioning internal tools like Pub/Sub, Spanner, or Firebase, and emphasize the importance of monitoring and gradual rollout to handle scale gracefully.

1. Clarify Requirements

Ask questions to understand the expected scale, read/write patterns, latency requirements, and consistency needs. This ensures your solution is tailored to the problem.

2. High-Level Architecture

Outline a scalable architecture: load balancers, stateless services, pub/sub for real-time updates, and a distributed cache. Explain how data flows from writers to thousands of readers.

3. Deep Dive into Scaling

Discuss partitioning viewers across multiple servers, using WebSockets or long polling, and handling fan-out efficiently. Mention techniques like sharding, batching, and delta updates.

4. Trade-offs and Optimizations

Analyze trade-offs: consistency vs. availability, latency vs. cost, and complexity vs. maintainability. Suggest optimizations like compression, edge caching, and backpressure.

5. Monitoring and Failure Handling

Explain how to monitor the system, detect bottlenecks, and handle failures gracefully with retries, circuit breakers, and graceful degradation.

Key Points to Mention

  • Use of pub/sub (e.g., Google Cloud Pub/Sub) for real-time message distribution.
  • Partitioning viewers across multiple servers to avoid single point of failure.
  • Delta compression and operational transformation (OT) or CRDTs for collaborative editing.
  • Caching strategies (e.g., Redis, Memcached) to reduce database load.
  • Load balancing and auto-scaling to handle spikes in traffic.
  • Trade-offs between strong consistency and eventual consistency in collaborative editing.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

How would you prevent unauthorized users from receiving live edits over WebSockets?

System DesignAPI & Integrations
Author's notes

Validate permissions at connection time and again when the note's permission model changes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: who are authorized users, what data is being edited, and what authentication mechanisms are in place. Then describe a defense-in-depth approach: authenticate and authorize at connection time, validate every message, and enforce least privilege. Finally, discuss monitoring and revocation to handle compromised sessions.

Pro tip: Emphasize that authorization must be checked on every message, not just at connection time, because permissions can change mid-session. Also mention that you should never trust client-side filtering; all enforcement must be server-side.

1. Clarify requirements and assumptions

Ask about the application context: what kind of edits, who are the users, and what authentication system exists. Confirm that the goal is to prevent unauthorized users from receiving live edits, not just from making them.

2. Authenticate the WebSocket connection

Use a secure token (e.g., JWT) during the WebSocket handshake, validated server-side. Avoid sending credentials in query parameters; instead, use headers or a short-lived token exchanged over HTTPS.

3. Authorize each subscription and message

After authentication, check if the user has permission to subscribe to the specific document or channel. For every incoming edit, verify the user's role and permissions before broadcasting to others.

4. Implement server-side filtering and validation

Ensure the server only sends edits to clients who are authorized to receive them. Validate all messages for integrity and authorization, and never rely on client-side checks.

5. Monitor, log, and revoke access

Log connection and authorization events for auditing. Implement mechanisms to revoke access in real-time (e.g., on logout or permission change) by closing the WebSocket or updating subscriptions.

Key Points to Mention

  • Use of secure WebSocket (wss://) and token-based authentication during handshake.
  • Authorization checks on every message, not just at connection time.
  • Role-Based Access Control (RBAC) or Attribute-Based Access Control (ABAC) for fine-grained permissions.
  • Server-side enforcement of access control; never trust the client.
  • Handling token expiration and revocation (e.g., refresh tokens, blacklisting).
  • Monitoring and logging for security auditing and anomaly detection.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.