Web application practice exam
Clients can send messages to the server
True
False
Which of the following io.socket server calls will send a message to a room of clients?
Io.broadcast.to(socket.name).emit('message name', 'message content')
Socket.to(socket.id).emit('message content', {}
Socket.broadcast.to(socket.name).emit('message name', 'message content')
Io.to(socket.id).emit('message content', {}
The method that does generate random numbers returns a number between
1 and 100
0 and 1
0 and 9
0 and 99
Clients can send messages directly to other clients?
True
False
Refreshing the browser causes a disconnect to fire on the server?
True
False
What React component lifecycle method did we register socket.io message handlers in?
ComponentWillReceiveProps
ComponentDidMount
ComponentWillUpdate
ComponentWillMount
Which of the following moment library calls will contain a time in the results?
A) moment().format('time')
B) moment().format('')
C) moment().format('h:mm:ss a')
D) both A) and B)
E) both B) and C)
Which of the following io.socket server calls will send a message to a single client?
Socket.to(socket.id).emit('message content', {}
Io.to(socket.id).emit('message content', {}
Io.broadcast.to(socket.name).emit('message name', 'message content')
Socket.broadcast.to(socket.name).emit('message name', 'message content')
After a connection was established, what event did the client first fire?
Request
Welcome
Respond
Join
In addition to Node's http server what else are we hooking socket.io into on the server?
Dotenv
Express
Error middleware
Builtin middleware
If we want to send a message to all clients in a room, we could use this syntax on the server: io.to('someroom').emit('somemessage',....
True
False
What syntax do we provide in app.js to contain all subsequent socket.io event emitters and handlers?
Var socket = io()
Let io = socketIO(server)
Let server = http.createServer(app)
Io.on('connection', (socket) => {...
If you're going to handle databases with Node.js, what other software should you include?
Message Queuing
Text Messaging
Caching
REST infrastructure
Node.js is BEST used for:
CPU intensive applications
Scalable network applications
Relational database applications
All of the above
We register the event handlers in a React client in the life cycle method componentWillMount?
True
False
According to the NodeSource article what problem arises from "long polling"?
A) Latency
B) Increases server load
C) Needs to work synchronously
D) either A) or B)
E) either A) or C)
What package(s) were installed to support socket IO?
A) socket.io-server
B) socket.io-client
C) socket.io
D) both A) and B)
E) both B) and C)
According to the NodeSource article what are 2 problems with "long polling"? Sending periodic HTTP requests for data introduces:
Worry for cross-browser compatibility and increased server load
Latency and increased server load
Latency and decreased server load
Non of the above
How many connections can a typical web server handle?
2000
3000
8000
4000
How many connections can a node.js server handle?
1,000,000
3,000,000
500,000
250,000
What 2 components are provided with socket.io?
Io and on
Socket and io
Both server-side and client-side components
Server side components and express
How does socket.io work in conjunction with an http server?
It has its own instance of http.server working as middleware
Socket.io adds a event listener to an instance of express, working as middleware
Socket.io works by addking event listeners to an instance of http.Server, working as middleware
None of the above
In addition to the http server, we are also hooking up the socket.io onto the Express framework
True
False
On the client, what is the "global socket variable" known as?
Socket
Event
EventEmitter
Evenlistener
What method is used on both the client and server to invoke an event?
.on()
.to()
.listen()
.emit()
What do we write on either the server or client to process the event from the emit()?
.to()
.eventEmitter()
.on()
.listen()
Correct syntax to hook up the socket.io module into the http server module: let io = SocketIO.createServer, let server = http(io)
True
False
Which on of the following will last 17 seconds for a single traffic light iteration of the loop?
{strName: 'Main', green: 900, red: 600, yellow: 200}
{strName: 'Main', green: 9000, red: 6000, yellow: 2000}
{strName: 'Main', green: 90, red: 60, yellow: 20}
{strName: 'Main', green: 9, red: 6, yellow: 2}
Io.on('connection', .. Holds all the socket.io on the client side
True
False
A refresh will fire a disconnect event on the server
True
False
What software(s) did we install to support the heroku environment?
A) git
B) gitbash
C) heroku toolbelt
Both a) and c)
Both b) and c)
Gitbash is a shell emulator for linux
True
False
What git command is used to create a new archive?
Add
Commit
Init
Status
What git command tells us what files need to be added to the archive?
Add
Status
Init
Commit
What git command will add all files to the archive?
Gitadd
Git add .
Git update
Git commit
What git command will finalize the adding of files to the archive?
Add
Status
Commit
Init
Porting our app to heroku before making adjustments will allow us to use local host in the socket connection
True
False
What do we need to put in place so that unauthorized users cannot place files in our heroku?
Firewall
SSL
Public/private keys
None of the above
What heroku command is used to see if any keys already exist?
Git keys
Check status keys
Heroku keys
Heroku keys:check
What GitBash command will generate ssh keys?
Git keys:add
Heroku keys:add
Git add .keys
Git update keys
Ssh keygen
What heroku command will validate the ssh key generated after a heroku keys:add command?
Ssh
Ssl
Git check
Git status
Heroku create app is a Heroku command used to create an empty project
True
False
What command is used to coordinate local to remote to be able to push?
Git push --set-upstream heroku master
Heroku upstream master
Heroku-setstream master
Heroku -set-upstream heroku master
The log file of our remote site can be checked on the heroku site
True
False
What command will actually move the local application up to heroku?
Add
Commit
Push
Status
The correct sequence when moving an edited application to heroku is: commit, add, push
True
False
What heroku command will display all your current apps?
Heroku check apps
Heroku check status
Heroku app --all
Heroku git all
What is the default time zone used by heroku?
UTC
GMT
PMT
CMT
Config add TZ="" -app=name can be used to change the heroku default time zone
True
False
What javascript object did we use to gain access to the floor & random methods?
Express
Io
Socket
Math
What is the syntax to generate a random number from 1 to 100?
Math.floor(Math.random() * 99) + 1
Math.floor(Math.random() * 100) + 1
Math.floor(Math.random() * 100)
Math.floor(Math.random() * 100 / 1)
What is the first thing we checked after establishing a connection in the case study 3?
See if a room exists
See if the name exists
Call a join
Check if the socket is valid
What is the syntax used on the server to join a particular room?
Socket.on('roomname')
Socket.join(socket.id)
Socket.join('roomname')
Socket.join(socket)
What intrinsic JavaScript function is used to generate random numbers?
Rndm
Rndm
Floor
Random
What intrinsic JavaScript math function is used to round down to the nearest integer?
Trunc
Floor
Int
Round
What error did we see in the browser from the client project if we don't account for CORS?
'Access-Denied'
Access-Control-Denied'
'Access-Control-Allow-Origin'
'Access-Control-Allow-Access'
We had to change the client to get around the CORS error
True
False
What is an easy way to test if the server is up and running and is able to serve user JSON?
Run the server then the client
Go to localhost:5150/users
Run in debug mode
Use webstorms debugger
The userList or in our casestudy, the bubbleList (whatever the fck you called it) was a functional component
True
False
What purpose was given for the blur event?
To hide the virtual keyboard in cs
To hide the previous bubbles
To hide while scrolling down to the last bubble
What Material-UI component(s) was the
Toolbar
ToolbarTitle
IconButton
All of the above
{"name":"Web application practice exam", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Clients can send messages to the server, What intrinsic JavaScript function is used to generate random numbers?, Which of the following io.socket server calls will send a message to a room of clients?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
More Quizzes
[CI&T] [Quiz] [Fanta] - Basic
24120
Science (Biology)
21100
United Nations Yugoslavia
100
Los verbos - 1. grupo (-at)
201055
Impact of computers on society
420
TB 2017
320
All About Kaitlin
520
1st Quiz
100
Seguridad 5
12620
Κουίζ αρχαίων ελληνικών: Τι σημαίνουν αυτές οι λέξεις;
1050
Discover Your Inner Self
11619
ங்கிகளின் உடல் பல்வேறு இரசாயன சேர்வைகளால் ஆனது. இச்சேர்வைகள் யாவும் பல்வேறு மூலகங்கள் வெவ்வேறு விகிதங்களில் இணைவதனால் உருவாகியுள்ளன.
840