JavaScript Questions & Answers – Performance Measures in JavaScript – I

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Performance Measures in JavaScript – I”.

1. How do we define the term Thread?
a) Device that controls input
b) Variable that controls movement
c) Controlled execution of applications
d) Device that controls input & Variable that controls movement
View Answer

Answer: c
Explanation: Threads are sequential units of controlled execution for applications. A thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.

2. What does the browser do to set up a TCP/IP connection?
a) TCP one-way handshake
b) TCP two-way handshake
c) TCP three-way handshake
d) TCP four-way handshake
View Answer

Answer: c
Explanation: A three-way handshake is a method used in a TCP/IP network to create a connection between a local host/client and server. It is a three-step method that requires both the client and server to exchange SYN and ACK (acknowledgment) packets before actual data communication begins.

3. What does the handshake pass between the browser and the remote server?
a) Synchronize
b) Accept
c) Reject
d) Decline
View Answer

Answer: a
Explanation: A three-way handshake is a method used in a TCP/IP network to create a connection between a local host/client and server. The handshake consists of a Synchronize, Synchronize-Acknowledge, and Acknowledge message to be passed between the browser and the remote server.
advertisement
advertisement

4. How does the handshake help the server?
a) Acknowledge
b) Accept the attempt
c) Both Acknowledge and Accept the attempt
d) Asynchronize
View Answer

Answer: c
Explanation: The handshake allows the server to acknowledge and accept the attempt. The handshake consists of a Synchronize, Synchronize-Acknowledge, and Acknowledge message to be passed between the browser and the remote server.

5. What is the purpose of the transport layer?
a) TCP Communication takes place
b) UDP Communication takes place
c) Both TCP and UDP Communication takes place
d) IP communication
View Answer

Answer: c
Explanation: The transport layer is the layer in the open system interconnection (OSI) model responsible for end-to-end communication over a network. The Transport layer is where our TCP (or UDP) communication takes place.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. What does the status code 200 indicate?
a) Error in request
b) Error in response
c) Error in server
d) Successful
View Answer

Answer: d
Explanation: The status code 200 indicates a successful response from the server. A 400 status code represents a bad request.

7. What does the status code 500 indicate?
a) Error in request
b) Error in response
c) Error in server
d) Successful
View Answer

Answer: a
Explanation: The 500 status code, or Internal Server Error, means that server cannot process the request for an unknown reason. Sometimes this code will appear when more specific 5xx errors are more appropriate.
advertisement

8. What does the application layer handle?
a) Top-level communication
b) Bottom-level communication
c) Both Top-level and Bottom-level communication
d) Middle-level communication
View Answer

Answer: a
Explanation: An application layer is an abstraction layer that specifies the shared communications protocols and interface methods used by hosts in a communications network. The Application layer handles the top-level communication that the client and servers use, like HTTP and SMTP for email clients.

9. Which status code indicates that the server could not find the resource requested?
a) 200
b) 404
c) 500
d) 566
View Answer

Answer: b
Explanation: The HTTP 404, 404 Not Found, and 404 error message is a Hypertext Transfer Protocol (HTTP) standard response code, in computer network communications, to indicate that the client was able to communicate with a given server, but the server could not find what was requested.
advertisement

10. What is the maximum size of an IP packet for IPv4 or IPv6?
a) 65540
b) 65535
c) 65577
d) 67544
View Answer

Answer: b
Explanation: Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). IPv6 is the most recent version of Internet Protocol. The maximum size of an IP packet for IPv4 or IPv6 is 65535.

Sanfoundry Global Education & Learning Series – Javascript Programming.

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.