350-901 · Question #38
Which two statements describe the traits of an asynchronous API call? (Choose two.)
The correct answer is B. A call to an API does not block the code, but rather it allows application processing to continue E. A callback function typically is used to process the response from an API call. Asynchronous API calls are non-blocking and use callback functions to handle responses, allowing the application to continue executing while waiting.
Question
Exhibit
Options
- AThe order in which API calls return can be guaranteed
- BA call to an API does not block the code, but rather it allows application processing to continue
- CThe end user can experience latency or performance lag while waiting for the API call to return
- DCode execution blocks or waits for the call to an API to return.
- EA callback function typically is used to process the response from an API call
How the community answered
(38 responses)- A5% (2)
- B89% (34)
- C3% (1)
- D3% (1)
Why each option
Asynchronous API calls are non-blocking and use callback functions to handle responses, allowing the application to continue executing while waiting.
Asynchronous calls do not guarantee return order - responses may arrive in any sequence depending on network latency and server processing time.
An asynchronous API call returns control to the caller immediately without blocking execution, allowing the rest of the application to continue processing while the API request is in flight.
Latency while waiting for a response is a characteristic of synchronous calls, where the thread is blocked until the response is received.
Blocking or waiting for a call to return is the defining trait of synchronous API calls, the opposite of asynchronous behavior.
Because the calling code does not wait for the response, a callback function (or equivalent mechanism such as a Promise handler) is registered in advance and invoked by the runtime when the API response arrives.
Concept tested: Asynchronous vs synchronous API call behavior
Source: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Introducing
Topics
Community Discussion
No community discussion yet for this question.
