Learn the vocabulary of IoT communication protocols: MQTT, CoAP, topics, QoS levels, and device broker concepts.
0 / 18 completed
1 / 18
MQTT is designed primarily for:
MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe protocol designed for constrained devices and unreliable networks.
2 / 18
In MQTT, a 'topic' is:
An MQTT topic is a UTF-8 string (e.g., sensors/room1/temperature) that devices publish to or subscribe from — the broker routes messages by topic.
3 / 18
MQTT QoS level 2 guarantees:
QoS 2 is the highest MQTT quality of service level, using a four-step handshake to guarantee exactly-once message delivery.
4 / 18
CoAP differs from HTTP primarily because it:
CoAP (Constrained Application Protocol) is a RESTful protocol designed for low-power, constrained IoT devices — it uses UDP and has very low overhead compared to HTTP.
5 / 18
An MQTT 'broker' is responsible for:
The MQTT broker is the central server that receives messages from publishers and routes them to all matching subscribers based on topic subscriptions.
6 / 18
Sarah: 'This PR needs more detail about the protocol. We're sending temperature data from these sensors – are we using MQTT or CoAP? And what's our strategy for message retention and QoS?'
Which of the following completes Sarah's feedback in the PR description to ensure clarity regarding data transmission protocols?
The correct answer highlights MQTT's suitability for IoT data streaming due to its lightweight design and publish/subscribe model. Sarah's concerns about message retention and QoS are directly addressed by mentioning these key aspects of MQTT configuration. The other options misrepresent the protocols – HTTP is not optimized for low-bandwidth IoT, CoAP focuses on constrained devices but doesn't inherently dictate retention policies, and using a REST API would be less efficient than a protocol like MQTT designed specifically for this use case.
7 / 18
Sarah: 'This PR needs more detail about the protocol. We're sending temperature data from these sensors – are we using MQTT or CoAP? And what's our strategy for message retention and QoS?'
Which of the following completes Sarah's feedback in the PR description to ensure clarity regarding data transmission protocols?
The correct answer highlights MQTT's suitability for IoT data streaming due to its lightweight design and publish/subscribe model. Sarah's concerns about message retention and QoS are directly addressed by mentioning these key aspects of MQTT configuration. The other options misrepresent the protocols – HTTP is not optimized for low-bandwidth IoT, CoAP focuses on constrained devices but doesn't inherently dictate retention policies, and using a REST API would be less efficient than a protocol like MQTT designed specifically for this use case.
8 / 18
Sarah: 'This PR needs more detail about the protocol. We're sending temperature data from these sensors – are we using MQTT or CoAP? And what's our strategy for message retention and QoS?'
Which of the following completes Sarah's feedback in the PR description to ensure clarity regarding data transmission protocols?
The correct answer highlights MQTT's suitability for IoT data streaming due to its lightweight design and publish/subscribe model. Sarah's concerns about message retention and QoS are directly addressed by mentioning these key aspects of MQTT configuration. The other options misrepresent the protocols – HTTP is not optimized for low-bandwidth IoT, CoAP focuses on constrained devices but doesn't inherently dictate retention policies, and using a REST API would be less efficient than a protocol like MQTT designed specifically for this use case.
9 / 18
Sarah: 'This PR needs more detail about the protocol. We're sending temperature data from these sensors – are we using MQTT or CoAP? And what's our strategy for message retention and QoS?'
Which of the following completes Sarah's feedback in the PR description to ensure clarity regarding data transmission protocols?
The correct answer highlights MQTT's suitability for IoT data streaming due to its lightweight design and publish/subscribe model. Sarah's concerns about message retention and QoS are directly addressed by mentioning these key aspects of MQTT configuration. The other options misrepresent the protocols – HTTP is not optimized for low-bandwidth IoT, CoAP focuses on constrained devices but doesn't inherently dictate retention policies, and using a REST API would be less efficient than a protocol like MQTT designed specifically for this use case.
10 / 18
The MQTT_QoS parameter controls the reliability of messages. Which level guarantees at least once delivery?
Options:
A) 0 - Unreliable delivery.
B) 1 - At most once delivery.
C) 2 - At least once delivery.
D) 3 - Guaranteed delivery (but not necessarily ordered).
MQTT QoS levels define the reliability of message delivery. QoS level 2 ensures that at least once delivery is guaranteed, meaning the broker will attempt to deliver the message and the sender will re-transmit if necessary. Options A and B represent unreliable or single-delivery scenarios respectively.
11 / 18
You're building a sensor network using MQTT. The following code snippet is responsible for publishing temperature readings to the 'temperature' topic:
mqttClient.publish('temperature/#', temperatureValue, 0, true);
What does the '#' symbol in this line represent? Select the best answer.
Options:
A) The MQTT broker's address.
B) A wildcard character representing multiple subtopics within the 'temperature' topic.
C) The temperature value itself.
D) A command to subscribe to the topic.
MQTT topics are hierarchical. Using a wildcard character like '#' allows you to publish messages to all subtopics under 'temperature'. This is useful for sending the same data to multiple sensors using different identifiers (e.g., temperature_sensor_1, temperature_sensor_2). Option A is incorrect as it's the broker address, C is wrong because the '#' is not the value and D describes a subscription action.
12 / 18
"Message retention" in an MQTT broker context refers to:
Options:
A) The frequency with which the broker updates its internal state.
B) The duration for which the broker stores message payloads before deleting them.
C) The maximum number of concurrent connections the broker can handle.
D) The protocol used to encrypt messages transmitted between devices and the broker.
Message retention is a critical aspect of MQTT brokers. It defines how long message data is stored before being automatically removed. This impacts storage requirements and the ability to replay historical data – crucial for debugging or analytics.
13 / 18
You're a developer reviewing a PR that adds sensor data publishing to an IoT device. The PR description mentions using CoAP and includes the following line: `coapClient.send(message);`. Which of the following statements best describes the role of the coapClient object in this scenario?
Options:
A) It represents a database storing sensor readings.
B) It's an MQTT client responsible for publishing messages to the broker.
C) It's the CoAP library used to construct and send messages.
D) It handles authentication with the IoT device.
The coapClient object is a client-side implementation of the CoAP protocol. It's responsible for constructing and sending CoAP messages to the target device or server. Options A describes a database, B refers to MQTT, and D handles authentication – none of which accurately describe this usage.
14 / 18
A logistics company uses IoT sensors to monitor the temperature of refrigerated trucks. They receive data via MQTT and need to understand how quickly the broker can process messages. Which statement best describes the role of the `qos` (Quality of Service) setting in this context?
MQTT's `qos` levels are designed for reliability and priority. QoS level 2 guarantees at least once delivery of messages, prioritizing data integrity over immediate processing speed. Options A & B relate to throughput/speed; option D is incorrect as `qos` doesn't directly affect driver interface updates.
15 / 18
// Code Review Comment// The IoT device publishes sensor readings to a MQTT broker. This code snippet attempts to automatically retry failed publish operations.mqttClient.publish('temperature', temperatureValue, 0, true);if (!mqttClient.is_connected()) {print('Not connected');}// What is the primary purpose of this code snippet?
The `if (!mqttClient.is_connected())` block and subsequent `print('Not connected')` are for logging/debugging when the connection fails. The core purpose is to retry publishing messages upon failure – a crucial aspect of robust IoT data transmission. Option A is correct, while options B & D are misinterpretations.
16 / 18
// Slack Message// During a discussion about optimizing energy consumption, a developer mentions CoAP."We should consider using CoAP for our smart meters – it's designed for constrained devices and has lower overhead than MQTT."Which of the following best explains why the developer recommends CoAP in this scenario?
CoAP's design prioritizes efficiency – lower overhead (less data transmission) is crucial for constrained devices like smart meters that might have limited bandwidth or battery life. This aligns with the developer's focus on optimization. Options A & B are incorrect; option D is a general feature of IoT protocols, not CoAP's core distinction.
17 / 18
// PR Description// Adding support for publishing sensor data to a new API endpoint."This change introduces a new API endpoint that allows the device to send temperature readings to the cloud. The API uses CoAP and employs message retention to manage historical data."Which of the following best describes the primary function of 'message retention' in this context?
Message retention is about storing data. The PR description explicitly mentions using it to manage 'historical data'. Options A & D are incorrect; option B describes data purging, not retention.
18 / 18
// Standup Update// Discussing the design of an IoT device that collects environmental data."We're using MQTT for our sensor readings, and we've set the `qos` level to 2. This guarantees at least once delivery…"What does a `qos` (Quality of Service) level of 2 in an MQTT context primarily ensure?
`qos` level 2 guarantees at least once delivery. This means the MQTT broker will retry sending a message if it's initially lost; however, it doesn't guarantee that the message will be received exactly once due to potential network issues. Options A & B are incorrect as they relate to speed or guaranteed delivery.
What does the "IoT Protocol Vocabulary" exercise cover?
Learn the vocabulary of IoT communication protocols: MQTT, CoAP, topics, QoS levels, and device broker concepts.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
How many questions are in "IoT Protocol Vocabulary"?
This exercise has 18 questions. Each one gives instant feedback with an explanation, so you can see exactly why an answer is right or wrong.
Do I need to create an account to save my progress?
No account is required. The progress bar and score are tracked in your browser for the current session -- the exercise is designed to be a quick, repeatable drill rather than something you resume later.
What happens if I get an answer wrong?
You'll see the correct answer highlighted immediately, along with a short explanation of why it's correct. Wrong answers aren't penalized beyond your score, and you can keep going through every question.
How is this exercise different from reading an article?
Articles explain vocabulary and concepts through prose, while exercises like this one are interactive drills -- multiple-choice questions -- that test and reinforce your recall of specific terms and phrasing.
Can I retry this exercise?
Yes -- use the "Try again" button on the results screen to reset your score and go through all the questions again from the start.
Where can I find more Edge Iot exercises?
Browse the full Edge Iot hub for related drills, or check the site-wide exercises index for other IT English topics.
Is this exercise suitable for beginners?
This exercise assumes basic familiarity with IT terminology. If a term feels unfamiliar, check the site Glossary for a plain-English definition before attempting the questions.
How often is new content like this published?
New exercises are added regularly across all categories, alongside new vocabulary sets and articles. Check back on the exercises hub to see what's new.