exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 1 discussion

Actual exam question from Microsoft's 70-480
Question #: 1
Topic #: 4
[All 70-480 Questions]

You are troubleshooting an application.
Users report that the UI is slow to respond.
You need to improve UI responsiveness by moving application tasks to web workers.
Which two tasks can you move to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

  • A. A function that loops through the Document Object Model to update the style of page elements
  • B. A long-running calculation that requires looping through an array
  • C. A function that performs graphic-intensive animation
  • D. A function that stores large amounts of data to local storage
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️
Note:
* Despite the improvements in JavaScript engines, it is not uncommon for users to encounter frozen user interfaces as the browser works through resource intensive tasks. This leads to a horrible user experience. The purpose of Web Workers is to give developers a way of instructing the browser to process large tasks in the background; therefore preventing the UI from freezing up.
* The Web Workers specification defines an API for spawning background scripts in your web application. Web Workers allow you to do things like fire up long- running scripts to handle computationally intensive tasks, but without blocking the UI or other scripts to handle user interactions

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tim0x78C
Highly Voted 4 years, 10 months ago
B and D, Web workers does not have acces to DOM to manipulate animation
upvoted 5 times
...
Dreamchaser1980
Most Recent 4 years, 4 months ago
You cannot access localStorage (and also sessionStorage) from a webworker process, they result will be undefined, this is for security reasons. https://stackoverflow.com/questions/40887635/access-localstorage-from-service-worker?rq=1
upvoted 1 times
...
MoSalah10
5 years, 3 months ago
My answer is about the next question, should be deleted.
upvoted 1 times
...
MoSalah10
5 years, 3 months ago
ANSWER C <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 250 250" width="250" height="250"> <circle cx="100" cy="100" r="50" fill="gold" id="circle" onclick="clickCircle();"/> </svg> function clickCircle() { var circle = document.getElementById("circle"); var change = Math.random() > 0.5 ? 10 : -10; var newValue = Math.min(Math.max(circle.r.baseVal.value + change, 10), 250); circle.setAttribute("r", newValue); }
upvoted 1 times
...
JMz123
5 years, 6 months ago
Re choice c: The web worker will need to send back the results to the DOM thread to be shown.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago