The interview problem
A customer embeds a dashboard in its portal. Changing a browser filter reveals another tenant’s totals. Design a server-enforced fix and a rollout that proves isolation.
Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.
1. Scope and assumptions
The browser is not a trusted source of tenant identity. Cover charts, drill-downs, exports and cached aggregates. Assume a relational backend with row-policy support and a shared connection pool.
2. Architecture and decisions
Authenticated portal identity → trusted tenant context → restricted database role → row policy → scoped cache → dashboard
Derive tenant context from a verified server-side session or signed embedding contract. Execute queries under a role whose row policies are actually enforced; owner or privileged roles may bypass policies. Set request context transaction-locally and clear it reliably before returning a pooled connection. Reject missing context rather than selecting all tenants.
Scope cache keys and precomputed aggregates to the same authorization boundary. A correct database policy does not protect an aggregate computed under a privileged role and stored in a global cache. Inventory every read path, including CSV export and scheduled reports. Roll out first to synthetic tenants with unmistakably different fixture data.
3. Work through the example
Tenant A has 3 orders totaling 90 and tenant B has 2 totaling 900. A’s chart, drill-down and export must all report 3 and 90. Testing only a count can miss leakage if both tenants happen to have equal row counts; deliberately distinct fixtures reveal more failures.
4. Failure cases and trade-offs
Connection reuse can leak tenant context. An application filter can be omitted by a new query. Privileged service accounts can bypass row policies. Database enforcement reduces reliance on each developer remembering a WHERE clause, but requires careful role, view and cache design.
5. Validation and acceptance
Alternate A and B over the same pooled connection, omit identity and tamper with browser parameters. Verify exports and aggregate caches as well as charts. Acceptance requires zero cross-tenant fixture exposure and documented least-privilege roles.
6. Follow-ups and self-review
How would a legitimate cross-tenant administrator work? Reward trusted context, actual policy-enforcing roles, pool hygiene and complete path coverage.
Sources and related practice
PostgreSQL documents row-security policies and bypass behavior; this embedded-dashboard rollout is original.
Read the primary technical reference
Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.
Continue with Map enterprise permissions into retrieval access; Tamper-Evident Audit Log System Design: Integrity and Gaps.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.