← Salesforce Interview Insights

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

Senior
Apr 2026

Summary

System design round at Salesforce for a software engineer role. The prompt was a coffee ordering system, which sounds straightforward until you get into the weeds on notification coordination and scaling the order pipeline across stores.

Questions Asked (2)

Q1

Design an online coffee ordering system that supports browsing a menu, placing orders at specific store locations, payment, real-time order status tracking, customer pickup, and refunds.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the happy path and it went fine, but the interviewer kept pushing on what happens at peak hours.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, then sketch a high-level architecture covering core services like menu, order, payment, and tracking. Dive into data modeling and key trade-offs such as consistency, scalability, and real-time updates, while addressing edge cases like refunds and store-specific inventory.

Pro tip: Emphasize idempotency and state machines for order lifecycle and payment processing to handle retries and failures gracefully, and discuss how you'd leverage Salesforce's platform services (e.g., Commerce Cloud, Service Cloud) for a cohesive solution.

1. Clarify Requirements and Scope

Ask questions to understand scale, user types (customers, baristas, admins), store-specific constraints, and non-functional needs like latency, availability, and consistency.

2. High-Level Architecture

Outline main components: API gateway, menu service, order service, payment service, store service, tracking service, and notification service. Consider using microservices for scalability and separation of concerns.

3. Data Modeling and Storage

Design schemas for menu items, stores, orders, payments, and refunds. Choose appropriate databases (e.g., SQL for transactions, NoSQL for menu, in-memory for real-time status) and discuss indexing and partitioning.

4. Key Flows and Trade-offs

Walk through critical flows: browsing, ordering, payment, tracking, pickup, and refunds. Discuss trade-offs like consistency vs. availability, synchronous vs. asynchronous processing, and push vs. pull for real-time updates.

5. Scalability, Reliability, and Edge Cases

Address scaling strategies (horizontal scaling, caching, CDN), fault tolerance (retries, idempotency, circuit breakers), and edge cases (payment failures, store closures, refund policies).

Key Points to Mention

  • Idempotency keys for order placement and payment to prevent duplicate charges.
  • Order state machine (e.g., CREATED, PAID, PREPARING, READY, PICKED_UP, CANCELLED, REFUNDED) to manage lifecycle and enable tracking.
  • Real-time updates using WebSockets or server-sent events, with fallback to polling.
  • Store-specific inventory and menu availability, possibly using a store service with caching.
  • Payment integration with third-party providers (e.g., Stripe) and handling refunds via asynchronous workflows.
  • Data consistency: strong consistency for payments and orders, eventual consistency for menu and tracking updates.

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

Q2

How would you handle real-time order status notifications between the customer and the store, including retries when a store device goes offline and ensuring state transitions don't get applied more than once?

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This is where I got stuck.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: real-time delivery, offline store devices, and exactly-once state transitions. Then propose an event-driven architecture with a message broker (e.g., Kafka) and idempotent consumers, using store device heartbeats to detect offline status and a retry mechanism with exponential backoff. Finally, discuss trade-offs between consistency, latency, and complexity.

Pro tip: Emphasize idempotency keys and deduplication at the consumer level, and mention that you'd use a store device's last processed event ID to avoid reprocessing. This shows you understand the practical challenges of distributed systems.

1. Clarify Requirements and Constraints

Ask about expected latency, scale (number of stores/orders), and consistency requirements (e.g., exactly-once vs. at-least-once). Confirm that store devices may go offline and that duplicate state transitions are unacceptable.

2. Design Event-Driven Architecture

Propose using a message broker (e.g., Kafka, Pub/Sub) to decouple order events from store devices. Customers publish order status updates to a topic; store devices subscribe. For real-time push, consider WebSockets or server-sent events to devices.

3. Handle Offline Devices and Retries

Implement heartbeats from store devices to detect liveness. If a device is offline, queue messages in a durable store (e.g., Kafka with retention) and retry with exponential backoff when it reconnects. Use a dead-letter queue for persistent failures.

4. Ensure Exactly-Once State Transitions

Make consumers idempotent by including a unique event ID and having the store device track processed IDs (e.g., in a local database). Alternatively, use a distributed lock or transactional outbox pattern to deduplicate.

5. Discuss Trade-offs and Monitoring

Compare at-least-once with idempotency vs. exactly-once semantics (which may require 2PC). Mention monitoring for lag, retries, and duplicate detection. Highlight that simplicity and reliability often trump strict real-time guarantees.

Key Points to Mention

  • Idempotency keys and deduplication at the consumer level
  • Message broker with durable storage and retry policies (exponential backoff, dead-letter queue)
  • Heartbeat mechanism to detect offline store devices
  • Exactly-once semantics vs. at-least-once with idempotency
  • WebSockets or push notifications for real-time delivery
  • Trade-offs between consistency, latency, and system complexity

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