AGENT CALL · Mokabla · get_question
request ag_1a4a526450e6

Decision

Allowed   R6 · Within policy

input
{"company":"maxab","question":"sql-queries-on-paper"}

Result

{
  "slug": "sql-queries-on-paper",
  "title": "SQL Queries on Paper",
  "difficulty": "medium",
  "tags": [
    "sql",
    "technical",
    "backend"
  ],
  "is_free": true,
  "locked": false,
  "frequency": 0.5,
  "last_reported_at": "2025-07-03T21:13:18.424415Z",
  "url": "https://www.mokabla.com/en/c/maxab/sql-queries-on-paper",
  "agent": {
    "page": "https://www.mokabla.com/agent/en/c/maxab/sql-queries-on-paper",
    "question": "https://www.mokabla.com/agent/_call/get_question?company=maxab&question=sql-queries-on-paper"
  },
  "company": {
    "slug": "maxab",
    "name_en": "MaxAB"
  },
  "body_md": "## What they ask\nThe technical round is with the engineering manager, in person, and it is old school: the questions are printed on paper and you write your answers on paper, SQL included. There is no sample data and no schema handed to you, so part of the exercise is stating your assumptions out loud before you write.\n\nThe questions are in the SQL area a B2B grocery marketplace cares about, for example:\n\n1. Given `retailers(id, city)`, `orders(id, retailer_id, created_at, status, total)`, and `order_items(order_id, product_id, qty, price)`, return the top 5 retailers by total order value in the last 30 days.\n2. List retailers who have placed no order in the last 60 days but had at least one order before that (churn candidates).\n3. For each city, the retailer with the second-highest order count.\n4. Explain what changes if `orders.total` is not stored and must be derived from `order_items`.\n\nThey may follow with which index you would add for query 1 and why.\n\n## What they look for\n- You draw the schema and name your assumptions (timezones, cancelled orders, currency) before writing.\n- Correct joins and grouping written by hand, no autocomplete to lean on.\n- Comfort with window functions or a clean alternative for ranking.\n- Knowing the difference between `WHERE` and `HAVING`, and between `LEFT JOIN ... IS NULL` and `NOT EXISTS`.\n- Being able to say how the query behaves on a large `orders` table.\n\nThe backend stack is Python with Django REST Framework on PostgreSQL, so Postgres-flavoured SQL is welcome.",
  "follow_ups_md": "- Rewrite query 2 with a `LEFT JOIN ... IS NULL` instead of `NOT EXISTS`. Which is clearer?\n- How would you express query 1 in the Django ORM?\n- Which index helps query 1 most, and would it help query 2?",
  "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."
}

Navigate (pre-filled links you can follow)