← Google Interview Insights

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

Senior
Jun 2026

Summary

Google system design round, one big question about migrating a relational DB to a NoSQL key-value store. Covered a lot of ground and felt like I was sprinting the whole time.

Questions Asked (5)

Q1

Design a system to migrate data from a relational database to a NoSQL key-value store, starting with a consistent snapshot and then switching to change data capture via the write-ahead log.

System DesignData ModelingTechnical Trade-offs
Author's notes

This was basically the whole interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements like data volume, consistency needs, and downtime tolerance, then outline a two-phase migration: initial consistent snapshot followed by continuous CDC from the WAL. Explain how to handle schema mapping, ordering, idempotency, and cutover to ensure correctness.

Pro tip: Emphasize the importance of a well-defined cutover strategy with dual-writes or a brief read-only window to avoid data loss, and mention monitoring lag and reconciliation checks to build trust in the migration.

1. Clarify requirements and constraints

Ask about data size, write throughput, acceptable downtime, consistency requirements, and target NoSQL store characteristics to tailor the design.

2. Design the snapshot phase

Explain how to take a consistent snapshot (e.g., using database-native snapshot or a transaction with repeatable read) and efficiently bulk-load it into the key-value store, handling schema mapping and data transformation.

3. Set up change data capture

Describe reading the write-ahead log (e.g., via logical replication or CDC tools) to capture ongoing changes, and apply them to the key-value store in order with idempotency to handle duplicates.

4. Ensure correctness and handle failures

Discuss mechanisms for exactly-once or at-least-once processing, checkpointing, and reconciliation to detect and repair inconsistencies between source and target.

5. Plan cutover and rollback

Outline a cutover strategy (e.g., dual-writes, read-only window) to switch traffic to the new store, with monitoring and a rollback plan if issues arise.

Key Points to Mention

  • Consistent snapshot techniques (e.g., transaction with repeatable read, database-native snapshot)
  • WAL reading via logical replication or CDC tools (e.g., Debezium)
  • Idempotent writes and ordering guarantees in the key-value store
  • Schema mapping and data denormalization for key-value access patterns
  • Monitoring replication lag and data reconciliation
  • Cutover strategies: dual-writes, read-only window, and rollback plan

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

Q2

How do you guarantee snapshot consistency, and how do you handle the ordering boundary between the snapshot and the CDC stream?

System DesignTechnical Trade-offs
Author's notes

The tricky part is that the snapshot takes time, so rows written during the snapshot could show up in both the snapshot and the WAL.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining snapshot consistency in the context of CDC: a consistent point-in-time view of the database. Then explain how to establish a snapshot boundary using techniques like consistent snapshots (e.g., via database-native snapshot isolation or locking) and how to align the CDC stream start position (e.g., using log sequence numbers or binlog coordinates) to avoid gaps or duplicates. Finally, discuss trade-offs and handling of edge cases like schema changes or long-running transactions.

Pro tip: Emphasize idempotency and exactly-once semantics: even with a perfect boundary, failures can cause duplicates, so design the pipeline to be idempotent and use deduplication strategies. This shows you think beyond the happy path.

1. Define consistency requirements

Clarify what 'snapshot consistency' means for the use case: point-in-time consistency across tables, transactional consistency, or eventual consistency. Discuss the impact of isolation levels and read phenomena.

2. Establish a consistent snapshot

Explain how to take a consistent snapshot using database features like snapshot isolation (e.g., PostgreSQL's exported snapshots, MySQL's consistent snapshot with --single-transaction) or by briefly quiescing writes. Mention the trade-offs of locking vs. MVCC.

3. Capture the CDC start position

Describe how to record the exact log position (e.g., LSN, binlog file/offset, SCN) at the time the snapshot is taken, ensuring the CDC stream starts from that point. Highlight the need for atomicity between snapshot and position capture.

4. Handle the ordering boundary

Discuss techniques to avoid gaps or duplicates: e.g., start CDC from the snapshot's log position and filter out events already included in the snapshot, or use a two-phase approach with a consistent snapshot and then replay from the recorded position. Mention idempotent application of changes.

5. Address edge cases and trade-offs

Cover scenarios like long-running transactions spanning the boundary, schema changes during snapshot, and failures during snapshot or CDC. Discuss trade-offs between consistency, latency, and complexity.

Key Points to Mention

  • Use of database-native consistent snapshot mechanisms (e.g., MVCC, exported snapshots) to avoid locking.
  • Recording the CDC log position (LSN, binlog coordinates) atomically with the snapshot.
  • Idempotent processing and deduplication to handle duplicates at the boundary.
  • Handling of in-flight transactions that span the snapshot boundary (e.g., using transaction IDs or commit timestamps).
  • Trade-offs between consistency guarantees and system availability/performance.
  • Monitoring and validation to detect inconsistencies (e.g., checksums, reconciliation).

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

Q3

How would you achieve exactly-once semantics across replays and handle failure recovery?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system context (e.g., stream processing, batch, or RPC) and define what 'exactly-once' means in that context. Then explain the core mechanisms: idempotency, deduplication, transactional writes, and checkpointing, and how they combine to handle replays and failures. Finally, discuss trade-offs and how you would validate correctness.

Pro tip: Emphasize that exactly-once is achieved through a combination of at-least-once delivery plus idempotent processing or deduplication, and that end-to-end exactly-once requires coordination across all components. Mentioning real-world systems like Kafka or Flink shows practical depth.

1. Clarify requirements and scope

Ask questions to understand the system: is it a stream processor, a batch job, or a service? What are the sources and sinks? Define what 'exactly-once' means for the user (e.g., no duplicates in output, no lost updates).

2. Choose a delivery guarantee strategy

Explain that exactly-once is typically built on at-least-once delivery with deduplication or idempotent operations. Discuss options like transactional writes, idempotent producers, and unique message IDs.

3. Design for replay and failure recovery

Describe how to handle replays: use checkpointing to track progress, store state durably, and ensure operations are idempotent or deduplicated. For failures, discuss recovery from checkpoints and handling partial writes with transactions or two-phase commit.

4. Address trade-offs and edge cases

Discuss trade-offs: performance overhead of deduplication, latency of transactions, and complexity of coordination. Mention edge cases like network partitions, duplicate detection window limits, and exactly-once across heterogeneous systems.

5. Validate and monitor

Explain how you would test and monitor exactly-once semantics: end-to-end tests with failure injection, metrics for duplicates/loss, and auditing mechanisms.

Key Points to Mention

  • Idempotency: designing operations that can be safely retried without side effects.
  • Deduplication: using unique identifiers and a dedup store to filter duplicates.
  • Transactional writes: atomic commits across multiple systems (e.g., two-phase commit, Kafka transactions).
  • Checkpointing and state management: durable state to recover from failures and replay from a consistent point.
  • Trade-offs: performance vs. correctness, complexity of coordination, and limitations of exactly-once across systems.
  • Real-world examples: Apache Kafka's exactly-once semantics, Flink's checkpointing, or Google Cloud Dataflow.

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

Q4

How do you handle schema evolution during and after the migration?

System DesignData Modeling
Author's notes

Honestly my weakest answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the migration context (e.g., database migration, service migration) and then outline a strategy that covers both during and after migration. Emphasize backward/forward compatibility, versioning, and a phased rollout with monitoring and rollback plans.

Pro tip: Highlight the importance of decoupling schema changes from code deployments and using techniques like expand-contract to minimize downtime and risk. Mention how you'd handle data backfills and dual writes to ensure consistency.

1. Clarify scope and constraints

Ask questions to understand the migration type, data volume, uptime requirements, and existing schema. This shows you tailor your approach to the specific situation.

2. Design for compatibility

Plan schema changes to be backward and forward compatible, using versioning and additive changes first. Avoid breaking changes by using techniques like expand-contract.

3. Execute phased migration

Roll out changes in phases: first add new schema, then dual-write/backfill, then switch reads, and finally remove old schema. Monitor each phase and have rollback plans.

4. Ensure data integrity and validation

Use checksums, reconciliation jobs, and validation queries to verify data consistency between old and new schemas during and after migration.

5. Post-migration cleanup and monitoring

After migration, remove deprecated schema, update documentation, and set up monitoring to detect any issues. Conduct a post-mortem to capture lessons learned.

Key Points to Mention

  • Backward and forward compatibility
  • Expand-contract pattern (or parallel change)
  • Versioning of schemas and APIs
  • Dual writes and data backfill strategies
  • Rollback and monitoring plans
  • Decoupling schema changes from code deployments

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

Q5

Walk me through how you'd partition the data and queue the migration work, and what monitoring you'd put in place.

System DesignTechnical Trade-offs
Author's notes

Partitioning by primary key range or hash made sense for parallelism.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope and constraints (data size, consistency requirements, downtime tolerance), then propose a partitioning strategy that aligns with access patterns and a queue-based migration approach that ensures idempotency and progress tracking. Finally, describe a monitoring plan that covers both data integrity and operational health, with clear rollback and validation steps.

Pro tip: Emphasize idempotency and checkpointing in your queue design—this shows you've thought about failure recovery and exactly-once semantics, which is critical at Google's scale.

1. Clarify requirements and constraints

Ask about data volume, consistency needs, acceptable downtime, and migration timeline to tailor your partitioning and queuing strategy.

2. Design data partitioning

Choose a partition key (e.g., user ID, time range) that balances load and minimizes cross-partition dependencies, and explain how you'd handle hot partitions.

3. Design the migration queue

Describe a queue-based system (e.g., using Pub/Sub or Kafka) with idempotent workers, checkpointing, and retry logic to process partitions in parallel while tracking progress.

4. Plan validation and rollback

Outline how you'd validate migrated data (checksums, row counts, sampling) and implement a rollback strategy if issues arise.

5. Define monitoring and alerting

Specify metrics (throughput, error rates, latency, data integrity checks) and alerts to detect failures or slowdowns, plus dashboards for visibility.

Key Points to Mention

  • Partitioning strategy (e.g., range, hash, or consistent hashing) and handling of hot spots
  • Queue implementation with idempotency, checkpointing, and dead-letter queues
  • Data validation techniques (checksums, sampling, reconciliation)
  • Monitoring metrics: throughput, error rates, latency, and data integrity
  • Rollback and failure recovery plan
  • Trade-offs between consistency, speed, and complexity

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