MQTT Interview questions and answers | IoT
This page covers top MQTT interview questions and answers will help interviewee pass the job interview for MQTT engineer job position. This MQTT questions are written by specialists in MQTT domain.
Question -1: What is MQTT ?
Answer -1: MQTT is broker based protocol in which client devices communicate via broker. Broker is a server which can be installed on any machine in the cloud. It is a light weight message queueing and transport protocol.
It is based on publish/subscribe architecture.
Question -2: Mention applications or use cases of MQTT protocol.
Answer -2: It is used for numerous applications such as M2M, IoT, WSN, telemetry and so on.
Question -3: Is MQTT use TCP or UDP ?
Answer -3: MQTT uses TCP/IP.
Question -4: Which port number is used by MQTT ?
Answer -4: It uses port number 1883.
Question -5: Does MQTT support Security ?
Answer -5: Yes, it uses SSL/TLS for security. It encrypts payload. Hence it is payload agnostic.
Question -6: What is MQTT topic ?
Answer -6: The communication between sender (i.e. publisher) and receiver (i.e. subscribers) in MQTT is based on messages called "topics". In MQTT, topic is a UTF-8 string. In order to receive messages, clients must have to be subscribed to the particular topic (say temperature sensor data). Each topic can have one or more levels which are separated by a slash ( called topic separator ).
Question -7: Explain MQTT broker architecture with one use case example.
Answer -7: Let there is client#2 which updates temperature with broker. Let client#1 which wants to know updated temperature from broker. Here client#2 acts as publisher and client#1 acts as subscriber. The same is shown in the figure below in message flow between client#1 with broker and between client#2 with broker.
Refer MQTT tutorial >> for more information with message flow between clients and broker.
Question -8: What is the difference between MQTT and HTTP ?
Answer -8: The table mentions difference between MQTT and HTTP.
Question -9: What is the difference between MQTT and CoAP ?
Answer -9: The table mentions difference between MQTT and CoAP.
Question -10: What is the difference between MQTT and REST ?
Answer -10: The table mentions difference between MQTT and REST.
Question -11: Which are the brokers available for MQTT testing by client ?
Answer -11: The broker is a server which can be installed on any machine in the cloud. There are different types of brokers such as HiveMQ, Mosquitto etc.
Question -12: What is the size of header and payload in MQTT protocol ?
Answer -12: MQTT messages contain a mandatory fixed-length header of 2 bytes in size and an optional message-specific variable length header and message payload. The figure above depicts the same.
This set of MQTT interview questions and answers are useful for freshers and experienced level of job positions. Refer following links on MQTT for more information.
IoT Wireless Technologies
Top 10,12,15 Interview Questions and Answers
Zigbee Interview Questions and Answers
IoT Interview Questions and Answers
GSM Interview Questions and Answers
LTE Interview Questions and Answers
RF Interview Questions and Answers
Telecom Interview Questions and Answers
WCDMA Interview Questions and Answers
WiMAX Interview Questions and Answers
WLAN Interview Questions and Answers
Microcontroller Interview Questions and Answers
Electronics Interview Questions and Answers