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
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
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
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.
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
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
Explanation: MQTT is a lightweight protocol that runs on top of the TCP/IP protocol and works with publish subscribe mechanism.
6. PubNub publishes and subscribes _________ in order to send and receive messages.
a) Network
b) Account
c) Portal
d) Keys
View Answer
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
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.
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
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
Explanation: __Init__ method saves the received arguments in three attributes with the same names.
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
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
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
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
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
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
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.
- Get Free Certificate of Merit in IOT
- Participate in IOT Certification Contest
- Become a Top Ranker in IOT
- Take IOT Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy Programming Books
- Apply for Computer Science Internship
- Practice Computer Science MCQs
- Buy Computer Science Books
- Apply for Information Technology Internship