{
  "app": {
    "name": "Mokabla",
    "url": "https://www.mokabla.com",
    "description": "Real interview questions from companies in Egypt, organised by company. Access is sold per company for 30 days."
  },
  "page": {
    "kind": "question",
    "title": "Question · sql-queries-on-paper",
    "humanPath": "/en/c/maxab/sql-queries-on-paper",
    "humanOnly": false
  },
  "identity": {
    "class": "declared",
    "agent": "ClaudeBot",
    "operator": "Anthropic",
    "verified": false,
    "reason": "The user agent is ClaudeBot (Anthropic), which identifies itself as an AI agent.",
    "signals": [
      "Known agent user agent"
    ],
    "claimable": false
  },
  "state": {
    "question": {
      "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?"
    },
    "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."
  },
  "actions": [
    {
      "name": "get_question",
      "description": "One question with its body. Bodies are paid content unless the question is free.",
      "permission": "allow",
      "sideEffect": "read",
      "input": {
        "company": "string",
        "question": "string"
      },
      "href": "https://www.mokabla.com/agent/_call/get_question?company=maxab&question=sql-queries-on-paper",
      "ready": true,
      "missing": [],
      "humanPath": "https://www.mokabla.com/en/pricing"
    },
    {
      "name": "list_questions",
      "description": "The questions reported at a company: titles, tags, difficulty, whether each is free or paid.",
      "permission": "allow",
      "sideEffect": "read",
      "input": {
        "company": "string",
        "page": "number?"
      },
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=maxab",
      "ready": true,
      "missing": []
    },
    {
      "name": "buy_access",
      "description": "Buy 30 days of access to a company.",
      "permission": "block",
      "reason": "This action is for people only",
      "ruleId": "R1",
      "sideEffect": "payment",
      "input": {
        "company": "string"
      },
      "href": "https://www.mokabla.com/agent/_call/buy_access?company=maxab",
      "ready": true,
      "missing": [],
      "humanPath": "https://www.mokabla.com/en/pricing"
    },
    {
      "name": "post_comment",
      "description": "Comment on a question.",
      "permission": "block",
      "reason": "This action is for people only",
      "ruleId": "R1",
      "sideEffect": "write",
      "input": {
        "question": "string",
        "text": "string"
      },
      "href": "https://www.mokabla.com/agent/_call/post_comment?question=sql-queries-on-paper",
      "ready": false,
      "missing": [
        "text"
      ],
      "humanPath": "https://www.mokabla.com/en/companies"
    }
  ],
  "navigate": [
    {
      "label": "This question, as data (free questions only)",
      "href": "https://www.mokabla.com/agent/_call/get_question?company=maxab&question=sql-queries-on-paper"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=maxab"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/maxab"
    },
    {
      "label": "SQL Queries on Paper · page",
      "href": "https://www.mokabla.com/agent/en/c/maxab/sql-queries-on-paper"
    }
  ],
  "notices": [
    {
      "severity": "info",
      "message": "This classification is final for the session: it came from a strong signal, not a guess. The human pages are not served to agents."
    },
    {
      "severity": "info",
      "message": "Unverified agents are read-only. Signed requests (Web Bot Auth) are the path to write access."
    }
  ],
  "meta": {
    "requestId": "ag_f963924f1a93",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T18:39:00.575Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/maxab/sql-queries-on-paper?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/maxab/sql-queries-on-paper",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fmaxab%2Fsql-queries-on-paper"
  }
}