Engineering Questions with Answers - Multiple Choice Questions
Home » MCQs » Computer Science » MCQs on Sending and Receiving Data in Real Time Through Internet
MCQs on Sending and Receiving Data in Real Time Through Internet
_________ 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.
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.
MQTT is better than HTTP for sending and receiving data.
a) True
b) False
View Answer
Answer: a
Explanation: We want to send and receive data in real time through internet and RESTful API is not the most appropriate option to do this. Instead, we will work on MQTT which is lighter than HTTP.
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.
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.
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.
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.
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.
_________ 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.
_________ 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.
_________ 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: The call to this message specifies many methods declared in the MessageChannel class
Callback: specifies the function that will be called when there is a new message received from the channel.
_________ 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.
_________ 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: The call to this message specifies many methods declared in the MessageChannel class
Connect: specifies the function that will be called when a successful connection with the PubNub cloud.
_________ 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: The call to this message specifies many methods declared in the MessageChannel class
Reconnect: specifies the function that will be called when a successful re-connection is completed with the PubNub cloud.
___________ specifies the function that will be called when the client disconnects.
a) Callback
b) Error
c) Connect
d) Disconnect
View Answer
Answer: d
Explanation: The call to this message specifies many methods declared in the MessageChannel class
Disconnect: specifies the function that will be called when the client disconnects from the PubNub cloud.