{
  "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 · diamond-problem-in-interfaces",
    "humanPath": "/en/c/sumerge/diamond-problem-in-interfaces",
    "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": "diamond-problem-in-interfaces",
      "title": "Diamond Problem in Interfaces",
      "difficulty": "medium",
      "tags": [
        "oop-design",
        "technical",
        "swe"
      ],
      "is_free": true,
      "locked": false,
      "frequency": 0.5,
      "last_reported_at": "2025-10-03T20:14:09.314413Z",
      "url": "https://www.mokabla.com/en/c/sumerge/diamond-problem-in-interfaces",
      "agent": {
        "page": "https://www.mokabla.com/agent/en/c/sumerge/diamond-problem-in-interfaces",
        "question": "https://www.mokabla.com/agent/_call/get_question?company=sumerge&question=diamond-problem-in-interfaces"
      },
      "company": {
        "slug": "sumerge",
        "name_en": "Sumerge"
      },
      "body_md": "## What they ask\nThe board technical interview (two or three engineers) covers databases, OOP and problem solving. In the OOP part they go past the four pillars and ask about the diamond problem, specifically in the context of interfaces with default methods.\n\nTypical sequence:\n1. Why does Java forbid extending two classes but allow implementing many interfaces?\n2. Since Java 8 interfaces can carry default methods. If `Flyer` and `Swimmer` both declare `default void move()`, and `Duck implements Flyer, Swimmer`, what happens?\n3. How do you resolve it, and how do you call one specific parent's version?\n4. How does C++ approach the same shape (virtual inheritance) and why is that more complicated?\n\n## Example\n```java\ninterface Flyer   { default String move() { return \"fly\"; } }\ninterface Swimmer { default String move() { return \"swim\"; } }\nclass Duck implements Flyer, Swimmer {\n    @Override public String move() {\n        return Flyer.super.move() + \" then \" + Swimmer.super.move();\n    }\n}\n```\nWithout the override in `Duck`, the compiler rejects the class; that is the whole point of the question.\n\n## What they look for\n- Knowing that the conflict is a compile-time error, not a runtime surprise, and the exact `Interface.super.method()` syntax.\n- Explaining the rule \"class wins over interface\" when a superclass also defines the method.\n- A view on design: default methods are for evolving APIs, not for multiple inheritance of state.",
      "follow_ups_md": "- What if `Flyer` extends `Swimmer` and both define `move()`?\n- Why are interface fields implicitly static and final?"
    },
    "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=diamond-problem-in-interfaces",
      "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=diamond-problem-in-interfaces",
      "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=diamond-problem-in-interfaces"
    },
    {
      "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": "Diamond Problem in Interfaces · page",
      "href": "https://www.mokabla.com/agent/en/c/sumerge/diamond-problem-in-interfaces"
    }
  ],
  "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_1e42ae59cd32",
    "policyVersion": "mokabla-2026-11-03",
    "generatedAt": "2026-11-03T17:39:51.105Z",
    "jsonUrl": "https://www.mokabla.com/agent/en/c/sumerge/diamond-problem-in-interfaces?format=json",
    "manifestUrl": "https://www.mokabla.com/.well-known/agentgate.json",
    "humanUrl": "https://www.mokabla.com/en/c/sumerge/diamond-problem-in-interfaces",
    "humanClaimUrl": "https://www.mokabla.com/agent/_claim/human?to=%2Fen%2Fc%2Fsumerge%2Fdiamond-problem-in-interfaces"
  }
}