{
  "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 · merchant-growth-sql",
    "humanPath": "/en/c/paymob/merchant-growth-sql",
    "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": "merchant-growth-sql",
      "title": "Merchant Growth Query",
      "difficulty": "medium",
      "tags": [
        "sql",
        "technical",
        "backend",
        "data-eng"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 0.6,
      "last_reported_at": "2026-07-27T20:54:51.003258Z",
      "url": "https://www.mokabla.com/en/c/paymob/merchant-growth-sql",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/paymob/merchant-growth-sql",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=paymob&question=merchant-growth-sql"
      },
      "company": {
        "slug": "paymob",
        "name_en": "Paymob"
      },
      "body_md": "## Problem\nUsing the tables below, write a query that returns, for each merchant, their successful transaction volume\nin the current month and the previous month, plus month-over-month growth as a percentage. Then a second\nquery: the 10 merchants with the highest success rate over the last 90 days, counting only merchants with\nat least 500 attempts. Success rate = successful ÷ (successful + failed); `pending` rows are excluded from\nboth numerator and denominator.\n\n```\nmerchants(id, name, created_at)\ntransactions(id, merchant_id, amount_cents, status, created_at)   -- status in ('success', 'failed', 'pending')\n```\n\n## Examples\n**Example 1**, \"Breadfast\": July successes 1,200,000 EGP, August 1,500,000 EGP → growth 25.0%. A\nmerchant with July 0 and August 400,000 → growth NULL (not infinite), still listed.\n\n**Example 2**, \"Elmenus\": 5,000 successes, 500 failures, 100 pending in 90 days → rate 90.9%, eligible.\nA merchant with 300 attempts at 100% is not listed.\n\n## Constraints\n- Use a fixed reference date parameter (`:as_of`), not `now()`, so the query is testable\n- Volume is stored in piasters (`amount_cents`); output EGP with 2 decimals\n- Growth rounded to 1 decimal; NULL when the previous month is 0\n\n## What they look for\nConditional aggregation (`SUM(CASE WHEN ...)` / `FILTER`) instead of self-joins, `date_trunc` for month\nboundaries, `NULLIF` for the zero-division case, and `HAVING` for the attempts threshold. Follow-up: an\nindex for both queries, `(merchant_id, created_at)` including `status`, and whether a nightly\nmaterialised view is the better answer.",
      "follow_ups_md": "- Same growth report but by payment method within each merchant.\n- How does the answer change if `created_at` is stored in UTC and the business day is Cairo time?"
    },
    "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=paymob&question=merchant-growth-sql",
      "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=paymob",
      "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=paymob",
      "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=merchant-growth-sql",
      "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=paymob&question=merchant-growth-sql"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=paymob"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/paymob"
    },
    {
      "label": "Merchant Growth Query · page",
      "href": "https://www.mokabla.com/agent/en/c/paymob/merchant-growth-sql"
    }
  ],
  "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_e2d7fad40d8a",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T17:41:35.128Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/paymob/merchant-growth-sql?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/paymob/merchant-growth-sql",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fpaymob%2Fmerchant-growth-sql"
  }
}