Backend Developer Interview Question

How do you design authorization for a system where permissions vary by team, resource and plan?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Separate authentication from authorization, then choose a model: role based access control is simple and works when permissions cluster into a handful of roles, while attribute based rules suit conditions on the resource, such as owner, team or plan. Enforce it in one place, ideally a policy layer the handlers call, keep checks close to the data so a query cannot leak rows, and log every decision for audit.

Why interviewers ask this

The interviewer is checking whether you would sprinkle if statements through controllers or design something reviewable. They want to hear about centralizing policy, denying by default, and the classic broken object level authorization bug where an endpoint checks the user is logged in but not that the record belongs to them. Multi tenancy makes it sharper, since a missing filter leaks another customer's data.

How to structure your answer

  • Split authentication from authorization explicitly.
  • Pick a model and justify it by how the permissions actually cluster.
  • Put enforcement in one layer, defaulting to deny.
  • Cover object level checks and auditability.

Example answer

Spoken example, first person

Authentication answers who you are and happens once at the edge; authorization answers what you may do and happens on every request against a specific resource. For a model, I start with roles because they are easy to reason about and easy to explain to support, then add attribute conditions where roles alone cannot express it, things like this user is on the plan that includes exports, or this record belongs to their team. What matters more than the model is that there is exactly one place that decides. I want a policy function per resource type that handlers call, defaulting to deny, so adding a new endpoint that forgets the check is a visible omission rather than a silent hole. For anything multi tenant I also push the tenant filter into the data layer so a query physically cannot return another tenant's rows, because relying on every developer remembering a where clause fails eventually. And every decision is logged with the subject, resource and result, since the first question in any incident is who could see what.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • What is broken object level authorization, and how do you test for it?
  • How would you handle permissions that a customer administrator can configure?
  • Where do you cache authorization decisions without going stale?

Related backend developer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot