← Salesforce Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

Salesforce system design round, low-level OO focus on a Watch Party feature. The question was more detailed than I expected and the follow-ups pushed pretty hard on failure scenarios and scaling.

Questions Asked (6)

Q1

Design a Watch Party system where a host creates a virtual room with a unique ID, multiple users can join, and everyone's video playback stays in sync in real time. Support play, pause, seek, and playback speed controls.

System DesignData ModelingAPI & Integrations
Author's notes

The core of the whole interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, sync tolerance, supported controls) and then design a real-time architecture using WebSockets for low-latency communication, a room service for managing sessions, and a sync protocol that handles clock differences and network latency. Emphasize data modeling for room state and events, and discuss trade-offs between consistency and availability.

Pro tip: Proactively discuss how you'd handle clock synchronization and network latency (e.g., using NTP or a server-authoritative timestamp with client-side interpolation) to ensure smooth playback, and mention fallback mechanisms for when clients disconnect or lag.

1. Clarify Requirements and Scope

Ask questions to understand expected scale (number of concurrent rooms/users), sync precision (e.g., within 100ms), supported controls, and whether features like chat or DRM are needed. This shows you prioritize the right constraints.

2. High-Level Architecture

Outline components: a room service (create/join rooms), a real-time messaging layer (WebSockets or WebRTC data channels), a state store (e.g., Redis) for room metadata, and a media server if needed. Explain how clients connect and receive updates.

3. Data Model and API Design

Define key entities: Room (id, host, participants, playback state), Event (type, timestamp, payload). Design APIs for creating/joining rooms and sending control events (play, pause, seek, speed).

4. Synchronization Protocol

Describe how to keep playback in sync: use a server-authoritative timeline with periodic heartbeats, handle clock skew via timestamp exchange, and apply client-side adjustments (e.g., playback rate tweaks) to converge.

5. Scalability and Reliability

Discuss scaling WebSocket connections (e.g., using a pub/sub system like Redis Pub/Sub or Kafka), handling failures (reconnect logic, state recovery), and ensuring low latency across regions.

Key Points to Mention

  • Use WebSockets for real-time bidirectional communication between clients and server.
  • Implement a server-authoritative playback state with timestamps to resolve conflicts and ensure consistency.
  • Handle clock synchronization and network latency using techniques like NTP or timestamp exchange and client-side interpolation.
  • Design a data model with rooms, participants, and playback events, and consider using Redis for fast state storage.
  • Discuss trade-offs: e.g., strong consistency vs. availability, and how to handle network partitions or lagging clients.
  • Mention scalability considerations: sharding rooms, using a message broker, and supporting horizontal scaling of WebSocket servers.

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

Q2

How does a playback control command from the host propagate to all participants given variable network latency and client clock drift?

System DesignTechnical Trade-offs
Author's notes

Went with server as the single source of truth: every command routes through the server, gets stamped with an authoritative timestamp, then broadcasts the new PlaybackState to all clients.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system architecture and requirements, then describe a propagation mechanism that uses server-side timestamping and client-side clock synchronization to schedule playback actions. Emphasize how you handle latency and drift through buffering, periodic resync, and adaptive correction, while discussing trade-offs between accuracy and responsiveness.

Pro tip: Mention that you would measure and monitor clock drift and latency in production, and use a feedback loop to adjust synchronization parameters dynamically—this shows you think about real-world reliability, not just theoretical design.

1. Clarify requirements and constraints

Ask about the scale (number of participants), acceptable synchronization error, and whether playback must be frame-accurate or just perceptually synchronized. This sets the stage for design decisions.

2. Describe the propagation path

Explain how the command travels from host to server to clients, including any fan-out mechanism (e.g., WebSocket, pub/sub). Highlight that the server timestamps the command with a global reference time.

3. Address clock synchronization and latency

Discuss how clients estimate their clock offset from the server (e.g., NTP-like handshake) and how they use the server timestamp to schedule the playback action at the correct local time, compensating for network latency.

4. Handle drift and jitter with correction mechanisms

Explain techniques like buffering, adaptive playback rate adjustment, or periodic resynchronization to correct for ongoing clock drift and variable latency without causing audible/visual glitches.

5. Discuss trade-offs and failure modes

Compare approaches (e.g., strict vs. loose sync) and mention how to handle edge cases like late joiners, network spikes, or clock jumps, ensuring graceful degradation.

Key Points to Mention

  • Server-side timestamping with a monotonic clock to avoid wall-clock issues
  • Client clock offset estimation via round-trip time (RTT) and NTP-style algorithms
  • Scheduling playback at a future time to allow for network latency (e.g., play at T+200ms)
  • Adaptive correction: adjusting playback rate slightly or skipping frames to resync
  • Periodic heartbeat/resync messages to correct cumulative drift
  • Trade-offs: accuracy vs. latency, complexity vs. robustness, and user experience during corrections

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

Q3

Walk through the edge cases: a participant joining mid-playback, the host disconnecting, conflicting near-simultaneous commands, a buffering client, and a participant who drops and reconnects.

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

Late joiners were easy enough: server sends the current PlaybackState snapshot and the client computes live position from the anchor timestamp and seeks there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by first clarifying the system's core requirements and assumptions, then systematically address each edge case with a focus on state consistency and idempotency. For each case, describe the expected behavior, potential failure modes, and your proposed solution, highlighting trade-offs and how you would validate the approach.

Pro tip: Emphasize idempotency and versioning in command handling to gracefully manage conflicts and reconnections, and mention how you would monitor and log these edge cases in production to ensure reliability.

1. Clarify Requirements and Assumptions

Ask clarifying questions to understand the system's scope, such as whether playback is synchronized across participants, the expected latency, and consistency requirements. State your assumptions explicitly to ground the discussion.

2. Address Each Edge Case Systematically

For each edge case, describe the expected system behavior, identify potential issues, and propose a solution. Cover mid-playback join, host disconnect, conflicting commands, buffering client, and drop/reconnect.

3. Highlight Trade-offs and Design Choices

Discuss the trade-offs of your solutions, such as consistency vs. availability, latency vs. accuracy, and complexity vs. robustness. Explain why your choices are appropriate for the given context.

4. Propose Validation and Monitoring

Explain how you would test these edge cases (e.g., chaos engineering, integration tests) and monitor them in production (e.g., logging, metrics, alerts) to ensure the system handles them correctly.

Key Points to Mention

  • State synchronization mechanisms (e.g., authoritative server, version vectors, timestamps)
  • Idempotent command handling and conflict resolution (e.g., last-write-wins, operational transforms)
  • Host migration and failover strategies (e.g., leader election, backup host)
  • Client-side buffering and adaptive bitrate streaming to handle network variability
  • Reconnection logic with session resumption and state reconciliation
  • Trade-offs between consistency, availability, and latency (CAP theorem)

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

Q4

How would you scale this to hundreds of thousands of concurrent rooms across multiple servers, and how do you handle failover for a room's authoritative node?

System DesignTechnical Trade-offs
Author's notes

Sticky routing per room ID so all participants in a room hit the same server node.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying assumptions about room size, traffic patterns, and consistency requirements, then propose a sharded architecture with a consistent hashing ring to distribute rooms across nodes. For failover, describe a replication and leader election mechanism (e.g., Raft) with a control plane that reassigns rooms and updates routing, ensuring minimal disruption.

Pro tip: Emphasize that failover must be fast and automatic, but also consider the trade-off between consistency and availability—use per-room consensus to avoid global bottlenecks. Mention that you'd monitor failover latency and have a fallback to degrade gracefully (e.g., read-only mode) if consensus is temporarily lost.

1. Clarify Requirements and Constraints

Ask about room size, message rate, consistency needs, and latency SLAs to scope the problem. This shows you avoid over-engineering and tailor the solution.

2. Design Sharding and Routing

Propose partitioning rooms across servers using consistent hashing, with a service discovery or routing layer (e.g., a directory service) that maps room IDs to authoritative nodes. Discuss how to handle rebalancing when nodes are added or removed.

3. Implement Replication and Failover

For each room, maintain a primary and one or more replicas (e.g., via Raft or primary-backup). On primary failure, a replica is promoted via leader election, and the routing layer is updated. Ensure the failover is automatic and within seconds.

4. Address Consistency and Split-Brain

Use per-room consensus to avoid split-brain; if a partition occurs, only the partition with quorum can accept writes. Discuss trade-offs: stronger consistency may increase failover time, while eventual consistency risks data loss.

5. Discuss Operational Concerns

Cover monitoring, alerting, and testing failover scenarios (e.g., chaos engineering). Mention capacity planning and how to handle hot rooms (e.g., splitting a room into sub-rooms or using a dedicated node).

Key Points to Mention

  • Consistent hashing for even distribution and minimal rebalancing
  • Per-room replication with leader election (e.g., Raft) for high availability
  • A control plane or directory service for routing and failover coordination
  • Trade-offs between consistency, availability, and latency (CAP theorem)
  • Handling hot rooms via sharding or dedicated resources
  • Monitoring and automated failover testing (chaos engineering)

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

Q5

If any participant could issue playback commands instead of just the host, how would you prevent control conflicts and ensure a deterministic command ordering?

System DesignTechnical Trade-offs
Author's notes

Short answer: sequence numbers on commands, server serializes and rejects or queues out-of-order ones.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what playback commands are allowed, how many participants, and what consistency guarantees are needed. Then propose a centralized sequencer (e.g., a single leader or lock service) that totally orders commands, combined with optimistic concurrency control and idempotent command application to handle conflicts. Finally, discuss trade-offs between latency, availability, and determinism, and how to handle failures and network partitions.

Pro tip: Emphasize that determinism requires a single source of truth for ordering, and that you would use a consensus protocol like Raft or Paxos to achieve it, but also mention that you can relax ordering for non-conflicting commands to improve performance.

1. Clarify requirements and constraints

Ask about the number of participants, expected command rate, latency tolerance, and whether strong consistency is required. This sets the stage for choosing the right trade-offs.

2. Choose a coordination model

Decide between centralized (e.g., a single sequencer or lock service) and decentralized (e.g., consensus protocol) approaches. Explain why a centralized sequencer simplifies deterministic ordering but may introduce a single point of failure.

3. Design conflict resolution and ordering

Propose a total order broadcast (e.g., via Raft) or a logical clock with tie-breaking. Use optimistic concurrency control (version numbers) to detect conflicts and reject or reorder commands.

4. Ensure idempotency and fault tolerance

Make commands idempotent so retries don't cause duplicate actions. Describe how the system handles sequencer failures (e.g., leader election) and network partitions (e.g., quorum).

5. Discuss trade-offs and optimizations

Compare latency vs. consistency, and mention possible optimizations like batching, pipelining, or allowing concurrent non-conflicting commands with commutative operations.

Key Points to Mention

  • Total order broadcast or consensus protocols (Raft, Paxos) for deterministic ordering
  • Centralized sequencer vs. decentralized coordination and their trade-offs
  • Optimistic concurrency control with versioning to detect and resolve conflicts
  • Idempotent command design to handle retries and duplicates
  • Fault tolerance: leader election, quorum, and handling network partitions
  • Performance optimizations: batching, pipelining, and commutative operations

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

Q6

How would you measure sync quality in production and alert when participants in a room are drifting apart?

Product Analytics & MetricsSystem Design
Author's notes

Clients periodically report their current playback position back to the server.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what 'sync quality' means in your system—likely the delta between expected and actual state across participants—then propose concrete metrics (e.g., clock skew, message latency, state divergence) and instrumentation to collect them. Finally, describe an alerting strategy that uses thresholds, anomaly detection, and tiered severity to catch drift before users notice.

Pro tip: Mention that you'd measure sync quality from the user's perspective (e.g., perceived lag or visual glitches) in addition to backend metrics, and use canary alerts or synthetic probes to validate the alerting pipeline itself.

1. Define sync quality and drift

Clarify what 'in sync' means for your application (e.g., shared document state, real-time cursor positions, audio/video alignment) and define drift as the measurable deviation from the expected synchronized state.

2. Identify metrics and instrumentation

Choose metrics such as clock offset, round-trip time, message processing delay, state hash mismatches, and participant-perceived latency; instrument clients and servers to emit these with room and participant identifiers.

3. Aggregate and baseline

Aggregate metrics per room and per participant, compute statistical baselines (e.g., p50, p95, p99) over time, and account for expected variance due to network conditions or geography.

4. Set alerting thresholds and detection

Define static and dynamic thresholds (e.g., drift > 200ms for >5s) and use anomaly detection to flag unusual patterns; tier alerts by severity and route to appropriate on-call teams.

5. Validate and iterate

Continuously test alerts with synthetic rooms or chaos experiments, review false positives/negatives, and refine metrics and thresholds based on user feedback and incident postmortems.

Key Points to Mention

  • Clock synchronization protocols (NTP, PTP) and their limitations in distributed systems
  • End-to-end latency vs. server-side processing time and how to isolate sync issues
  • State reconciliation techniques (e.g., CRDTs, OT) and how to detect divergence
  • Percentile-based alerting (p95, p99) to avoid noise from outliers
  • User-perceived quality metrics (e.g., frame rate, input lag) and synthetic monitoring
  • Alert fatigue mitigation: deduplication, grouping, and severity levels

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