0
0
Microservicessystem_design~20 mins

API Gateway pattern in Microservices - Practice Problems & Coding Challenges

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

Which of the following best describes the primary role of an API Gateway in a microservices architecture?

AIt directly manages the deployment and scaling of individual microservices.
BIt acts as a single entry point that routes client requests to appropriate microservices and handles cross-cutting concerns like authentication and rate limiting.
CIt replaces the need for microservices by combining all services into one monolithic application.
DIt stores all the data for microservices and manages database transactions across services.
Attempts:
2 left
💡 Hint

Think about what a single point of contact for clients would do in a system with many small services.

Architecture
intermediate
2:00remaining
API Gateway Request Flow

In an API Gateway pattern, what is the correct sequence of steps when a client sends a request?

A2,1,3,4,5
B1,2,4,3,5
C1,3,2,4,5
D1,2,3,4,5
Attempts:
2 left
💡 Hint

Authentication usually happens before routing the request to a service.

scaling
advanced
2:00remaining
Scaling Challenges with API Gateway

What is a common scaling challenge when using an API Gateway in a large microservices system?

AThe API Gateway can become a bottleneck if it cannot handle the volume of incoming requests efficiently.
BThe API Gateway automatically scales all microservices regardless of their load.
CMicroservices lose their ability to communicate with each other directly.
DClients must connect to each microservice individually, increasing complexity.
Attempts:
2 left
💡 Hint

Consider what happens if one component handles all incoming traffic.

tradeoff
advanced
2:00remaining
Tradeoffs of Using an API Gateway

Which of the following is a tradeoff when implementing an API Gateway pattern?

AIt removes the need for authentication and security measures in microservices.
BIt eliminates the need for microservices, reducing system complexity.
CIt simplifies client communication but adds an extra network hop, potentially increasing latency.
DIt guarantees zero downtime during microservice deployments without additional configuration.
Attempts:
2 left
💡 Hint

Think about what happens when you add an extra step in communication.

estimation
expert
3:00remaining
Capacity Estimation for API Gateway

You expect 10,000 client requests per second to your microservices system. Each request passes through the API Gateway, which adds 5ms processing overhead per request. Your microservices handle requests in 50ms on average. What is the minimum number of API Gateway instances needed to keep average API Gateway processing latency under 20ms assuming each instance can handle 2,000 requests per second?

A5 instances
B10 instances
C2 instances
D20 instances
Attempts:
2 left
💡 Hint

Calculate how many requests per second each instance can handle and divide total load accordingly.