← Zettabyte Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at Zettabyte for a full-stack role. The whole session was basically one long deep-dive into multi-tenancy architecture, which I wasn't expecting to go that far into the weeds on.

Questions Asked (4)

Q1

Walk me through how you would design multi-tenancy into an application, covering the main isolation approaches and their trade-offs.

System DesignTechnical Trade-offsData Modeling
Author's notes

This is where most of the session went.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints (e.g., number of tenants, data volume, compliance needs) before diving into isolation models. Then compare the three main approaches—silo, pool, and bridge—highlighting trade-offs in cost, isolation, and operational complexity. Finally, recommend a hybrid approach based on the specific context and explain how you would handle cross-cutting concerns like tenant identification and data migration.

Pro tip: Demonstrate maturity by acknowledging that multi-tenancy is not just a database concern—it affects the entire stack, including caching, messaging, and deployment. Also, mention that the choice often evolves as the product scales, so design for flexibility.

1. Clarify Requirements and Constraints

Ask about the expected number of tenants, data volume, isolation requirements (e.g., compliance, security), and performance SLAs. This determines which isolation models are viable.

2. Compare Isolation Models

Explain the three primary models: silo (separate resources per tenant), pool (shared resources with tenant ID), and bridge (hybrid, e.g., shared database with separate schemas). Discuss trade-offs in cost, isolation, scalability, and operational overhead.

3. Address Cross-Cutting Concerns

Cover tenant identification (e.g., via subdomain, JWT claim), data partitioning, and how to handle shared services like caching, logging, and messaging without leaking data across tenants.

4. Recommend and Justify

Based on the requirements, recommend a specific approach (or hybrid) and justify it. Discuss how you would handle scaling, tenant onboarding/offboarding, and potential migration paths.

Key Points to Mention

  • Silo model: highest isolation, but costly and hard to manage at scale; suitable for enterprise tenants with strict compliance.
  • Pool model: cost-efficient and scalable, but requires robust tenant isolation in code and queries; risk of noisy neighbor.
  • Bridge model: balances isolation and cost, e.g., shared database with separate schemas per tenant; easier migration to silo if needed.
  • Tenant context propagation: ensure tenant ID is included in all requests, background jobs, and logs; use middleware or interceptors.
  • Data partitioning strategies: sharding by tenant ID, row-level security, or separate schemas; consider indexing and query performance.
  • Operational considerations: monitoring per tenant, backup/restore granularity, and compliance with data residency regulations.

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 and enforce it at the data layer?

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

Talked about pulling tenant context from the subdomain, a JWT claim, or a request header, then threading it through middleware so every repository call automatically scopes to the right tenant.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how tenant identity is established at the edge (e.g., from JWT or subdomain) and then propagated through the call stack using context objects or headers. Then describe how you enforce it at the data layer via row-level security, query filters, or a tenant-aware data access layer, emphasizing defense in depth.

Pro tip: Mention that you never trust client-supplied tenant IDs and always derive them from authenticated tokens; also highlight the importance of automated tests that attempt cross-tenant access to catch regressions.

1. Establish tenant identity

Explain how the tenant is identified at the entry point, such as from a JWT claim, API key, or subdomain, and validated against the authenticated user.

2. Propagate through the request

Describe the mechanism for carrying tenant context through synchronous and asynchronous calls, e.g., using thread-local storage, context objects, or headers in service-to-service communication.

3. Enforce at data access layer

Detail how the tenant ID is used to filter or restrict data access, such as through an ORM middleware, database row-level security, or a repository pattern that automatically scopes queries.

4. Add defense in depth

Mention additional safeguards like database views, stored procedures, or a policy engine that enforces tenant isolation even if application code has bugs.

5. Test and monitor

Explain how you verify tenant isolation with integration tests that simulate cross-tenant access and monitor for violations in production.

Key Points to Mention

  • Use of JWT or OAuth tokens to carry tenant identity securely
  • Context propagation patterns: ThreadLocal, AsyncLocal, or explicit context passing
  • Database row-level security (RLS) or tenant ID columns with mandatory filters
  • Avoiding tenant ID in client-controlled parameters to prevent tampering
  • Centralized enforcement in a data access layer or middleware to avoid duplication
  • Automated tests for cross-tenant access and audit logging for tenant operations

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

Q3

One tenant is consuming a disproportionate amount of resources and degrading performance for others. How do you handle that?

System DesignTechnical Trade-offs
Author's notes

Per-tenant rate limits and resource quotas was the obvious answer and I led with it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the problem and emphasizing the importance of fairness and isolation in multi-tenant systems. Then walk through a systematic approach: detect, diagnose, mitigate, and prevent, while balancing technical solutions with business considerations. Conclude by highlighting the need for monitoring, quotas, and communication with the tenant.

Pro tip: Show empathy for the tenant's needs while protecting the platform; propose a phased approach that starts with non-disruptive measures like rate limiting and monitoring before considering stricter actions. Also, mention the importance of documenting and learning from the incident to improve the system.

1. Detect and Confirm

Use monitoring and alerting to identify the tenant causing disproportionate resource consumption. Confirm the impact on other tenants and gather data on the specific resources (CPU, memory, I/O, network) being overused.

2. Diagnose Root Cause

Investigate why the tenant is consuming excessive resources: is it a sudden spike, a misconfiguration, a bug, or malicious behavior? Analyze logs, metrics, and traces to understand the pattern and underlying cause.

3. Mitigate Immediately

Apply short-term fixes to protect other tenants, such as rate limiting, throttling, or temporarily isolating the tenant. If possible, communicate with the tenant to inform them and seek cooperation.

4. Implement Long-Term Solutions

Introduce or enforce quotas, resource limits, and fair scheduling algorithms. Consider architectural changes like cell-based isolation or dedicated instances for high-resource tenants. Automate enforcement to prevent recurrence.

5. Review and Improve

Conduct a post-mortem to understand gaps in monitoring, alerting, and policies. Update runbooks, SLAs, and tenant onboarding processes. Share learnings with the team to improve overall system resilience.

Key Points to Mention

  • Multi-tenancy isolation techniques (e.g., cgroups, namespaces, rate limiting, quotas)
  • Monitoring and observability tools (e.g., Prometheus, Grafana, distributed tracing) to detect and diagnose issues
  • Fair resource allocation algorithms (e.g., weighted fair queuing, token buckets)
  • Communication and escalation procedures with the tenant and internal stakeholders
  • Trade-offs between strict enforcement and tenant flexibility, and between quick fixes and long-term architectural changes
  • Preventive measures such as automated quota enforcement, capacity planning, and chaos engineering

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

Q4

How do you manage tenant-specific configuration, feature customizations, and migrations across tenants without breaking things?

System DesignTechnical Trade-offsData Modeling
Author's notes

Honestly the part I was least prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem around isolation vs. shared infrastructure, then walk through your data model for tenant configs, your feature flagging strategy, and your migration process with safety mechanisms. Emphasize how you balance flexibility for tenants with operational simplicity and backward compatibility.

Pro tip: Mention that you treat tenant configuration as code and version it alongside migrations, enabling rollbacks and audit trails. Also, highlight the importance of a canary tenant for testing migrations before rolling out to all tenants.

1. Clarify Requirements and Constraints

Ask about the scale (number of tenants, data volume), isolation requirements (compliance, security), and customization needs (per-tenant features, configs). This shows you tailor solutions to context.

2. Design the Data Model for Tenant Configuration

Propose a schema that supports hierarchical configuration (global defaults, tenant overrides) and versioning. Discuss trade-offs between storing configs in a database vs. files, and how to handle secrets.

3. Implement Feature Customization with Feature Flags

Explain how you use feature flags to enable/disable features per tenant, and how you manage flag lifecycle (creation, rollout, cleanup). Mention tools like LaunchDarkly or custom solutions.

4. Plan Safe Migrations with Backward Compatibility

Describe a migration strategy that includes schema changes, data backfills, and config updates. Emphasize expand-contract pattern, dual-write, and canary deployments to avoid breaking changes.

5. Monitor, Test, and Rollback

Outline how you monitor migration health (metrics, logs), test with a subset of tenants, and have a rollback plan. Mention automated testing for tenant-specific scenarios.

Key Points to Mention

  • Multi-tenant data isolation patterns (shared DB with tenant ID, schema-per-tenant, DB-per-tenant) and their trade-offs
  • Configuration management: hierarchical configs, versioning, and validation
  • Feature flagging strategies: per-tenant flags, gradual rollouts, and flag cleanup
  • Database migration techniques: expand-contract, online schema changes, and data backfill
  • Backward compatibility and API versioning for tenant-specific customizations
  • Observability and rollback: canary tenants, monitoring, and automated rollback triggers

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