IOT Questions and Answers – Sending and Receiving Data in Real Time Through Internet

This set of IOT Multiple Choice Questions & Answers focuses on “Sending and Receiving Data in Real Time Through Internet”.

1. _________ allows us to control electronic components.
a) RESTful API
b) CoAP API
c) HTTP
d) MQTT
View Answer

Answer: a
Explanation: RESTful API that allows us to control electronic components connected to our Intel Galileo Gen 2 board through HTTP requests.

2. MQTT stands for _____________
a) MQ Telemetry Things
b) MQ Transport Telemetry
c) MQ Transport Things
d) MQ Telemetry Transport
View Answer

Answer: d
Explanation: MQTT was known as MQ Telemetry Transport protocol. MQTT is a lightweight protocol that runs on top of the TCP/IP protocol.

3. MQTT is better than HTTP for sending and receiving data.
a) True
b) False
View Answer

Answer: a
Explanation: We will use MQTT to send and receive data in real time through internet, instead of HTTP as MQTT is much lighter than HTTP.
advertisement
advertisement

4. MQTT is _________ protocol.
a) Machine to Machine
b) Internet of Things
c) Machine to Machine and Internet of Things
d) Machine Things
View Answer

Answer: c
Explanation: The MQTT protocol is a machine to machine and Internet of thing connectivity protocol.

5. Which protocol is lightweight?
a) MQTT
b) HTTP
c) CoAP
d) SPI
View Answer

Answer: a
Explanation: MQTT is a lightweight protocol that runs on top of the TCP/IP protocol and works with publish subscribe mechanism.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. PubNub publishes and subscribes _________ in order to send and receive messages.
a) Network
b) Account
c) Portal
d) Keys
View Answer

Answer: d
Explanation: It is necessary to generate our PubNub publishes and subscribes keys in order to send and receive messages in the network.

7. By clicking which key the PubNub will display public, subscribe, and secret keys.
a) Pane
b) Demo Keyset
c) Portal
d) Network
View Answer

Answer: b
Explanation: Click on Demo keyset pane and PubNub will display public, subscribe, and secret keys. We must copy and paste each of these keys to use them in our code that will publish messages and subscribe to them.
advertisement

8. The messageChannel class declares the _________ class attribute that defines the key string.
a) command_key
b) command-key
c) commandkey
d) Key_command
View Answer

Answer: a
Explanation: The messageChannel class declares the command_key class attribute that defines the key string that defines what the code will understand as the command.

9. _________ method saves the received arguments in three attributes.
a) __Init
b) Init__
c) __Init__
d) _init_
View Answer

Answer: c
Explanation: __Init__ method saves the received arguments in three attributes with the same names.
advertisement

10. _________ and _________ saves the publish and subscribe keys that we have generated with the PubNub Admin portal.
a) public_key and subscribe_key
b) Public-key and subscribe-key
c) publickey and subscribekey
d) Key_public and key_subscribe
View Answer

Answer: a
Explanation: Then, the constructor declares two local variables: public_key and subscribe_key. These local variables save the public and subscribe keys that we had generated with the PubNub Admin portal.

11. _________ specifies the function that will be called when there is a new message received from the channel.
a) Reconnect
b) Error
c) Connect
d) Callback
View Answer

Answer: d
Explanation: Callback specifies the function that will be called when there is a new message received from the channel.

12. _________ specifies the function that will be called on an error event.
a) Callback
b) Error
c) Connect
d) Reconnect
View Answer

Answer: b
Explanation: The call to this message specifies many methods declared in the MessageChannel class.
Error specifies the function that will be called on an error event.

13. _________ Specifies the function that will be called when a successful connection with the PubNub cloud.
a) Callback
b) Error
c) Connect
d) Reconnect
View Answer

Answer: c
Explanation: Connect specifies the function that will be called when a successful connection with the PubNub cloud.

14. _________ specifies the function that will be called when a successful re-connection is completed.
a) Callback
b) Error
c) Connect
d) Reconnect
View Answer

Answer: d
Explanation: Reconnect specifies the function that will be called when a successful re-connection is completed with the PubNub cloud.

15. ___________ specifies the function that will be called when the client disconnects.
a) Callback
b) Error
c) Connect
d) Disconnect
View Answer

Answer: d
Explanation: Disconnect specifies the function that will be called when the client disconnects from the PubNub cloud.

Sanfoundry Global Education & Learning Series – IOT.

To practice all areas of IOT, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.