0
0
IOT Protocolsdevops~20 mins

Topics and topic hierarchy in IOT Protocols - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
MQTT Topic Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding MQTT Topic Hierarchy

In MQTT, topics are structured in a hierarchy separated by slashes. Which of the following represents a valid topic hierarchy for a smart home system?

Ahome.livingroom.temperature
Bhome/livingroom/temperature
Chome\livingroom\temperature
Dhome-livingroom-temperature
Attempts:
2 left
💡 Hint

Think about how MQTT topics use slashes to separate levels.

💻 Command Output
intermediate
2:00remaining
MQTT Topic Subscription Wildcards Output

What topics will a client receive if it subscribes to home/+/temperature?

Ahome/livingroom/temperature and home/kitchen/temperature
Bhome/livingroom/temperature only
Chome/livingroom/humidity and home/kitchen/temperature
Dhome/livingroom/temperature and home/livingroom/humidity
Attempts:
2 left
💡 Hint

The '+' wildcard matches exactly one level in the topic hierarchy.

Configuration
advanced
3:00remaining
Configuring MQTT Broker Topic Access Control

You want to restrict clients so they can only publish to topics under devices/ and subscribe to topics under sensors/. Which configuration snippet correctly enforces this in a typical MQTT broker ACL file?

A
user client
publish devices/
subscribe sensors/
B
user client
publish sensors/#
subscribe devices/#
C
user client
publish #
subscribe #
D
user client
publish devices/#
subscribe sensors/#
Attempts:
2 left
💡 Hint

Remember that '#' matches all subtopics and the ACL syntax requires specifying publish and subscribe permissions.

Troubleshoot
advanced
3:00remaining
Troubleshooting MQTT Topic Subscription Failure

A client subscribes to home/+/temperature but does not receive messages published to home/livingroom/humidity. What is the most likely cause?

AThe client is publishing to <code>home/livingroom/humidity</code> instead of <code>home/livingroom/temperature</code>
BThe MQTT broker does not support the '+' wildcard
CThe client subscribed to <code>home/#</code> instead of <code>home/+/temperature</code>
DThe client subscribed with QoS 0 but messages are published with QoS 2
Attempts:
2 left
💡 Hint

Check if the published topic matches the subscribed topic pattern exactly.

🔀 Workflow
expert
5:00remaining
Designing a Topic Hierarchy for Scalable IoT Deployment

You are designing an MQTT topic hierarchy for a city-wide sensor network with multiple sensor types in many locations. Which topic hierarchy design best supports easy filtering by location and sensor type?

Asensor_type/city/location/sensor_id
Bcity/sensor_type/location/sensor_id
Ccity/location/sensor_type/sensor_id
Dsensor_id/city/location/sensor_type
Attempts:
2 left
💡 Hint

Consider which topic levels you want to filter on first when subscribing.