Networking & IoT · Interview question

What is CoAP Observe, and how does it compare to MQTT's model?

A strong answer

Observe is a CoAP extension that turns a normally one-shot GET into a subscription: the client sends a GET with the Observe option, and rather than answering once, the server registers the client and pushes a fresh response every time the observed resource changes, until the client cancels or the registration expires. It's effectively lightweight publish/subscribe layered on CoAP's request/response model, letting a client track a sensor value without polling. Compared to MQTT, the difference is topology and direction. MQTT is broker-centric pub/sub: devices connect outbound to a central broker, publish to and subscribe from topics, and the broker decouples and routes, which is NAT-friendly because devices dial out and stay connected. CoAP Observe is broker-less and rooted in request/response: the observer (client) contacts the device (acting as a CoAP server) and the device pushes updates back, so it works without a broker but requires the device to be reachable by the client (a problem behind NAT) and is point-to-point rather than fan-out through a broker. So Observe gives you push notifications in a constrained, broker-free, RESTful setting, while MQTT gives you decoupled, NAT-friendly, broker-mediated pub/sub, and the two are often combined, with CoAP at the constrained edge bridged to MQTT toward the cloud.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

CoAP

REST for tiny devices: CoAP brings HTTP-like GET/POST/PUT/DELETE to constrained nodes over UDP with a 4-byte header, optional confirmable reliability, Observe push, and DTLS security.

More CoAP questions

Browse all 472 interview questions
What is CoAP Observe, and how does it compare to MQTT's model? | EmbeddedPrep.io