Problems / Cloud and cost, medium
A Java Lambda (Spring) takes 3 s to initialise. At 30 s a launch email quintuples traffic for 20 s: every request without a warm environment starts a new one and waits for INIT, which needs still more environments.
Unlock it once for 15 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.
Keep success at 99% or more and p99 under 1 s through the launch.
Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 3; 1 of them are hidden until then.
100 requests a second for 120 seconds: 100% api (reads).
What each component does in this design, and what calls it. The simulator mimics each one from these settings.
| Component | Its job here | Settings |
|---|---|---|
| API Gateway (HTTP API)API gateway | Traffic enters here.Calls Orders API (Java Lambda).Gateways centralise auth, rate limits and routing so each service does not reimplement them. | 100000 slots · 600,000 calls/min |
| Orders API (Java Lambda)Serverless function | API Gateway (HTTP API) forwards to it.Calls DynamoDB.Serverless functions scale per request, but a cold start adds latency to the first call. | 1000 slots |
| DynamoDBKey-value store | Orders API (Java Lambda) calls it.Key-value stores spread keys over partitions; one very popular key can overload a single partition. | 40 partitions × 3,000 ops/s |