{
  "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 · nth-highest-bill",
    "humanPath": "/en/c/vodafone/nth-highest-bill",
    "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": "nth-highest-bill",
      "title": "Nth Highest Bill",
      "difficulty": "easy",
      "tags": [
        "sql",
        "oa",
        "intern",
        "data-eng"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 0.667,
      "last_reported_at": "2026-11-03T18:38:21.547384Z",
      "url": "https://www.mokabla.com/en/c/vodafone/nth-highest-bill",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/vodafone/nth-highest-bill",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=vodafone&question=nth-highest-bill"
      },
      "company": {
        "slug": "vodafone",
        "name_en": "Vodafone Egypt / _VOIS"
      },
      "body_md": "## Problem\nGiven `bills(msisdn, bill_month, plan, amount)`, return for **every plan** the `N`-th highest **distinct** bill amount in a given month. If a plan has fewer than `N` distinct amounts, return `NULL` for it rather than omitting the plan.\n\n`N` and the month are parameters.\n\n## Examples\n**Example 1**, `bill_month = 2026-07`, `N = 2`\n```\nflex: 300, 300, 250, 100\nred:  900\n```\n→ `flex 250` (the two `300`s count once), `red NULL`.\n\n**Example 2**, `N = 1` → `flex 300`, `red 900`.\n\n## Constraints\n- `bills` has `~30M` rows per month.\n- Must return one row per plan even when the answer is `NULL`.\n- Postgres, MySQL 8 or Oracle.\n\n## What they look for\n`DENSE_RANK()` partitioned by plan and ordered by amount descending, then `rk = N`. The `NULL` requirement is the real test: you need a `LEFT JOIN` from the distinct plans (or a correlated scalar subquery) so the plan survives when no row has rank `N`. Candidates who use `LIMIT 1 OFFSET N-1` get asked what happens with ties and with multiple plans. Know the difference between `RANK`, `DENSE_RANK` and `ROW_NUMBER` on the `300, 300` case; it is asked every time.",
      "follow_ups_md": "- Same, but N-th highest **including** duplicates (`ROW_NUMBER`).\n- Return the msisdns that have that N-th amount.\n- Do it without window functions."
    },
    "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=vodafone&question=nth-highest-bill",
      "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=vodafone",
      "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=vodafone",
      "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=nth-highest-bill",
      "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=vodafone&question=nth-highest-bill"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=vodafone"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/vodafone"
    },
    {
      "label": "Nth Highest Bill · page",
      "href": "https://www.mokabla.com/agent/en/c/vodafone/nth-highest-bill"
    }
  ],
  "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_4a67b85c5f25",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T18:42:31.172Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/vodafone/nth-highest-bill?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/vodafone/nth-highest-bill",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fvodafone%2Fnth-highest-bill"
  }
}