← Salesforce Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at Salesforce for a software engineer role, basically one big question about designing Dropbox from scratch. They wanted the full picture, not just storage, so be ready to go deep on sync protocols and conflict handling too.

Questions Asked (6)

Q1

Design a cloud file storage and synchronization service like Dropbox, covering upload/download, multi-device sync, file sharing, version history, and offline edits.

System DesignTechnical Trade-offs
Author's notes

I started with the functional requirements which felt right, but I spent way too long on the upload/download flow and barely had time for offline edits.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., number of users, file sizes, sync frequency), then design the core components: metadata service, block storage, sync engine, and notification system. Walk through the upload/download flow, multi-device sync with conflict resolution, sharing, versioning, and offline edits, discussing trade-offs at each step.

Pro tip: Emphasize how you handle conflicts and consistency—especially for offline edits—since that's where most candidates stumble. Also, mention how you'd leverage Salesforce's existing infrastructure (e.g., object storage, CDN) to avoid reinventing the wheel.

1. Clarify Requirements and Scale

Ask about expected user base, file sizes, sync latency, consistency needs, and security/compliance requirements. Define functional and non-functional requirements.

2. High-Level Architecture

Outline core services: metadata service (file hierarchy, permissions), block storage (S3-like), sync service (change detection, notification), and client agents. Sketch data flow for upload/download.

3. Deep Dive into Key Features

Explain multi-device sync (long polling/WebSocket, delta sync), file sharing (ACLs, link sharing), version history (immutable blocks, metadata versioning), and offline edits (local queue, conflict resolution).

4. Address Trade-offs and Scalability

Discuss consistency vs. availability (e.g., eventual consistency for sync), storage costs, deduplication, and how to scale metadata and notification services. Mention partitioning and caching.

5. Wrap Up with Failure Handling and Monitoring

Cover error scenarios (network partitions, server failures), retry mechanisms, and how to monitor sync health and performance.

Key Points to Mention

  • Chunking and deduplication for efficient storage and upload/download
  • Delta sync and change journals to minimize data transfer
  • Conflict resolution strategies (e.g., last-write-wins, vector clocks, CRDTs) for concurrent edits
  • Metadata service design with a scalable database (e.g., NoSQL) and caching
  • Notification system using long polling or WebSockets for real-time sync
  • Security: encryption at rest and in transit, access control lists (ACLs), and audit logs

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

Q2

How would you design the chunk-based storage model with content-addressed deduplication?

System DesignData Modeling
Author's notes

This part I actually felt decent about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements such as scale, data types, and consistency needs, then outline the core components: chunking, content hashing, deduplication, and metadata management. Walk through the write and read paths, explaining how chunks are stored, indexed, and retrieved, and discuss trade-offs like chunk size, hash collisions, and garbage collection.

Pro tip: Emphasize that deduplication is most effective when chunk boundaries are content-defined (e.g., using Rabin fingerprinting) rather than fixed-size, as this handles insertions and deletions gracefully. Also, mention that you'd use a two-level index (chunk hash -> storage location) to avoid scanning all chunks.

1. Clarify Requirements and Constraints

Ask about data volume, read/write patterns, latency requirements, and consistency guarantees to tailor the design. This shows you understand that deduplication strategies depend on the use case.

2. Design Chunking Strategy

Choose between fixed-size and content-defined chunking (CDC), explaining that CDC (e.g., Rabin fingerprinting) provides better deduplication across insertions/deletions. Discuss chunk size trade-offs (e.g., 4KB-64KB).

3. Implement Content-Addressing and Deduplication

Hash each chunk (e.g., SHA-256) to generate a unique ID, and check if the hash already exists in the chunk store. If it does, increment a reference count; otherwise, store the chunk and add its hash to the index.

4. Design Metadata and Indexing

Maintain a mapping from file to ordered list of chunk hashes, and a global index from chunk hash to storage location and reference count. Consider using a distributed key-value store for scalability.

5. Address Garbage Collection and Consistency

Explain how to handle deletion (decrement ref counts, garbage collect unreferenced chunks) and ensure consistency (e.g., using write-ahead logs or transactional updates).

Key Points to Mention

  • Content-defined chunking (CDC) with rolling hash for variable-size chunks
  • Cryptographic hashing (e.g., SHA-256) for content addressing and collision resistance
  • Reference counting for deduplication and garbage collection
  • Two-level index: file-to-chunk mapping and chunk-to-storage mapping
  • Trade-offs: chunk size vs. deduplication ratio, metadata overhead, and latency
  • Scalability considerations: distributed storage, sharding, and caching

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

Q3

Walk through the metadata service design, including the file tree structure, versioning, and permissions.

System DesignData Modeling
Author's notes

I modeled the file tree as a hierarchical namespace in a relational DB and talked through how versions could be stored as immutable snapshots with pointers.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then present a high-level architecture for the metadata service. Dive into the file tree structure using a normalized schema, explain versioning with immutable snapshots and pointers, and detail permissions with ACLs or RBAC. Conclude with trade-offs and how the design meets Salesforce's multi-tenant needs.

Pro tip: Emphasize how your design handles multi-tenancy and scalability, as Salesforce operates at massive scale. Mention using a hierarchical namespace with efficient path lookups and consider sharding by tenant or namespace to avoid hotspots.

1. Clarify Requirements and Scale

Ask about expected scale (number of files, users, operations per second), consistency requirements, and multi-tenancy needs. This shows you understand the importance of context before designing.

2. High-Level Architecture

Outline the main components: API layer, metadata store (e.g., a distributed database), blob storage for file content, and a caching layer. Explain how they interact to serve metadata operations.

3. File Tree Structure

Describe how to model the hierarchical file tree. Discuss using a parent-child relationship with materialized paths or nested sets for efficient traversal and listing. Mention indexing strategies for fast lookups by path.

4. Versioning

Explain versioning by storing immutable file versions and maintaining a pointer to the current version. Discuss how to handle concurrent updates, version history, and garbage collection of old versions.

5. Permissions

Detail the permission model: use ACLs or RBAC, with inheritance from parent folders. Explain how to enforce permissions at the API layer and efficiently check access, possibly using a permission cache.

Key Points to Mention

  • Multi-tenancy: isolate tenant data and ensure no cross-tenant access.
  • Scalability: sharding, partitioning, and caching to handle high throughput.
  • Consistency: strong vs. eventual consistency for metadata operations.
  • Efficient path lookups: using indexes or materialized paths for fast traversal.
  • Versioning: immutable versions, current pointer, and conflict resolution.
  • Permissions: inheritance, ACLs/RBAC, and enforcement mechanisms.

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

Q4

Describe the sync protocol end to end, from a local file change to all peer devices being updated.

System DesignAPI & Integrations
Author's notes

File watcher detects change, client diffs against last known state, uploads only new or modified chunks, then pings a notification service which pushes to other devices.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer as a chronological walkthrough of the sync protocol, starting from the local file change and ending with all peers updated. Highlight key components like change detection, metadata management, conflict resolution, and eventual consistency, and explain how they interact to ensure reliable synchronization.

Pro tip: Emphasize idempotency and conflict resolution strategies, as they are critical for real-world sync systems and demonstrate a deep understanding of distributed systems challenges. Also, mention how you would handle edge cases like network partitions or concurrent edits.

1. Local Change Detection

Explain how the system detects a local file change, such as using file system watchers or periodic scans, and how it captures the change (e.g., diff, hash, or version vector).

2. Change Packaging and Queuing

Describe how the change is packaged into a sync message, including metadata like timestamps, device ID, and version, and how it is queued for transmission, possibly with retry logic.

3. Transmission to Sync Service

Outline how the change is transmitted to a central sync service or directly to peers, covering protocols (e.g., HTTP/2, WebSocket), authentication, and encryption.

4. Server-Side Processing and Conflict Resolution

Explain how the sync service processes the change, applies conflict resolution if needed (e.g., last-write-wins, CRDTs), and updates the authoritative state.

5. Propagation to Peers and Application

Describe how the updated state is pushed to all peer devices, how peers apply the change locally, and how the system ensures eventual consistency and handles acknowledgments.

Key Points to Mention

  • Change detection mechanisms (e.g., file system events, polling)
  • Metadata and versioning (e.g., vector clocks, Lamport timestamps)
  • Conflict resolution strategies (e.g., last-write-wins, CRDTs, operational transforms)
  • Communication protocols and reliability (e.g., WebSocket, HTTP long polling, retries)
  • Idempotency and deduplication of sync messages
  • Eventual consistency and handling of network partitions

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

Q5

How do you handle conflict resolution when two devices edit the same file offline and then sync?

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 requirements and constraints, such as file types, sync frequency, and user expectations. Then discuss common conflict resolution strategies like operational transformation (OT) and conflict-free replicated data types (CRDTs), explaining their trade-offs. Finally, propose a solution that balances consistency, complexity, and user experience, possibly incorporating user intervention for manual resolution.

Pro tip: Demonstrate awareness of real-world constraints by mentioning that the choice often depends on the specific use case and that hybrid approaches or user-assisted resolution can be pragmatic. Also, highlight the importance of idempotency and versioning to avoid data loss.

1. Clarify Requirements

Ask about the file types, expected conflict frequency, and whether automatic or manual resolution is preferred. This shows you understand the problem context before jumping to solutions.

2. Outline Strategies

Briefly describe common approaches: last-write-wins, operational transformation (OT), and conflict-free replicated data types (CRDTs). Mention that each has trade-offs in complexity, consistency, and user experience.

3. Compare Trade-offs

Discuss the pros and cons of each strategy. For example, OT is powerful but complex to implement, while CRDTs offer automatic merging but may have overhead. Last-write-wins is simple but can lose data.

4. Propose a Solution

Recommend a strategy based on the requirements, such as using CRDTs for real-time collaboration or a version vector with user prompts for manual resolution. Explain how it handles the conflict scenario.

5. Address Edge Cases

Mention how to handle edge cases like partial syncs, network failures, and scalability. Emphasize the importance of testing and monitoring in production.

Key Points to Mention

  • Operational Transformation (OT) and its use in systems like Google Docs
  • Conflict-free Replicated Data Types (CRDTs) and their automatic merge capabilities
  • Last-write-wins (LWW) and its simplicity vs. potential data loss
  • Version vectors or vector clocks for tracking causality
  • User-assisted conflict resolution (e.g., prompting to choose a version)
  • 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.

Q6

How would you scale the storage and metadata layers across multiple geographic regions?

System DesignTechnical Trade-offs
Author's notes

Talked about sharding metadata by user ID, replicating blob storage across regions with a primary region per user, and using a CDN for read-heavy access patterns.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as consistency needs, latency targets, and data volume. Then propose a multi-region architecture that separates storage and metadata layers, using replication and partitioning strategies. Discuss trade-offs between consistency, availability, and cost, and how to handle metadata synchronization and conflict resolution.

Pro tip: Emphasize that metadata is often the bottleneck in multi-region scaling; propose a hierarchical or federated metadata service with caching to reduce cross-region calls. Also, mention the importance of idempotent operations and conflict-free replicated data types (CRDTs) for eventual consistency.

1. Clarify Requirements

Ask about consistency requirements (strong vs. eventual), latency SLAs, data volume, and read/write patterns. This shapes the entire design.

2. Design Storage Layer

Propose a multi-region storage strategy: partition data by region or user, use active-active replication with conflict resolution, or active-passive with failover. Consider object storage, distributed databases, and caching.

3. Design Metadata Layer

Decide on a metadata service that can scale globally: use a globally distributed database (e.g., Spanner, Cosmos DB) or a federated approach with regional metadata caches. Ensure metadata consistency and low-latency access.

4. Address Consistency and Conflicts

Choose consistency models per data type: strong for critical metadata, eventual for user data. Implement conflict resolution (e.g., last-write-wins, CRDTs) and idempotent operations.

5. Discuss Trade-offs and Monitoring

Highlight trade-offs: latency vs. consistency, cost vs. performance. Propose monitoring, failover, and disaster recovery strategies.

Key Points to Mention

  • Data partitioning and replication strategies (e.g., geo-partitioning, active-active vs. active-passive)
  • Consistency models (strong vs. eventual) and their impact on latency and availability
  • Metadata management: global vs. regional metadata stores, caching, and synchronization
  • Conflict resolution techniques (CRDTs, last-write-wins, vector clocks)
  • Latency optimization: edge caching, read replicas, and CDNs
  • Cost and operational complexity of multi-region deployments

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