0
0
HLDsystem_design~20 mins

API gateway concept in HLD - 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 an API Gateway in Microservices Architecture

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

AIt stores all the data for microservices and manages database transactions.
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 is responsible for deploying microservices to cloud infrastructure automatically.
DIt replaces the need for load balancers by distributing traffic evenly across servers.
Attempts:
2 left
💡 Hint

Think about what component manages client requests and common tasks like security in microservices.

Architecture
intermediate
2:00remaining
API Gateway Request Flow

In a system using an API Gateway, what is the correct sequence of steps when a client makes a request?

A1,2,3,4,5
B1,3,2,4,5
C2,1,3,4,5
D1,2,4,3,5
Attempts:
2 left
💡 Hint

Consider the logical order of authentication before routing and response flow.

scaling
advanced
2:00remaining
Scaling API Gateway for High Traffic

Your system uses an API Gateway that is becoming a bottleneck under high traffic. Which approach best improves scalability while maintaining reliability?

ARemove the API Gateway and let clients call microservices directly to reduce overhead.
BIncrease the CPU and memory of a single API Gateway instance to handle more requests.
CDeploy multiple instances of the API Gateway behind a load balancer to distribute incoming requests evenly.
DUse a single-threaded API Gateway instance to avoid concurrency issues.
Attempts:
2 left
💡 Hint

Think about horizontal scaling and fault tolerance.

tradeoff
advanced
2:00remaining
Tradeoff of Using API Gateway for Client Requests

What is a common tradeoff when introducing an API Gateway in front of microservices?

AIt guarantees zero downtime during deployments without additional effort.
BIt eliminates the need for microservices to handle any business logic.
CIt reduces security risks by removing authentication from the system.
DIt adds an extra network hop which can increase latency but centralizes cross-cutting concerns.
Attempts:
2 left
💡 Hint

Consider the impact on request time and system management.

estimation
expert
2:00remaining
Estimating API Gateway Capacity for Peak Load

Your API Gateway must handle 10,000 requests per second at peak. Each request takes 5 milliseconds of processing time on the gateway. How many API Gateway instances are needed to handle the load without queuing?

AAt least 50 instances
BAt least 20 instances
CAt least 10 instances
DAt least 5 instances
Attempts:
2 left
💡 Hint

Calculate how many requests one instance can handle per second, then divide total requests by that number.