A two-line change to the response mapping turns one query into eleven thousand.
Context, code, logs and metrics, the same material you would have in production, with nobody pointing at the problem.
No multiple choice and no single right answer: you write what you think is happening, what you would do and what it costs.
The moment you submit, the written solution opens next to your answers, and stays open for you to reread whenever you want.
orders-api is the backend behind the merchant dashboard. Its busiest endpoint is GET /api/v1/orders?date=…, which merchants open every morning to see yesterday's orders. The page holds 250 rows.
const orders = await db.orders.findMany({
where: { merchantId: req.merchant.id, placedOn: req.query.date },
orderBy: { placedAt: "desc" },
take: 250,
});
return orders.map(toOrderResponse);A round trip from the application to PostgreSQL costs about 0.35ms.
Last sprint design asked for two additions per row: the customer's loyalty tier as a badge, and the product names as a subtitle. The change was reviewed by two people and shipped on Wednesday.
> The code is in TypeScript and the ORM is deliberately generic. This bug > belongs to no language and no library.
Locked
Opening a challenge costs 1 credit. A new account starts with 3, no card.