← Zettabyte Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

System design round at Zettabyte for a full-stack role. The whole session was basically one big multi-tenancy deep dive, which I was not expecting to go as broad as it did.

Questions Asked (4)

Q1

Walk me through the main isolation models for multi-tenant architecture and the trade-offs between them.

System DesignTechnical Trade-offsData Modeling
Author's notes

I knew the three models (separate database per tenant, shared database with separate schemas, shared database with a tenant_id column everywhere) but I fumbled the trade-off framing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining multi-tenancy and the three main isolation models: shared database with shared schema, shared database with separate schemas, and separate databases. Then discuss the trade-offs in terms of cost, scalability, security, and operational complexity, and conclude with how to choose based on business needs.

Pro tip: Emphasize that the choice often depends on regulatory requirements and tenant size; a hybrid approach (e.g., separate databases for enterprise tenants, shared for SMBs) is common in practice.

1. Define Multi-Tenancy and Isolation

Briefly explain what multi-tenancy is and why isolation matters for security, performance, and compliance.

2. Describe the Isolation Models

Outline the three primary models: shared database shared schema, shared database separate schemas, and separate databases. Mention variations like separate tables per tenant.

3. Analyze Trade-offs

Compare the models across dimensions: cost, scalability, isolation/security, operational complexity, and performance.

4. Discuss Selection Criteria

Explain how factors like tenant size, regulatory requirements, and budget influence the choice, and mention hybrid approaches.

5. Conclude with Best Practices

Summarize key considerations and suggest that the decision should align with business goals and technical constraints.

Key Points to Mention

  • Shared database, shared schema: lowest cost, but noisy neighbor and security risks.
  • Shared database, separate schemas: better isolation, moderate cost, but schema management overhead.
  • Separate databases: highest isolation and performance, but highest cost and operational complexity.
  • Trade-offs: cost, scalability, security, compliance, and operational overhead.
  • Hybrid approaches: mix models based on tenant tier (e.g., enterprise vs. SMB).
  • Considerations: data residency, backup/restore, and tenant onboarding/offboarding.

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

Q2

How do you propagate tenant identity through a request, from the edge all the way down to the data layer?

System DesignAPI & Integrations
Author's notes

This is where I felt most comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Walk through the full request lifecycle, starting at the edge where tenant identity is first established (e.g., via subdomain, JWT claim, or API key), then explain how it is carried through each layer using a consistent mechanism like a request-scoped context or header. Emphasize that the tenant ID must be immutable and validated at every boundary, and finally show how it is enforced at the data layer via row-level security or tenant-scoped queries.

Pro tip: Mention the importance of propagating tenant identity even for asynchronous and background jobs, and highlight that you never trust client-supplied tenant IDs without verifying them against the authenticated principal.

1. Establish tenant identity at the edge

Explain how the tenant is identified at the entry point: via subdomain, path prefix, JWT claim, or API key. Ensure it is extracted and validated before any business logic runs.

2. Propagate through service boundaries

Describe how the tenant ID is attached to the request context (e.g., HTTP headers, gRPC metadata) and passed to downstream services, ensuring it cannot be spoofed or overridden.

3. Maintain in application context

Show how the tenant ID is stored in a request-scoped context (e.g., ThreadLocal, AsyncLocalStorage) so it is accessible throughout the call stack without explicit parameter passing.

4. Enforce at the data layer

Explain how the tenant ID is used to scope database queries, either via row-level security policies, tenant-specific schemas, or mandatory WHERE clauses, ensuring data isolation.

5. Handle async and background work

Discuss how tenant identity is preserved in asynchronous tasks, message queues, and scheduled jobs, often by embedding it in the message payload or job metadata.

Key Points to Mention

  • Use of standards like JWT claims or OAuth2 scopes for tenant identification
  • Propagation via headers (e.g., X-Tenant-ID) or context objects, with validation at each hop
  • Defense against tenant spoofing by verifying the tenant ID against the authenticated user's permissions
  • Data isolation strategies: shared database with row-level security, separate schemas, or separate databases
  • Observability: including tenant ID in logs, metrics, and traces for debugging and auditing
  • Handling of cross-tenant operations (e.g., admin access) with explicit elevation and audit trails

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

Q3

How would you prevent one tenant from degrading performance for others, and how do you handle tenant-specific configuration and customizations?

System DesignTechnical Trade-offs
Author's notes

Two questions kind of merged into one here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that multi-tenancy requires a balance between isolation and efficiency. Then, outline strategies for performance isolation (e.g., resource quotas, rate limiting, noisy neighbor detection) and for managing tenant-specific configurations (e.g., metadata-driven customization, feature flags, separate schemas). Emphasize trade-offs and monitoring.

Pro tip: Mention that you would implement tenant-aware observability to detect and alert on noisy neighbors early, and that you would use progressive rollouts for tenant-specific customizations to avoid breaking others.

1. Clarify requirements and constraints

Ask about the scale, isolation level (shared vs. dedicated resources), and customization needs. This shows you consider context before designing.

2. Design for performance isolation

Propose mechanisms like resource quotas, rate limiting, and workload prioritization. Mention techniques like bulkheads, circuit breakers, and autoscaling per tenant.

3. Implement tenant-specific configuration

Use a metadata-driven approach with a configuration service, feature flags, and tenant-aware routing. Consider schema-per-tenant or shared schema with tenant ID for data isolation.

4. Monitor and enforce

Set up tenant-aware monitoring, logging, and alerting. Use anomaly detection to identify noisy neighbors and automatically throttle or isolate them.

5. Iterate and optimize

Discuss trade-offs (e.g., cost vs. isolation) and how you would evolve the design based on feedback and metrics.

Key Points to Mention

  • Resource quotas and rate limiting per tenant
  • Bulkhead pattern and cell-based architecture for isolation
  • Feature flags and metadata-driven configuration for customizations
  • Tenant-aware observability and alerting
  • Trade-offs between isolation, cost, and complexity
  • Progressive rollout and canary testing for tenant-specific changes

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

Q4

How do you handle backups and migrations in a multi-tenant setup, particularly when tenants may be on different versions of the schema?

System DesignData Modeling
Author's notes

Honestly the part I'd prep harder for next time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the multi-tenant architecture (shared DB vs. separate schemas) and the constraints around backups and migrations. Then explain a version-aware strategy: decouple schema versions from application code, use expand-contract migrations, and ensure backups are tenant-consistent and restorable per version. Emphasize automation, testing, and rollback plans.

Pro tip: Always design migrations to be backward-compatible for at least one version, and use feature flags to control access to new schema features. This avoids downtime and allows tenants to upgrade on their own schedule.

1. Clarify the multi-tenant model and constraints

Ask about the isolation level (shared DB, shared schema, separate schemas, or separate DBs) and any SLAs for backup/restore and migration downtime. This determines the appropriate tooling and approach.

2. Design version-aware backups

Ensure backups capture both data and schema version metadata. For shared databases, use logical backups per tenant or point-in-time recovery with tenant filtering. For separate schemas/DBs, back up each tenant independently and tag with schema version.

3. Implement expand-contract migrations

Use a phased migration pattern: first expand the schema (add new columns/tables) without breaking old code, then migrate data, then contract (remove old structures) only after all tenants have upgraded. This supports tenants on different versions.

4. Automate and orchestrate migrations per tenant

Use a migration tool that tracks schema versions per tenant and can apply migrations incrementally. Schedule migrations during low-traffic windows and provide rollback scripts. For large tenants, consider online schema change tools.

5. Test and monitor

Test migrations on a staging environment with representative tenant data and versions. Monitor performance and errors during and after migration. Have a rollback plan and communicate with tenants about expected changes.

Key Points to Mention

  • Multi-tenant isolation models (shared DB, shared schema, separate schemas, separate DBs) and their impact on backup/migration strategies.
  • Schema versioning and metadata tracking per tenant to manage different versions.
  • Expand-contract (parallel change) migration pattern for backward compatibility.
  • Backup consistency and point-in-time recovery for multi-tenant data, including tenant-level restore.
  • Automation and orchestration tools (e.g., Flyway, Liquibase, custom scripts) with per-tenant migration tracking.
  • Rollback strategies and testing migrations on staging with real tenant data.

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