Skip to content
Tech Interview Prep
Technical interview guide

RBAC vs. ABAC Implementation

Assigning permissions via roles versus evaluating policies against attributes: the implementation tradeoffs of each.

Read
45 min
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: NIST RBAC and SP 800-162, NIST SP 800-207, current AWS/Azure/Google IAM, OPA, Cedar, and XACML guidance reviewed 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-18A document service evaluates access with a first-match-wins policy engine. The rules, in order, are: (1) deny if subject.role is 'contractor'; (2) allow if resource.tenant equals subject.tenant and subject.role is 'editor' or 'admin'; (3) allow if resource.classification is 'public'; (4) otherwise deny. A request arrives with subject {role: 'editor', tenant: 'acme'} and resource {tenant: 'globex', classification: 'public'}. What does the engine return?
MCQ-6A cluster runs Kubernetes v1.29 with the default RBAC authorizer. ServiceAccount `ci-runner` in namespace `build` is bound by a ClusterRoleBinding to ClusterRole `pod-reader`, which grants `get`, `list` and `watch` on `pods` in every namespace. To stop the CI runner reading pods in `prod`, an engineer creates Role `deny-pod-read` in namespace `prod` with the single rule `apiGroups: [""], resources: ["pods"], verbs: ["deny"]`, and binds it to the same ServiceAccount with a RoleBinding in `prod`. What does `kubectl auth can-i get pods -n prod --as=system:serviceaccount:build:ci-runner` print?
MCQ-9A tenant's RBAC service stores the role hierarchy as child→parent edges, and a role inherits every permission held by its parent. Effective permissions are computed by walking parent edges and skipping any role already visited, so the walk always terminates. A migration script wrote edges straight to the table, bypassing the API's cycle check, and left this graph: Support-L1→Support-L2, Support-L2→OnCall, OnCall→SRE, SRE→Support-L1, Auditor→OnCall. The tenant has 62 roles in total. `prod:db:delete` is granted directly to Support-L1 and to no other role. Which roles now have `prod:db:delete` in their effective permission set?
MCQ-8An RBAC service enforces static separation of duty with a conflict table of mutually exclusive role pairs and a role hierarchy. Priya is assigned `branch_operator`, which inherits `initiator`. She requests `approver`; the table lists `initiator` and `approver` as mutually exclusive. Which check correctly enforces static separation of duty for this request?
MCQ-1A 400-person company has 12 job functions, 3 regions, and 60 internal resources. Access is reviewed quarterly. 32 employees hold two job functions, and 4 contractors rotate through job functions every quarter. No resource has an individual owner, and access depends only on job function and region. The team wants the fewest policy objects that still express every employee's access and keep quarterly reviews tractable. Which model should be primary?
MCQ-2A B2B SaaS platform runs RBAC with 1,800 roles. An access review finds that 92% of them differ from another role only in tenant and project; the remaining 8% are one-off break-glass grants tied to an incident. The IdP already issues signed tenant and project claims on every login, and the resource service stamps every object with tenant and project. Which change collapses the role count?
MCQ-16A team replaces 300 RBAC role bindings with 40 ABAC rules. An auditor asks for the list of principals that can read record 4471. The team can read all 40 rules in an afternoon, yet they cannot produce the list without running the decision engine over sampled request contexts. What makes the review work different?
MCQ-5An API gateway evaluates authorization before forwarding requests to downstream microservices. Why does an ABAC engine that dynamically resolves missing attributes incur higher and more variable p99 latency than a standard RBAC role check?
MCQ-4A service's authorization gate reads every attribute from a policy information point (PIP). When the PIP's upstream call fails, it returns an empty `map[string]string`. The gate is: ```go // Go 1.22 func allow(attrs map[string]string) bool { if attrs["role"] == "admin" { return true } return attrs["resource_team"] == attrs["caller_team"] } ``` A request arrives and the PIP's call to the attribute service times out, so it returns an empty map. What does `allow` return, and why?
MCQ-3Policy: permit read if subject.clearance >= resource.classification, with classification 0 (public) through 3 (restricted). The gateway sends the PDP the JWT's subject claims, the action, and the resource path, so the decision log shows resource.classification=(none) and PERMIT for each of the 1,240 restricted documents, all now readable by every employee. Classification is a per-document catalog field: 312 of those 1,240 were reclassified in place last quarter without their paths changing. The PDP is stateless, holds no catalog credentials, and answers 4,000 decisions/s within a 5 ms p99 budget. The JWT is minted at login and refreshed every 8 hours. Ninety reads a day by clearance-3 staff on restricted documents must keep succeeding. What is the correct change?
MCQ-24A policy engine evaluates 1,240 rules against `user.clearance`, an integer 0–3 that today means the highest classification the user may read. The team is redefining the attribute to mean the lowest classification the user must hold to be granted access, and is rewriting rules to read a new `user.clearance_v2` that carries the new meaning. The engine skips any rule whose condition errors, and a missing attribute is an error: an erroring permit rule cannot grant, and an erroring forbid rule cannot deny. `clearance` is written by a nightly HR sync that cannot be redeployed for six weeks and by an admin console that ships weekly; the HR system's records cover all 41,000 principals. What must the team do before the first rewritten rule takes effect?
MCQ-17A policy engine allows `export:customer_data` when `env.geo_country` is DE, FR or NL. The attribute is resolved once per authenticated session and cached for the session's lifetime; sessions last up to 30 days. A session opened from a German IP on day 0 kept exporting after that IP block was reassigned to a Russian ISP on day 12: 4,000 records over the next 18 days. Which change removes the root cause?
MCQ-20An authorization service compiles all policies and exceptions into a bundle on every policy write and serves decisions from that bundle until the next write. Expiry is evaluated at compile time: an exception whose expiry has already passed when the bundle is compiled is dropped from it. At decision time the engine reads only the bundle: it does not re-read the exception store or the directory. The last policy write was 2024-07-15. The store holds one exception: principal `role:analytics`, action `s3:GetObject`, resource `reports/*`, owner `data-platform`, expiry 2024-06-01. The `data-platform` group was deleted from the directory on 2024-08-12. On 2025-02-10 a request from `role:analytics` for `reports/q3.csv` arrives. What does the engine return?
MCQ-11An API gateway caches authorization decisions in-process with key `principal_id|method|path`, TTL 300 s, and serves a hit without re-contacting the policy engine. Policy deploys do not flush the cache. At 09:58:00 the gateway cached ALLOW for principal 8817, GET /reports/2024. At 10:00:00 policy v43 was deployed, removing `reports:read` from the `analyst` role; principal 8817 is an analyst. At 10:00:05 principal 8817 requests GET /reports/2024. What does the gateway return, and when does the stale decision stop being served?
MCQ-23A user's role is removed in the identity provider. The backend service caches each user's role set for 60 seconds and re-reads it from the policy service when that cache expires. The policy service caches role lookups for 600 seconds. Measured p99 from role removal to the first 403 is 10 minutes. The team cuts the policy service cache from 600 seconds to 5 seconds. What is the expected p99 afterward?
MCQ-19An engineer transfers from Payments to Marketing, effective Monday 09:00. HR is authoritative. A SCIM connector pushes HR attributes to the IdP every 15 minutes. Access to the payments production database comes from the IdP group `payments-prod`, whose membership is computed from the HR department field by a batch job that runs daily at 02:00. The revocation SLO for stale entitlements is 4 hours from the HR effective time. When is `payments-prod` access actually revoked, and does it meet the SLO?
MCQ-12A payments service routes two endpoints through one policy sidecar with a 50 ms decision timeout: POST /transfer, which moves money between accounts, and GET /balance, which reads the caller's own balance using a query already filtered by the caller's tenant ID. During a 20-second sidecar restart every decision times out. Which timeout behavior is correct?
MCQ-13A multi-tenant API serves `GET /v1/orders/{id}` by loading the order row by primary key and then authorizing with `allow if order.tenant_id == principal.tenant_id`. Which test most directly catches a regression that lets tenant A read tenant B's order?
MCQ-7A multi-tenant billing API sits behind a gateway that verifies the JWT signature and rejects any request whose `{tenantId}` path segment differs from the token's `tenant_id` claim. The invoice handler runs `SELECT id, tenant_id, total FROM invoices WHERE id = $1`, binding `$1` to the `{invoiceId}` path segment. A pentest using a tenant-7 token that carries `invoice:read`: `GET /tenants/7/invoices/8842`, invoice 8842 belongs to tenant 9, returns 200 with tenant 9's invoice, while `GET /tenants/9/invoices/8842` with the same token returns 403. The tester got 8842 from a CSV export their own tenant was allowed to download. Which change closes the leak?
MCQ-21A service exposes `POST /v1/documents:bulkDelete`, which accepts up to 500 document IDs and must be all-or-nothing: if the caller cannot delete any one of the listed documents, none are deleted. Authorization is per-document via a table `acl(user_id, doc_id)`; there is no folder or collection permission. A security review finds that a user who can delete exactly 1 of the 500 documents in their batch can delete all 500, and that the permitted document is neither first nor last in the batch. Which handler behavior produces this?
MCQ-22A document service enqueues export jobs onto a worker pool. Each worker authenticates to object storage with a service account that holds read/write on every tenant's bucket. A user whose role grants read-only access to tenant A's bucket requests an export. The job waits a median of 40 minutes in the queue; the user's access token expires after 15 minutes. The worker picks up the job and runs the export with its own credentials. Which outcome does this design produce?
MCQ-10An e-commerce platform gives its 14 on-call engineers break-glass access to the production AWS account through a single IAM role. During a launch, the role's MaxSessionDuration was raised to the service maximum of 12 hours (43200 seconds) and never lowered. Security reviewed the quarter's 41 approved elevations: the median incident ran 28 minutes, the longest ran 3 hours 40 minutes, and six credentials were still accepted by the AWS API more than eight hours after their ticket closed. The team's new rules: an elevated credential must stop working on its own, with nobody acting after the fact, and it must not expire while an incident is still open, because a credential that dies mid-incident blocks the rollback the on-call is running. Which change meets both rules?
MCQ-14A team manages AWS IAM policies with Terraform. A PR changes the policy attached to the `prod-reports-reader` role. The policy has 40 actions. The diff adds `s3:DeleteObject` and `s3:PutObject` on `arn:aws:s3:::prod-reports/*`, and removes `s3:GetObject` and `s3:ListBucket` on the same bucket. The role's real traffic in the last 30 days used 6 actions, including all 4 changed actions. CI runs `terraform plan` and shows only the policy document changed. The reviewer must approve or reject. What should the deployment diff show to catch both unintended privilege expansion and lockout before apply?
MCQ-15A payments API asks a central policy service for every authorization decision and writes one audit record per decision. During a fraud review the team must answer one question about a decision made 62 days ago: why was request R (user 8842, action transfer, resource account 5510) allowed? The policy bundle has been redeployed 11 times inside the 90-day retention window, and each record currently holds only the timestamp, the decision, the user ID, and the HTTP status returned to the caller. Which addition to the record makes that question answerable?
MCQ-25A payments team replays 30 days of captured production authorization requests through the old and new policies before enforcing the new one. The replay covers 1,061,000 requests. The old policy denied 61,000; the new policy denies 74,000. Of the requests the old policy allowed, 13,000 are denied by the new policy, and 12,400 of those 13,000 are the intended block of a compromised service account, svc-batch. The team's release gate is an unintended-regression rate of at most 0.1% of previously-allowed traffic. What unintended-regression rate should the team report?