{
  "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 · trace-the-code-output",
    "humanPath": "/en/c/sumerge/trace-the-code-output",
    "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": "trace-the-code-output",
      "title": "Trace the Code Output",
      "difficulty": "medium",
      "tags": [
        "oop-design",
        "oa",
        "swe",
        "fundamentals"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 0.25,
      "last_reported_at": "2025-10-20T19:14:08.823675Z",
      "url": "https://www.mokabla.com/en/c/sumerge/trace-the-code-output",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/sumerge/trace-the-code-output",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=sumerge&question=trace-the-code-output"
      },
      "company": {
        "slug": "sumerge",
        "name_en": "Sumerge"
      },
      "body_md": "## What they ask\nThe first stage for associate and junior engineers is an online IQ plus technical assessment (TestGorilla). Besides multiple choice items, there is a debugging-style task: a long, deliberately messy piece of code, and you write exactly what it prints when executed. No compiler, just you and the snippet.\n\nA short example in the same spirit (the real one is longer and uglier):\n\n```java\nclass A {\n    static int n = 0;\n    int id;\n    A() { id = ++n; System.out.print(\"A\" + id + \" \"); }\n    void hi() { System.out.print(\"hiA \"); }\n}\nclass B extends A {\n    B() { super(); System.out.print(\"B\" + id + \" \"); }\n    @Override void hi() { System.out.print(\"hiB \"); }\n}\npublic class Main {\n    static void touch(A a) { a.id = 99; a = new A(); }\n    public static void main(String[] args) {\n        A x = new B();\n        x.hi();\n        touch(x);\n        System.out.print(x.id + \" \");\n        Integer p = 127, q = 127, r = 128, s = 128;\n        System.out.print((p == q) + \" \" + (r == s));\n    }\n}\n```\n\n## What they look for\n- Constructor chaining order (parent runs first), static counters shared across instances, dynamic dispatch on `hi()`.\n- Java passes references by value: `touch` mutates the shared object but its reassignment is invisible to the caller.\n- Small language traps like the Integer cache (`127` boxed values compare equal with `==`, `128` do not).\n- Discipline: writing intermediate values in the margin instead of guessing the final line.\n\nExpected output of the example: `A1 B1 hiB A2 99 true false`.",
      "follow_ups_md": "- What changes in the output if `n` is made an instance field?\n- Rewrite `touch` so the caller sees a new object."
    },
    "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=sumerge&question=trace-the-code-output",
      "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=sumerge",
      "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=sumerge",
      "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=trace-the-code-output",
      "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=sumerge&question=trace-the-code-output"
    },
    {
      "label": "All questions at this company",
      "href": "https://www.mokabla.com/agent/_call/list_questions?company=sumerge"
    },
    {
      "label": "The company page",
      "href": "https://www.mokabla.com/agent/en/c/sumerge"
    },
    {
      "label": "Trace the Code Output · page",
      "href": "https://www.mokabla.com/agent/en/c/sumerge/trace-the-code-output"
    }
  ],
  "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_074f334d63aa",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T17:38:35.605Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/sumerge/trace-the-code-output?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/sumerge/trace-the-code-output",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fsumerge%2Ftrace-the-code-output"
  }
}