0
0
Microservicessystem_design~20 mins

Service-to-service authentication in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Service Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding service-to-service authentication methods

Which of the following methods is most suitable for authenticating microservices communicating within a trusted internal network?

AEmbedding static API keys in service requests without rotation
BUsing mutual TLS (mTLS) certificates exchanged between services
CRelying solely on IP whitelisting without any cryptographic verification
DUsing user session tokens passed between services
Attempts:
2 left
💡 Hint

Think about secure identity verification between services without relying on user context.

Architecture
intermediate
2:00remaining
Designing a token-based service-to-service authentication flow

In a microservices architecture, which sequence correctly describes a typical OAuth 2.0 client credentials flow for service-to-service authentication?

AService A requests an access token from the authorization server, then uses the token to call Service B
BService A directly calls Service B without any token, relying on network security
CService A sends user credentials to Service B to authenticate
DService B requests a token from Service A before processing the request
Attempts:
2 left
💡 Hint

Consider which service obtains the token and who validates it.

scaling
advanced
2:00remaining
Scaling service-to-service authentication with token caching

To reduce latency and load on the authorization server, a microservice caches access tokens. Which approach best balances security and performance?

ARequest a new token for every service call without caching
BCache tokens indefinitely without checking expiry to avoid repeated requests
CCache tokens until they expire, then request new ones; validate token expiry before each use
DCache tokens but ignore expiry and refresh only on failure
Attempts:
2 left
💡 Hint

Think about token validity and avoiding unnecessary calls.

tradeoff
advanced
2:00remaining
Choosing between mTLS and token-based authentication

Which statement best describes a tradeoff when choosing between mutual TLS (mTLS) and OAuth 2.0 token-based authentication for service-to-service security?

AmTLS provides strong identity verification but is complex to manage at scale; tokens are easier to rotate but require additional validation logic
BTokens are more secure than mTLS because they use encryption; mTLS does not encrypt data
CTokens cannot be revoked once issued; mTLS certificates never expire
DmTLS requires user credentials; tokens do not require any credentials
Attempts:
2 left
💡 Hint

Consider management complexity and security features.

estimation
expert
3:00remaining
Estimating token validation load in a large microservices system

A system has 100 microservices, each making 50 authenticated calls per second to other services using OAuth 2.0 tokens. If each token validation takes 5 milliseconds on average, estimate the total CPU time spent per second on token validation across the system.

A250 seconds of CPU time per second
B2.5 seconds of CPU time per second
C0.25 seconds of CPU time per second
D25 seconds of CPU time per second
Attempts:
2 left
💡 Hint

Calculate total calls per second and multiply by validation time.