{
  "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 · reverse-list-in-place",
    "humanPath": "/en/c/siemens/reverse-list-in-place",
    "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": "reverse-list-in-place",
      "title": "Reverse List In Place",
      "difficulty": "easy",
      "tags": [
        "coding",
        "phone",
        "swe",
        "intern"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 1,
      "last_reported_at": "2026-06-10T13:54:57.792416Z",
      "url": "https://www.mokabla.com/en/c/siemens/reverse-list-in-place",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/siemens/reverse-list-in-place",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=siemens&question=reverse-list-in-place"
      },
      "company": {
        "slug": "siemens",
        "name_en": "Siemens (EDA / Digital Industries)"
      },
      "body_md": "## Problem\nReverse a singly linked list in place and return the new head. No extra list, no array copy; only pointer rewiring. Then do the same for every group of `k` nodes.\n\nIt is a warm-up, but I use it to see how you handle pointers under a little pressure and whether you test your own code before I do.\n\n## Examples\n**Example 1**, `1 -> 2 -> 3 -> 4 -> null` → `4 -> 3 -> 2 -> 1 -> null`\n\n**Example 2**, `k = 2` on `1 -> 2 -> 3 -> 4 -> 5` → `2 -> 1 -> 4 -> 3 -> 5`\nThe leftover group (size < k) stays as is.\n\n**Edge**, empty list → empty; single node → itself.\n\n## Constraints\n- `0 <= n <= 10^5` nodes.\n- `O(n)` time, `O(1)` extra space for the basic version. The recursive version is allowed only if you explain stack depth.\n- For the `k`-group variant, `1 <= k <= n`.\n\n## What they look for\nThe three-pointer walk (`prev`, `cur`, `next`) written without a bug on the first try, and drawing it on paper before typing. For `k` groups: counting ahead to check the group is full, reversing it, and reconnecting the tail of the previous group. In C, I also ask what happens if you forget to `NULL` the old head's `next`.",
      "follow_ups_md": "- Reverse in groups of `k`.\n- Reverse only the sub-list between positions `m` and `n`.\n- Detect a cycle before reversing; what would happen if there is one?"
    },
    "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=siemens&question=reverse-list-in-place",
      "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=siemens",
      "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=siemens",
      "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=reverse-list-in-place",
      "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=siemens&question=reverse-list-in-place"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=siemens"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/siemens"
    },
    {
      "label": "Reverse List In Place · page",
      "href": "https://www.mokabla.com/agent/en/c/siemens/reverse-list-in-place"
    }
  ],
  "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_74d84463aef1",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T17:56:49.281Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/siemens/reverse-list-in-place?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/siemens/reverse-list-in-place",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fsiemens%2Freverse-list-in-place"
  }
}