Fundamentals of Front End Development MCQs with Answers
Practice important Fundamentals of Front End Development MCQs with answers and explanations.
Chapter: 144
Q1621:
What happens if you modify a file on the server but do not update the manifest file?
A. The browser will show the updated file
B. The browser will continue to show the cached version
C. The file will be deleted from the cache
D. The file will be re-downloaded
Correct Answer:
B
Chapter: 144
Q1622:
Which section would you use to list files that require an internet connection and should never be cached?
A. CACHE MANIFEST
B. NETWORK
C. FALLBACK
D. UPDATE
Correct Answer:
B
Chapter: 144
Q1623:
Fill in the blank: The fallback page specified in the FALLBACK section will be served in place of ______.
A. cached files
B. files listed in NETWORK
C. files listed in CACHE MANIFEST
D. all files
Correct Answer:
B
Chapter: 145
Q1624:
What is a Web Worker used for in HTML5?
A. To create responsive web pages
B. To run JavaScript in the background
C. To handle DOM manipulations
D. To store data locally
Correct Answer:
B
Chapter: 145
Q1625:
Which method is used to post a message back to the HTML page from a web worker?
A. sendMessage()
B. postMessage()
C. receiveMessage()
D. transferMessage()
Correct Answer:
B
Chapter: 145
Q1626:
What should you check before creating a Web Worker in JavaScript?
A. Browser's version
B. Support for Worker object
C. Network connectivity
D. File system access
Correct Answer:
B
Chapter: 145
Q1627:
What is the correct way to create a new Web Worker in JavaScript?
A. var w = new Worker("worker.js");
B. var w = new Worker("script.js");
C. var w = new WebWorker("script.js");
D. var w = Worker("worker.js");
Correct Answer:
A
Chapter: 145
Q1628:
Fill in the blank: To check for Web Worker support, you use if(typeof(Worker) !== "______").
A. "undefined"
B. "null"
C. "object"
D. "function"
Correct Answer:
A
Chapter: 145
Q1629:
What happens if you do not terminate a web worker after use?
A. It will automatically terminate
B. It will continue to listen for messages
C. It will stop working after one message
D. It will cause a memory leak
Correct Answer:
B
Chapter: 145
Q1630:
Fill in the blank: To terminate a web worker and free resources, use the ______ method.
A. terminate()
B. stop()
C. close()
D. end()
Correct Answer:
A
Chapter: 145
Q1631:
How can you reuse a Web Worker after it has been terminated?
A. By re-initializing it
B. By setting the worker variable to undefined
C. By creating a new worker object
D. By calling terminate() again
Correct Answer:
B
Chapter: 145
Q1632:
Fill in the blank: Web Workers do not have access to the ______ object.
A. document
B. location
C. navigator
D. history
Correct Answer:
A
Chapter: 145
Q1633:
What is the purpose of the onmessage event listener in a Web Worker?
A. To send messages to the worker
B. To receive messages from the worker
C. To terminate the worker
D. To create a new worker
Correct Answer:
B
Chapter: 145
Q1634:
Fill in the blank: After creating a new Web Worker, you can listen for messages using the ______ property.
A. onmessage
B. postmessage
C. ondata
D. messageevent
Correct Answer:
A
Chapter: 146
Q1635:
What is the purpose of Server-Sent Events (SSE) in HTML5?
A. To send updates to the server
B. To receive updates from the server
C. To manage client-side storage
D. To handle client-server requests
Correct Answer:
B
Chapter: 146
Q1636:
How do you create a new EventSource object in JavaScript?
A. var source = new EventSource("sse.php");
B. var source = new EventSource("data.sse");
C. var source = new EventSource("update.php");
D. var source = new EventSource("events.php");
Correct Answer:
A
Chapter: 146
Q1637:
What is the correct content type for server-sent events?
A. application/json
B. text/html
C. text/event-stream
D. application/x-www-form-urlencoded
Correct Answer:
C
Chapter: 146
Q1638:
What method is used to handle incoming messages from an EventSource object?
A. onmessage
B. onupdate
C. ondata
D. onreceive
Correct Answer:
A
Chapter: 146
Q1639:
Fill in the blank: To check for Server-Sent Events support, use if(typeof(EventSource) !== "______").
A. "undefined"
B. "null"
C. "object"
D. "function"
Correct Answer:
A
Chapter: 146
Q1640:
What should you set the "Content-Type" header to in server-side code for SSE?
A. application/json
B. text/html
C. text/event-stream
D. application/x-www-form-urlencoded
Correct Answer:
C