0
0
Expressframework~20 mins

API gateway concept in Express - 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
What is the primary role of an API Gateway in a microservices architecture?

Choose the best description of the main function of an API Gateway.

AIt acts as a single entry point that routes client requests to multiple backend services.
BIt stores all the data for the microservices in a centralized database.
CIt replaces the need for backend services by handling all business logic itself.
DIt directly connects clients to each microservice without any routing.
Attempts:
2 left
💡 Hint

Think about how clients interact with many services through one interface.

Architecture
intermediate
2:00remaining
Which component is NOT typically handled by an API Gateway?

Select the feature that an API Gateway usually does NOT provide.

ARequest routing and load balancing
BAuthentication and authorization
CDirect database query execution
DResponse aggregation from multiple services
Attempts:
2 left
💡 Hint

Consider what tasks are usually done by backend services versus the gateway.

scaling
advanced
2:00remaining
How does an API Gateway help improve scalability in a distributed system?

Choose the option that best explains how an API Gateway supports system scalability.

ABy storing all user sessions centrally in the gateway
BBy directly managing database connections for all services
CBy replacing backend services with a single monolithic service
DBy caching responses and reducing load on backend services
Attempts:
2 left
💡 Hint

Think about how reducing repeated work can help scale better.

tradeoff
advanced
2:00remaining
What is a common tradeoff when using an API Gateway in system design?

Identify the main downside of introducing an API Gateway.

AIt can become a single point of failure if not designed for high availability.
BIt eliminates the need for backend services, increasing complexity.
CIt requires clients to connect directly to multiple services.
DIt reduces security by exposing all backend services publicly.
Attempts:
2 left
💡 Hint

Consider what happens if the gateway goes down.

component
expert
2:00remaining
In an Express-based API Gateway, which middleware is best suited to handle authentication before routing requests?

Select the middleware type that should be used to authenticate requests in an Express API Gateway.

AA middleware that modifies response headers after sending the response
BA global middleware that checks tokens before any route handlers
CA route-specific middleware that runs after forwarding the request
DA middleware that only logs requests without blocking unauthorized ones
Attempts:
2 left
💡 Hint

Authentication should happen early to block unauthorized access.