{
  "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 · cart-merge",
    "humanPath": "/en/c/noon/cart-merge",
    "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": "cart-merge",
      "title": "Cart Merge",
      "difficulty": "easy",
      "tags": [
        "coding",
        "phone",
        "swe",
        "backend"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 0.231,
      "last_reported_at": "2026-02-22T16:54:37.879762Z",
      "url": "https://www.mokabla.com/en/c/noon/cart-merge",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/noon/cart-merge",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=noon&question=cart-merge"
      },
      "company": {
        "slug": "noon",
        "name_en": "noon"
      },
      "body_md": "## Problem\nA shopper adds items as a guest, then logs in and already has a saved cart. Merge the two. Each cart is a list of `{sku, qty}` in the order items were added. Rules:\n\n- Same `sku` in both: quantities add up, capped by `max_qty[sku]` (default cap `10` if the SKU is not in the map).\n- Keep the **user** cart's order first, then guest-only SKUs in guest order.\n- Drop any line whose final quantity is `0`.\n- SKUs listed in `out_of_stock` are dropped entirely and returned separately so the UI can show a message.\n\nReturn `(merged, dropped)`.\n\n## Examples\n**Example 1**\n```\nuser  = [{A, 2}, {B, 1}]\nguest = [{B, 3}, {C, 1}]\nmax_qty = {B: 3}\n```\n→ merged `[{A, 2}, {B, 3}, {C, 1}]`, dropped `[]`. `B` would be 4 but is capped at 3.\n\n**Example 2**\n```\nuser  = [{A, 1}]\nguest = [{A, 0}, {D, 2}]\nout_of_stock = {D}\n```\n→ merged `[{A, 1}]`, dropped `[D]`.\n\n## Constraints\n- Up to `200` lines per cart; SKUs are strings; `0 <= qty <= 1000`.\n- Single pass per cart is enough; do not go quadratic on SKU lookup.\n- Be explicit about which cart wins on ties in ordering.\n\n## What they look for\nAn ordered map (or dict + list) so order is stable, the cap applied **after** summing, and the out-of-stock check done before the cap so the dropped list is accurate. The follow-up is usually about what happens if the user's cart changed on another device in between: version numbers or last-write-wins, and where that decision lives.",
      "follow_ups_md": "- The saved cart was modified on another device 5 seconds ago: how do you avoid overwriting it?\n- Prices changed between add and merge: whose price wins?\n- Guest cart lives in a cookie: size limits and tampering."
    },
    "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=noon&question=cart-merge",
      "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=noon",
      "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=noon",
      "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=cart-merge",
      "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=noon&question=cart-merge"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=noon"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/noon"
    },
    {
      "label": "Cart Merge · page",
      "href": "https://www.mokabla.com/agent/en/c/noon/cart-merge"
    }
  ],
  "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_8e720516e4a7",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T17:43:53.383Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/noon/cart-merge?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/noon/cart-merge",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fnoon%2Fcart-merge"
  }
}