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