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": "embedded-c-code-tracing",
"title": "Embedded C Code Tracing",
"difficulty": "medium",
"tags": [
"coding",
"embedded",
"technical",
"role-embedded"
],
"is_free": true,
"locked": false,
"frequency": 0.75,
"last_reported_at": "2026-06-06T12:17:10.516707Z",
"url": "https://www.mokabla.com/en/c/si-ware/embedded-c-code-tracing",
"agent": {
"page": "https://www.mokabla.com/agent/en/c/si-ware/embedded-c-code-tracing",
"question": "https://www.mokabla.com/agent/_call/get_question?company=si-ware&question=embedded-c-code-tracing"
},
"company": {
"slug": "si-ware",
"name_en": "Si-Ware Systems"
},
"body_md": "## What they ask\nThe first technical round for the firmware side is centred on embedded systems and embedded C, and it starts after the obligatory walk through your graduation project. The format is distinctive: the interviewer introduces himself, gives you a short brief on what the company builds, asks some oral questions, and then puts **written code in front of you to trace** before handing over a paper exam. Several reports describe exactly that sequence, and the tracing part is where people come unstuck, because you cannot compile your way out of it.\n\n**The tracing questions.** Short snippets where you state the output. Pointer arithmetic on an array of structs. A `char` that should have been `unsigned char` compared against 255. Integer promotion in a comparison between a signed and an unsigned value. A shadowed variable in an inner block. Operator precedence with a shift and a mask in the same expression. `sizeof` on an array parameter after it has decayed to a pointer. A `static` local that keeps its value across calls.\n\n**The concepts around them.** `volatile` and the exact scenario where leaving it off breaks you, which is a hardware register the compiler decides to keep in a register. Where each object lives: stack, heap, `.bss`, `.data`, `.rodata`. Struct padding and how reordering fields shrinks the struct. What the vector table is, where the return address goes when an interrupt fires, and what you must not do inside an interrupt service routine.\n\n## The coding task\nThe representative hands on exercise, and the one that matches the work: a single producer single consumer ring buffer, written by the interrupt handler and read by the main loop. Capacity is a power of two. Implement `push`, `pop`, `isEmpty` and `isFull` using only a head and a tail index, with no separate count variable.\n\n## Examples\nCapacity 4. Push 1, 2, 3 then pop twice: you get 1 then 2, and `isEmpty` is false because 3 is still there.\n\nPush 1, 2, 3, 4 into a capacity of 4: the fourth `push` fails. With only head and tail and no count, one slot has to stay empty so that full and empty are distinguishable, and explaining that tradeoff out loud is most of the point of the question.\n\nPop from an empty buffer returns nothing and leaves the indices alone.\n\n## Constraints\n- Capacity is a power of two, so the wrap is a mask and not a modulo. Say why that matters on a small microcontroller.\n- No count variable and no lock.\n- Then the real question: which variables need to be `volatile`, which single index does each side write, and why that is what makes the structure safe without a critical section.\n\n## What they look for\nCorrect index arithmetic, and then the concurrency argument. Only the writer advances the head and only the reader advances the tail, each is a single aligned word write, so no mutual exclusion is needed as long as neither side caches the other's index. Candidates who reach for disabling interrupts get a working answer and miss the insight.",
"follow_ups_md": "- Which fields are `volatile` and why is that not sufficient on its own for a multi core part?\n- Now allow the full capacity to be used. What do you have to add and what do you lose?\n- Reorder the struct to shrink it and tell me by how much on a 32 bit target.\n- What happens if the producer is faster than the consumer for a sustained period, and how should the driver report that?"
},
"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.