0
0
Microservicessystem_design~20 mins

Role-based access control in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
RBAC Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Role Hierarchies in RBAC

In a microservices system using Role-Based Access Control (RBAC), which statement best describes the role hierarchy concept?

ARole hierarchy means roles are assigned randomly without any structure or inheritance.
BRoles are independent and do not share permissions; each role must be assigned permissions explicitly without inheritance.
CHigher roles inherit permissions from lower roles, allowing users with higher roles to access all resources of lower roles.
DLower roles inherit permissions from higher roles, so users with lower roles can access resources of higher roles.
Attempts:
2 left
💡 Hint

Think about how managers have more access than employees in a company.

Architecture
intermediate
2:00remaining
Designing RBAC in Microservices

Which architecture best supports centralized role management and decentralized permission enforcement in a microservices environment?

AEach microservice manages its own roles and permissions independently without a central authority.
BA central authorization service manages roles and permissions; each microservice queries it to enforce access control locally.
CRoles and permissions are hardcoded in each microservice's codebase with no external management.
DA central database stores user data but roles and permissions are managed by clients.
Attempts:
2 left
💡 Hint

Think about separating management and enforcement responsibilities.

scaling
advanced
2:00remaining
Scaling RBAC for Millions of Users

When scaling RBAC for millions of users across many microservices, which approach best reduces latency and load on the central authorization service?

AUse short-lived access tokens containing user roles and permissions, validated locally by microservices without querying central service each time.
BRequire every microservice to query the central authorization service for each user request to get fresh permissions.
CStore all user roles and permissions in each microservice's local database and sync daily with central service.
DDisable RBAC and rely on network firewalls to restrict access.
Attempts:
2 left
💡 Hint

Think about caching permissions securely to avoid repeated calls.

tradeoff
advanced
2:00remaining
Tradeoffs in RBAC Permission Granularity

What is a key tradeoff when choosing very fine-grained permissions in an RBAC system for microservices?

AFine-grained permissions increase security but add complexity and overhead in managing many permissions.
BFine-grained permissions reduce security risks and simplify management.
CFine-grained permissions eliminate the need for roles entirely.
DFine-grained permissions always improve system performance.
Attempts:
2 left
💡 Hint

Consider how many permissions you must track and update.

estimation
expert
3:00remaining
Estimating Capacity for RBAC Authorization Service

You design a central RBAC authorization service for a system with 10 million users and 100 microservices. Each user makes on average 5 requests per second requiring authorization. Estimate the number of authorization checks per second the service must handle if all microservices query it directly.

A1 million authorization checks per second
B500 thousand authorization checks per second
C5 million authorization checks per second
D50 million authorization checks per second
Attempts:
2 left
💡 Hint

Multiply users, requests per second, and microservices.