← Snowflake Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

Snowflake system design round for a software engineer role. The whole thing was one big prompt about building a deduplication-aware object storage service, and they expected you to cover a lot of ground in one session.

Questions Asked (3)

Q1

Design a simplified cloud object storage service that supports file upload and download, with a focus on deduplication so that identical files are only stored once.

System DesignTechnical Trade-offsData Modeling
Author's notes

This is a meaty one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (file sizes, access patterns, consistency, scale) and then design a two-layer architecture: a metadata service and a blob store. Focus on content-addressable storage using cryptographic hashes for deduplication, and discuss trade-offs like hash collisions, garbage collection, and performance.

Pro tip: Mention that deduplication can be done at different granularities (whole-file vs. chunk-level) and that Snowflake's data cloud likely benefits from chunk-level dedup for large files; also highlight the importance of a reference counting mechanism to safely delete objects.

1. Clarify Requirements and Scope

Ask about expected file sizes, upload/download frequency, consistency needs, and scale (number of files, total storage). This ensures the design meets the actual use case.

2. High-Level Architecture

Propose a separation of concerns: a metadata service (tracking file info, ownership, references) and a blob storage layer (storing actual data). Use a hash-based addressing scheme for deduplication.

3. Deduplication Strategy

Explain content-addressable storage: compute a cryptographic hash (e.g., SHA-256) of the file content. If the hash exists, increment a reference count and return the existing object; otherwise, store the new object.

4. Upload and Download Flows

Detail the steps: client uploads file, server hashes it, checks metadata store for existing hash, stores if new, updates metadata with reference. Download: client requests file by ID, metadata service returns hash, client fetches from blob store.

5. Trade-offs and Edge Cases

Discuss hash collisions (use strong hash, verify content), garbage collection (reference counting, mark-and-sweep), performance (caching, CDN), and consistency (eventual vs. strong).

Key Points to Mention

  • Content-addressable storage using cryptographic hashes (e.g., SHA-256) for deduplication.
  • Reference counting to manage object lifecycle and safe deletion.
  • Separation of metadata and blob storage for scalability and simplicity.
  • Handling hash collisions by verifying actual content or using a secondary hash.
  • Chunk-level deduplication for large files to increase dedup ratio.
  • Trade-offs: storage savings vs. latency, complexity, and consistency.

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

Q2

How would you handle deletion and garbage collection when multiple users share the same underlying file content?

System DesignTechnical Trade-offs
Author's notes

The reference counting angle is where things got messy for me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's requirements: how files are shared, what consistency guarantees are needed, and the expected scale. Then propose a reference counting mechanism to track shared content, with a two-phase deletion process (mark and sweep) to handle concurrent access safely. Finally, discuss trade-offs between eager and lazy garbage collection, and how to handle edge cases like partial failures and orphaned data.

Pro tip: Emphasize that deletion should be logical (tombstoning) rather than physical to avoid race conditions, and that garbage collection should be asynchronous and idempotent. Mention that Snowflake's architecture likely uses a similar approach with metadata management and background processes.

1. Clarify Requirements and Constraints

Ask about the sharing model (e.g., deduplication, copy-on-write), consistency requirements, and scale. Understand if users can delete while others are reading, and what latency is acceptable for cleanup.

2. Design Reference Counting

Propose maintaining a reference count per unique file content. Increment when a user references it, decrement on deletion. Only physically delete when count reaches zero.

3. Implement Safe Deletion

Use a two-phase approach: mark for deletion (logical delete) and then garbage collect asynchronously. Ensure atomicity of reference count updates to avoid races.

4. Handle Concurrency and Failures

Address race conditions (e.g., simultaneous delete and read) with locking or optimistic concurrency. Plan for partial failures: if a user crashes, reference counts may leak; use timeouts or leases.

5. Discuss Trade-offs and Optimizations

Compare eager vs. lazy GC, synchronous vs. asynchronous cleanup, and the impact on performance and storage. Mention potential optimizations like batching or background compaction.

Key Points to Mention

  • Reference counting with atomic operations to track shared content.
  • Two-phase deletion: logical tombstoning followed by asynchronous physical deletion.
  • Concurrency control mechanisms (e.g., locks, transactions) to prevent race conditions.
  • Handling orphaned data due to failures (e.g., leases, timeouts, reconciliation).
  • Trade-offs between eager and lazy garbage collection in terms of latency and resource usage.
  • Scalability considerations: distributed reference counting and eventual consistency.

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

Q3

What consistency and correctness concerns arise with partial or concurrent uploads, and how would you address them?

System DesignTechnical Trade-offs
Author's notes

I talked about chunked uploads with a manifest commit at the end, so a partial upload never becomes visible.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the upload model (e.g., chunked, multipart, or streaming) and the consistency guarantees required. Then systematically discuss correctness risks such as partial visibility, duplicate data, and ordering issues, and propose concrete solutions like idempotent writes, transactional commits, and checksum validation. Finally, tie your answer to Snowflake's architecture, emphasizing how its cloud-native design handles these concerns.

Pro tip: Mention that Snowflake's internal stages and COPY command already provide atomicity and idempotency via file checksums and metadata, so you'd leverage those rather than reinventing the wheel. This shows you understand the product and avoid over-engineering.

1. Clarify the upload model and requirements

Ask whether uploads are chunked, multipart, or streaming, and what consistency level is needed (e.g., atomic visibility, exactly-once). This scopes the problem and shows you avoid assumptions.

2. Identify correctness risks

Enumerate issues like partial uploads leaving incomplete data, concurrent uploads causing duplicates or lost updates, and out-of-order chunks leading to corruption. Also consider failure scenarios (network, client crash).

3. Propose consistency mechanisms

Suggest solutions such as idempotent writes with unique upload IDs, transactional commit of all chunks, checksums for integrity, and versioning or optimistic concurrency control for concurrent updates.

4. Address concurrency and isolation

Discuss how to handle concurrent uploads to the same object: use locking, conditional writes, or append-only logs with deduplication. Ensure readers see a consistent snapshot (e.g., via MVCC or staging areas).

5. Tie to Snowflake and trade-offs

Explain how Snowflake's stages, COPY command, and metadata services provide atomicity and idempotency. Acknowledge trade-offs between consistency, latency, and complexity, and justify your choices.

Key Points to Mention

  • Idempotency: use unique upload IDs and deduplication to handle retries safely.
  • Atomic commit: ensure all chunks are committed together or not at all (e.g., via transactions or manifest files).
  • Checksums and validation: verify integrity of each chunk and the final object to detect corruption.
  • Concurrency control: use optimistic locking, conditional writes, or serializable transactions to prevent lost updates.
  • Snowflake specifics: leverage internal stages, COPY with ON_ERROR, and metadata for atomic and idempotent loads.
  • Trade-offs: discuss consistency vs. availability, latency, and complexity; mention eventual consistency where acceptable.

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