0
0
IOT Protocolsdevops~20 mins

Publish-subscribe architecture in IOT Protocols - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Publish-Subscribe Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
How does the broker function in a publish-subscribe system?

In a publish-subscribe architecture, what is the main role of the broker?

AIt stores all messages permanently for future retrieval by subscribers.
BIt directly connects publishers and subscribers without storing messages.
CIt encrypts messages to ensure secure communication between devices.
DIt receives messages from publishers and forwards them to subscribers based on topics.
Attempts:
2 left
💡 Hint

Think about how messages flow from senders to receivers without direct connection.

💻 Command Output
intermediate
1:00remaining
MQTT subscribe command output

What is the expected output when a client successfully subscribes to the topic home/temperature using the MQTT command below?

IOT Protocols
mosquitto_sub -t home/temperature
ASubscribed (QoS 0)
BError: Topic not found
CNo output until a message is published
DConnection refused: not authorized
Attempts:
2 left
💡 Hint

Consider what happens immediately after subscribing before any messages arrive.

🔀 Workflow
advanced
2:00remaining
Order of steps to set up a publish-subscribe system

Arrange the steps below in the correct order to set up a basic publish-subscribe communication using MQTT.

A1,3,2,4
B3,1,2,4
C1,2,3,4
D2,1,3,4
Attempts:
2 left
💡 Hint

The broker must be running before clients connect; subscribers listen before messages are sent.

Troubleshoot
advanced
1:30remaining
Why does a subscriber not receive messages?

A subscriber client connected to the MQTT broker subscribes to sensor/data but never receives messages. Which is the most likely cause?

AThe publisher is sending messages to a different topic than <code>sensor/data</code>.
BThe subscriber client has a firewall blocking outgoing connections.
CThe MQTT broker is offline but the subscriber shows connected.
DThe subscriber client is using QoS level 2 which is unsupported.
Attempts:
2 left
💡 Hint

Check if the topic names match exactly between publisher and subscriber.

Best Practice
expert
2:00remaining
Choosing QoS level for critical IoT messages

In a publish-subscribe system for critical IoT sensor data, which MQTT QoS level ensures messages are delivered exactly once without duplicates?

AQoS 0 - At most once delivery
BQoS 2 - Exactly once delivery
CQoS 1 - At least once delivery
DQoS 3 - Guaranteed delivery with retries
Attempts:
2 left
💡 Hint

Consider the QoS levels defined by MQTT and their delivery guarantees.