← Salesforce Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

Salesforce backend engineering interview that was basically one long system design session focused on building an analytics platform for a ChatGPT-style product. The scope was pretty wide and I kept second-guessing how deep to go on each piece.

Questions Asked (9)

Q1

Design the backend of an internal analytics system for a conversational AI product. The system should collect data from production databases and service logs, compute product and reliability metrics, and serve those metrics to a dashboard used by PMs and engineers.

System DesignData ModelingTechnical Trade-offs
Author's notes

This is a big one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a layered architecture: ingestion (batch/streaming), storage (data lake + warehouse), processing (ETL/ELT), and serving (API + caching). Emphasize trade-offs around latency, cost, and complexity, and how you'd ensure reliability and data quality.

Pro tip: Anchor your design in the specific needs of a conversational AI product: metrics like conversation success rate, latency percentiles, and error rates require different data models and processing than generic web analytics. Show you understand the domain by prioritizing these metrics and their unique challenges.

1. Clarify Requirements and Scale

Ask about data volume, velocity, variety, and the expected freshness of metrics (real-time vs. hourly/daily). Identify key stakeholders (PMs, engineers) and their primary use cases to prioritize features.

2. Design Data Ingestion

Propose mechanisms to collect data from production databases (CDC, batch exports) and service logs (log shippers, streaming). Discuss handling schema evolution and ensuring data completeness.

3. Choose Storage and Processing

Select a data lake for raw storage and a warehouse for modeled data. Outline ETL/ELT pipelines to compute metrics, using batch (Spark) and stream (Flink) processing as needed.

4. Design Serving Layer and API

Create a metrics API that queries pre-aggregated tables, with caching and rate limiting. Ensure low-latency access for dashboards and support for ad-hoc queries.

5. Address Reliability, Security, and Trade-offs

Discuss monitoring, alerting, data quality checks, and access control. Highlight trade-offs like cost vs. freshness, and how you'd evolve the system over time.

Key Points to Mention

  • Data modeling for conversational AI metrics: conversation sessions, turns, intents, sentiment, and reliability indicators like error rates and latency percentiles.
  • Ingestion patterns: CDC for databases, log aggregation (e.g., Fluentd, Kafka) for service logs, and handling high-volume event streams.
  • Storage choices: data lake (S3) for raw data, warehouse (Snowflake, BigQuery) for structured metrics, and possibly a time-series database for real-time metrics.
  • Processing frameworks: batch (Spark) for historical aggregations, stream processing (Flink, Kafka Streams) for near-real-time metrics.
  • Serving layer: pre-aggregated tables, caching (Redis), API design (REST/GraphQL), and query optimization for dashboard responsiveness.
  • Operational concerns: data quality monitoring, schema registry, access control (RBAC), and cost management through tiered storage and retention policies.

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

Q2

How would you ingest data from existing production services without putting extra load on those primary databases?

System DesignTechnical Trade-offs
Author's notes

Change data capture was my first answer and they seemed to like it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: data freshness, volume, and consistency needs. Then propose a change data capture (CDC) approach using the database's replication log (e.g., binlog, WAL) to stream changes to a separate system, avoiding direct queries on the primary. Finally, discuss trade-offs and alternatives like read replicas or batch exports, emphasizing how each minimizes load.

Pro tip: Mention that you would monitor the impact on the primary database and have a fallback plan, showing you consider operational safety. Also, highlight that CDC is often preferred because it reads from the log, which is designed for replication and has minimal overhead.

1. Clarify Requirements

Ask about data freshness (real-time vs batch), volume, and consistency requirements to tailor the solution.

2. Evaluate Options

Consider CDC, read replicas, batch exports, or application-level dual writes, and discuss their pros and cons regarding load on primary.

3. Propose CDC as Primary Solution

Explain how CDC works by reading the database transaction log (e.g., MySQL binlog, PostgreSQL WAL) and streaming changes to a message queue or data lake.

4. Address Trade-offs and Mitigations

Discuss potential issues like log retention, schema changes, and latency, and how to mitigate them (e.g., monitoring, backpressure).

5. Conclude with Recommendation

Summarize why CDC is the best approach for minimizing load while meeting requirements, and mention any complementary strategies.

Key Points to Mention

  • Change Data Capture (CDC) using database transaction logs (e.g., Debezium, Maxwell)
  • Read replicas as an alternative but note they can still add load if not properly isolated
  • Batch exports during off-peak hours with throttling
  • Application-level dual writes (pros: control, cons: complexity and potential inconsistency)
  • Impact on primary database: log reading is lightweight compared to queries
  • Monitoring and alerting on replication lag and primary database performance

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

Q3

What event and metric schemas would you use for this kind of analytics platform?

Data ModelingTechnical Trade-offs
Author's notes

I sketched out a flat event schema with a timestamp, event type, user ID, session ID, model version, region, and a JSON blob for extra attributes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the platform's use cases, data volume, and query patterns to tailor your schema design. Then propose a layered schema: raw events for ingestion, processed events for analysis, and aggregated metrics for performance. Emphasize trade-offs between flexibility, storage cost, and query speed, and how your choices align with Salesforce's scale and reliability needs.

Pro tip: Demonstrate awareness of schema evolution and data governance by mentioning how you'd handle versioning and PII, which is critical for a CRM platform like Salesforce.

1. Clarify Requirements

Ask about data sources, volume, latency, and query patterns to understand if the platform is for real-time analytics, batch reporting, or both.

2. Design Event Schema

Propose a flexible event schema with common fields (event_id, timestamp, user_id, event_type) and a JSON payload for custom properties, using a format like Avro or Protobuf for schema evolution.

3. Design Metric Schema

Define metric tables with dimensions (e.g., date, user_segment) and measures (e.g., count, sum), pre-aggregated for common queries to balance storage and performance.

4. Address Trade-offs

Discuss trade-offs: normalized vs. denormalized, real-time vs. batch processing, and storage vs. query cost, explaining how you'd choose based on SLAs.

5. Plan for Evolution and Governance

Outline strategies for schema versioning, backward compatibility, and data privacy (e.g., encryption, access controls) to ensure long-term maintainability.

Key Points to Mention

  • Use of a schema registry (e.g., Confluent Schema Registry) for managing event schema evolution.
  • Partitioning and clustering keys (e.g., by date and customer_id) to optimize query performance in data warehouses like Snowflake or BigQuery.
  • Pre-aggregation of metrics to reduce query latency and cost, with materialized views or summary tables.
  • Handling late-arriving data and exactly-once semantics in event ingestion.
  • Data governance: PII masking, GDPR/CCPA compliance, and role-based access control.
  • Trade-offs between flexibility (schemaless) and performance (strongly typed) in event design.

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

Q4

How would you support both near-real-time metrics and historical analysis within the same system?

System DesignTechnical Trade-offs
Author's notes

Lambda architecture came to mind immediately but I second-guessed myself mid-sentence and started pivoting to a Kappa-style approach.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements for both near-real-time metrics and historical analysis, then propose a hybrid architecture that separates the write path for real-time processing from the read path for historical queries. Emphasize trade-offs between latency, cost, and consistency, and explain how you would ensure data integrity across both paths.

Pro tip: Mention that you would use a change data capture (CDC) pipeline to feed both a real-time stream processor and a batch/OLAP store, ensuring a single source of truth and avoiding dual-write inconsistencies.

1. Clarify Requirements

Ask about the expected latency for near-real-time metrics (e.g., seconds vs. minutes), the volume and retention period for historical data, and the query patterns for historical analysis.

2. Propose a Hybrid Architecture

Suggest a lambda or kappa architecture: use a stream processing engine (e.g., Kafka Streams, Flink) for real-time aggregations, and store raw events in a data lake or OLAP database (e.g., Druid, ClickHouse) for historical queries.

3. Address Data Consistency

Explain how to avoid dual-write issues by using a single ingestion pipeline (e.g., CDC) that writes to both the real-time and historical stores, and discuss eventual consistency trade-offs.

4. Discuss Trade-offs and Optimizations

Compare latency vs. cost, storage vs. query performance, and complexity vs. maintainability. Mention techniques like pre-aggregation, tiered storage, and indexing to optimize both paths.

5. Summarize and Validate

Recap how the proposed system meets both needs, and invite feedback or further constraints to refine the design.

Key Points to Mention

  • Lambda vs. Kappa architecture and when to choose each
  • Stream processing frameworks (e.g., Apache Flink, Kafka Streams) for real-time metrics
  • OLAP databases or data lakes (e.g., Apache Druid, ClickHouse, Snowflake) for historical analysis
  • Change Data Capture (CDC) for consistent data ingestion
  • Trade-offs: latency, cost, complexity, and consistency
  • Data partitioning, indexing, and pre-aggregation for query performance

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

Q5

Walk through how you'd compute metrics like daily active users, conversation counts, request volume, latency percentiles, token usage, and error rates.

Product Analytics & MetricsSystem Design
Author's notes

DAU and conversation counts are straightforward aggregations, talked through those quickly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the metrics and their definitions, then describe a layered data pipeline from event ingestion to storage and querying. For each metric, explain the computation method, trade-offs, and how you'd ensure accuracy and scalability.

Pro tip: Mention the importance of defining metrics precisely (e.g., what counts as an active user) and using approximate algorithms like HyperLogLog for cardinality to balance accuracy and performance at scale.

1. Clarify Metric Definitions

Ask clarifying questions to pin down exact definitions, such as what constitutes a 'daily active user' or 'conversation count'. This ensures alignment and avoids ambiguity.

2. Design Data Collection

Outline how events are captured (e.g., client-side, server-side) and transported (e.g., Kafka, Kinesis) to a data lake or warehouse. Emphasize reliability and low latency.

3. Choose Storage and Processing

Select appropriate storage (e.g., time-series DB, columnar store) and processing engines (e.g., Spark, Flink) for batch and real-time needs. Discuss partitioning and indexing for efficient queries.

4. Compute Metrics

For each metric, describe the computation: DAU via distinct user counts per day, conversation counts via event aggregation, request volume via counters, latency percentiles via histograms or t-digest, token usage via sum, error rates via ratio of errors to total requests.

5. Ensure Scalability and Accuracy

Address challenges like data volume, late-arriving data, and approximate algorithms (e.g., HyperLogLog for DAU). Discuss validation, monitoring, and backfilling.

Key Points to Mention

  • Metric definitions and edge cases (e.g., time zones, session windows)
  • Data pipeline architecture: ingestion, storage, processing (batch vs. streaming)
  • Approximate algorithms for cardinality (HyperLogLog) and percentiles (t-digest)
  • Trade-offs between accuracy, latency, and cost
  • Data quality: handling duplicates, late data, and ensuring exactly-once semantics
  • Tools: Kafka, Flink, Spark, Druid, Prometheus, etc.

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

Q6

How would you design the system to slice metrics by dimensions such as time, model version, region, platform, and user segment?

Data ModelingProduct Analytics & Metrics
Author's notes

Pre-aggregated rollup tables by dimension combination was my main answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what metrics, how many dimensions, expected query patterns, and latency needs. Then propose a dimensional data model with a fact table for metrics and dimension tables for each sliceable attribute, and discuss storage and query strategies like pre-aggregation and indexing. Finally, address scalability and trade-offs between flexibility and performance.

Pro tip: Mention that you would design the system to support both real-time and batch processing, and that you'd use a columnar store like ClickHouse or Druid for fast slice-and-dice queries. Also, emphasize the importance of a consistent dimension naming and versioning strategy to avoid confusion as the product evolves.

1. Clarify Requirements and Use Cases

Ask about the specific metrics, the cardinality of dimensions, query patterns (ad-hoc vs. dashboard), and latency/throughput requirements. This ensures the design meets actual needs.

2. Design the Dimensional Data Model

Propose a star schema with a fact table storing metric values and foreign keys to dimension tables (time, model version, region, platform, user segment). Discuss slowly changing dimensions for attributes like model version.

3. Choose Storage and Query Engine

Select a columnar, distributed datastore (e.g., ClickHouse, Druid, BigQuery) that supports fast aggregations and filtering on high-cardinality dimensions. Explain how partitioning and indexing improve performance.

4. Implement Aggregation and Caching Strategies

Describe pre-aggregation (rollups) for common dimension combinations and caching for frequent queries. Balance pre-computation with on-the-fly aggregation for flexibility.

5. Address Scalability, Consistency, and Evolution

Discuss how to handle growing data volume (sharding, retention policies), ensure data consistency across dimensions, and manage schema evolution as new dimensions or metrics are added.

Key Points to Mention

  • Star schema or snowflake schema for organizing metrics and dimensions
  • Columnar storage and vectorized query execution for fast slice-and-dice
  • Pre-aggregation and materialized views to reduce query latency
  • Partitioning and indexing strategies (e.g., by time, region)
  • Handling high-cardinality dimensions (e.g., user segment) with techniques like bitmap indexes or sketches
  • Trade-offs between flexibility (ad-hoc queries) and performance (pre-aggregation)

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

Q7

How would you handle data freshness, correctness, deduplication, and backfills in this system?

System DesignData ModelingRoot Cause Analysis
Author's notes

Deduplication tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's data requirements and SLAs, then walk through each concern (freshness, correctness, deduplication, backfills) with concrete strategies and trade-offs. Emphasize how these concerns interact and how you'd monitor and validate them in production.

Pro tip: Tie each strategy to a measurable SLO (e.g., data freshness within 5 minutes, deduplication rate >99.9%) and mention how you'd detect and alert on violations. This shows you think about operability, not just design.

1. Clarify requirements and constraints

Ask about data volume, velocity, latency SLAs, consistency needs, and failure tolerance to ground your answer in the specific system.

2. Address data freshness

Discuss ingestion patterns (batch vs. streaming), watermarking, and freshness monitoring; propose trade-offs between latency and cost.

3. Ensure correctness and deduplication

Explain idempotent writes, unique keys, dedup windows, and validation checks; mention how to handle late or out-of-order data.

4. Design backfill strategy

Outline how to reprocess historical data safely, including isolation, rate limiting, and reconciliation with live traffic.

5. Monitor, alert, and iterate

Describe metrics, dashboards, and alerts for freshness, duplicates, and backfill progress; include a plan for root-cause analysis when issues arise.

Key Points to Mention

  • Idempotency and exactly-once semantics (e.g., using unique IDs, upserts, or transactional writes)
  • Watermarking and late data handling in stream processing (e.g., Apache Flink, Kafka Streams)
  • Deduplication techniques: bloom filters, key-based dedup, or windowed dedup
  • Backfill approaches: shadow tables, dual writes, or replaying from immutable logs
  • Data quality checks and reconciliation (e.g., checksums, row counts, sampling)
  • Monitoring and alerting on freshness SLAs, duplicate rates, and backfill lag

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

Q8

How would you address privacy, access control, and operational monitoring for this analytics platform?

System DesignTechnical Trade-offs
Author's notes

I covered role-based access at the query layer, PII masking or tokenization at ingestion time, and audit logging.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer around the three pillars—privacy, access control, and operational monitoring—and tie each to the platform's data lifecycle. Emphasize defense in depth, least privilege, and observability, while acknowledging trade-offs between security, performance, and cost.

Pro tip: Reference Salesforce-specific compliance frameworks like GDPR, CCPA, and SOC2, and mention how you'd leverage Salesforce's Shield Platform Encryption and Event Monitoring to align with existing infrastructure.

1. Clarify requirements and data sensitivity

Ask about the types of data (PII, financial, etc.), regulatory requirements, and user personas to tailor your approach. This shows you don't jump to solutions without context.

2. Design privacy controls

Propose data minimization, anonymization/pseudonymization, encryption at rest and in transit, and data retention policies. Mention how you'd implement these in a multi-tenant environment.

3. Implement access control

Describe role-based access control (RBAC), attribute-based access control (ABAC), and least privilege. Include authentication (OAuth, SSO) and authorization mechanisms, and how to audit access.

4. Set up operational monitoring

Outline logging, metrics, and tracing for the platform. Cover anomaly detection, alerting, and dashboards for key SLIs like latency, error rates, and security events.

5. Address trade-offs and iterate

Discuss trade-offs between security, performance, and cost. Propose a phased rollout and continuous improvement based on feedback and audits.

Key Points to Mention

  • Encryption at rest and in transit (e.g., TLS, AES-256)
  • Role-based access control (RBAC) and least privilege principle
  • Audit logging and anomaly detection for security monitoring
  • Compliance standards like GDPR, CCPA, SOC2, and Salesforce Shield
  • Data anonymization and pseudonymization techniques
  • Observability tools (e.g., Prometheus, Grafana, ELK stack) and SLIs/SLOs

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

Q9

What does the API or query layer look like that a dashboard backend would call to retrieve metrics?

API & IntegrationsSystem Design
Author's notes

I proposed a thin REST API in front of the data store with query parameters for time range, granularity, dimensions, and metric names.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the dashboard's requirements—metrics, dimensions, filters, and refresh cadence—then describe a layered API design: a query endpoint that accepts structured parameters, an aggregation layer that translates requests into efficient queries, and a caching layer for performance. Emphasize trade-offs between flexibility, latency, and cost, and how you'd handle scale and multi-tenancy in a Salesforce-like environment.

Pro tip: Mention that you'd expose a declarative query API (e.g., JSON-based filters and group-bys) rather than raw SQL, and that you'd version it and enforce rate limits and row-level security to prevent abuse and data leaks.

1. Clarify requirements and constraints

Ask about the types of metrics, expected query patterns, data volume, freshness requirements, and multi-tenancy. This ensures the API design meets real needs without over-engineering.

2. Define the API contract

Specify endpoints (e.g., GET /metrics or POST /query), request/response schemas, supported filters (time range, dimensions), aggregations (sum, avg, percentiles), and pagination. Use a declarative, versioned JSON format.

3. Design the query and aggregation layer

Describe how the API translates requests into efficient queries against a time-series or OLAP store (e.g., Druid, ClickHouse, or pre-aggregated tables). Discuss push-down of filters, pre-computation, and handling of high-cardinality dimensions.

4. Address performance, caching, and security

Explain caching strategies (Redis, CDN), rate limiting, and authentication/authorization (row-level security, tenant isolation). Mention async query support for long-running requests.

5. Discuss trade-offs and evolution

Highlight trade-offs between flexibility and performance, and how you'd evolve the API (e.g., adding new aggregations, supporting real-time vs. batch). Mention monitoring and observability.

Key Points to Mention

  • Declarative query API with filters, group-by, and aggregations (avoid raw SQL exposure)
  • Use of pre-aggregated tables or OLAP engines for low-latency queries
  • Caching strategies (Redis, in-memory) and cache invalidation
  • Multi-tenancy and row-level security to isolate customer data
  • Rate limiting, pagination, and async query support for large results
  • Versioning and backward compatibility for API evolution

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