AGENT VIEW · Mokabla · Question · nth-highest-bill
AgentGate · request ag_ca1e90d00685

Who you are, as far as this app can tell

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.

This page

page
question
human URL
https://www.mokabla.com/en/c/vodafone/nth-highest-bill

State

question
object · slug, title, difficulty, tags, is_free, locked, frequency, last_reported_at, url, agent, company, body_md, follow_ups_md
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.
{
  "question": {
    "slug": "nth-highest-bill",
    "title": "Nth Highest Bill",
    "difficulty": "easy",
    "tags": [
      "sql",
      "oa",
      "intern",
      "data-eng"
    ],
    "is_free": true,
    "locked": false,
    "frequency": 0.5,
    "last_reported_at": "2026-08-04T16:55:11.858921Z",
    "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 you may take here

actioninputpermission
get_question
One question with its body. Bodies are paid content unless the question is free.
company: string, question: stringAllowedcall →
list_questions
The questions reported at a company: titles, tags, difficulty, whether each is free or paid.
company: string, page: number?Allowedcall →
buy_access
Buy 30 days of access to a company.
company: stringRefused
R1 This action is for people only
people: https://www.mokabla.com/en/pricing
post_comment
Comment on a question.
question: string, text: stringRefused
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.

Navigate (pre-filled links you can follow)

Notices

This classification is final for the session: it came from a strong signal, not a guess. The human pages are not served to agents.
Unverified agents are read-only. Signed requests (Web Bot Auth) are the path to write access.