0
0
IOT Protocolsdevops~20 mins

Wildcard subscriptions (+ and #) in IOT Protocols - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
MQTT Wildcard Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding the '+' wildcard in MQTT topic subscriptions
In MQTT, what does the '+' wildcard match in topic subscriptions?
AIt matches zero or more topic levels at the position of the '+'
BIt matches exactly one topic level at the position of the '+'
CIt matches the entire topic string regardless of levels
DIt matches only the last topic level in the topic string
Attempts:
2 left
💡 Hint
Think about how '+' works compared to '#' in MQTT topics.
🧠 Conceptual
intermediate
1:30remaining
Understanding the '#' wildcard in MQTT topic subscriptions
In MQTT, what does the '#' wildcard match in topic subscriptions?
AIt matches zero or more topic levels including the current and all following levels
BIt matches exactly one topic level at the position of the '#'
CIt matches only the first topic level in the topic string
DIt matches only topics without any sub-levels
Attempts:
2 left
💡 Hint
Consider how '#' differs from '+' in matching topic levels.
💻 Command Output
advanced
2:00remaining
Output of MQTT subscription matching with '+' wildcard
Given the subscription topic filter home/+/temperature, which published topic will match this subscription?
Ahome/temperature
Bhome/kitchen/livingroom/temperature
Chome/kitchen/temperature
Dhome//temperature
Attempts:
2 left
💡 Hint
Remember '+' matches exactly one level, no more, no less.
💻 Command Output
advanced
2:00remaining
Output of MQTT subscription matching with '#' wildcard
Given the subscription topic filter devices/sensors/#, which published topic will NOT match this subscription?
Adevices/sensors
Bdevices/sensors/temperature
Cdevices/sensors/temperature/room1
Ddevices/actuators/temperature
Attempts:
2 left
💡 Hint
The '#' wildcard matches zero or more levels after its position.
Troubleshoot
expert
2:30remaining
Troubleshooting MQTT subscription with mixed wildcards
A client subscribes to the topic filter building/+/floor/#. Which of the following published topics will NOT be received by the client?
Abuilding/room1/temperature/floor
Bbuilding/room2/floor
Cbuilding/room3/floor/room4/humidity
Dbuilding/room1/floor/temperature
Attempts:
2 left
💡 Hint
Check the position of the wildcards and the topic levels carefully.