0
0
HLDsystem_design~20 mins

REST API design for systems in HLD - Practice Problems & Coding Challenges

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

Which statement best describes the statelessness principle in REST API design?

AAPI requests can depend on previous requests to complete successfully.
BThe server must store session information to track user state between requests.
CEach API request must contain all information needed to process it, without relying on stored context on the server.
DClients should maintain no state and rely on the server to remember previous interactions.
Attempts:
2 left
💡 Hint

Think about how REST APIs handle client-server communication without storing session data.

Architecture
intermediate
2:00remaining
Choosing HTTP Methods for REST API

Which HTTP method is the most appropriate for updating an existing resource completely in a REST API?

APUT
BPOST
CGET
DDELETE
Attempts:
2 left
💡 Hint

Consider which method replaces the entire resource at the given URI.

scaling
advanced
2:30remaining
Scaling REST APIs with Caching

Which caching strategy best improves REST API scalability by reducing server load for frequently requested data?

ADisable caching to always serve fresh data.
BUse client-side caching with cache-control headers and ETags.
CStore all responses permanently on the server without expiration.
DCache only POST request responses on the client.
Attempts:
2 left
💡 Hint

Think about how HTTP headers help clients avoid unnecessary requests.

tradeoff
advanced
2:30remaining
Tradeoffs in REST API Versioning

What is a common tradeoff when using URI versioning (e.g., /v1/resource) in REST API design?

AIt eliminates the need for documentation since versions are clear in the URI.
BIt allows seamless backward compatibility without any extra server maintenance.
CIt forces clients to always use the latest API version without choice.
DIt simplifies client requests but can lead to duplicated code and maintenance overhead on the server.
Attempts:
2 left
💡 Hint

Consider how versioning affects server code and client flexibility.

estimation
expert
3:00remaining
Estimating API Throughput for a High-Traffic REST Service

A REST API server handles 10,000 requests per second on average. Each request takes 50ms of server processing time. How many concurrent requests must the server handle to sustain this throughput without queuing?

A500 concurrent requests
B200 concurrent requests
C50 concurrent requests
D1000 concurrent requests
Attempts:
2 left
💡 Hint

Use Little's Law: Concurrent = Throughput × Latency.