← All questions
HardTechnical

Assume admins are tenant-scoped, red-admin has no blue membership, and the database worker can read all tenants. Review this pseudocode and write a finding plus regression tests.

1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below

The problem

Assume admins are tenant-scoped, red-admin has no blue membership, and the database worker can read all tenants. Review this pseudocode and write a finding plus regression tests.

actor = require_session(request)
require(actor.role == 'admin')
rows = invoices.where(tenant_id=request.body.tenant_id)
return storage.write(rows).download_url

Reference answer

Then expect these follow-ups

  • What should happen if the user's export permission is revoked while a background job waits?

Free to read · better with Enzo

Practice this out loud with Enzo

Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.

Next question