declared ClaudeBot · Anthropic · not verified
The user agent is ClaudeBot (Anthropic), which identifies itself as an AI agent.
Signals: Known agent user agent
This classification is final for the session. The human pages are not served to agents.
{
"question": {
"slug": "top-products-and-slow-endpoint-coding-challenge",
"title": "Top Products and Slow Endpoint Coding Challenge",
"difficulty": "medium",
"tags": [
"system-design",
"sql",
"backend",
"take-home"
],
"is_free": true,
"locked": false,
"frequency": 1,
"last_reported_at": "2025-01-22T08:38:49.094595Z",
"url": "https://www.mokabla.com/en/c/rabbit/top-products-and-slow-endpoint-coding-challenge",
"agent": {
"page": "https://www.mokabla.com/agent/en/c/rabbit/top-products-and-slow-endpoint-coding-challenge",
"question": "https://www.mokabla.com/agent/_call/get_question?company=rabbit&question=top-products-and-slow-endpoint-coding-challenge"
},
"company": {
"slug": "rabbit",
"name_en": "Rabbit"
},
"body_md": "## What they ask\n\nBackend candidates receive a coding challenge sized at three to four hours, delivered as a repository from the company's own GitHub organisation: a NestJS project with Prisma, a seed script, and a `package.json` you are told to read carefully because some of the installed libraries are there to help you. You bring any SQL database (Postgres or MySQL). Two requirements:\n\n1. **Top 10 most ordered products in an area.** A new endpoint for the app's home screen that returns the ten products ordered most often in a given area or region. It will be hit millions of times, so design it for that.\n2. **Fix the slow products listing.** The existing `GET /products` is deliberately badly written: inefficient queries and poor practices. Review it, refactor it, and you may change the request and response contracts (DTOs, filters) if that makes it faster and more reliable.\n\nPlus tests that prove the top-10 endpoint is correct, documentation of your assumptions, and a note on what you would do with more time. Optional bonus: send a push notification (Pushover is suggested) when a new order is created. Submit as a public GitHub or GitLab link. The business framing in the brief: multiple stores across the region, thousands of orders a day.\n\nThe challenge is announced after the HR call. One senior candidate's \"coding challenge\" slot turned out to be a system design conversation instead, so confirm which one you are getting.\n\n## What they look for\n\n- The top-10 query done with an aggregate and an index (or a precomputed table) rather than loading orders into memory, and cached, since the data changes slowly and the traffic is huge; Redis through the cache manager already listed in `package.json` is the expected move.\n- The products endpoint fixed at the root: pagination, selecting only the needed columns, no N+1, filters pushed into the query, cursor or offset chosen and justified.\n- Tests on the ranking itself: ties, areas with fewer than ten products, cancelled orders.\n- An assumptions section that says what \"area\" means in your model and how stale the cached top-10 is allowed to be.",
"follow_ups_md": "- The top-10 must reflect a new order within a minute. What changes?\n- How would you invalidate the cache per area without a thundering herd at 7 pm?\n- Where does the notification bonus belong: the service, an event handler, or a queue?"
},
"paid": false,
"access": "Question bodies are paid content: a person buys 30 days of access per company (200 EGP or 200 points) in the human app. Agents get titles, tags and difficulty; bodies only for free questions."
}
| action | input | permission | |
|---|---|---|---|
| get_question One question with its body. Bodies are paid content unless the question is free. | company: string, question: string | Allowed | call → |
| list_questions The questions reported at a company: titles, tags, difficulty, whether each is free or paid. | company: string, page: number? | Allowed | call → |
| buy_access Buy 30 days of access to a company. | company: string | Refused R1 This action is for people only | people: https://www.mokabla.com/en/pricing |
| post_comment Comment on a question. | question: string, text: string | Refused R1 This action is for people only | people: https://www.mokabla.com/en/companies |
Allowed actions answer in JSON. Add ?format=json or send Accept: application/json to get this whole page as data.