300-435 · Question #28
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 do not block code execution, allowing applications to continue processing, and typically use callback functions to handle responses.
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)- A3% (1)
- B89% (34)
- C3% (1)
- D5% (2)
Why each option
Asynchronous API calls do not block code execution, allowing applications to continue processing, and typically use callback functions to handle responses.
The order in which asynchronous API calls complete and return their results cannot be guaranteed, as it depends on factors like network latency and server processing time.
An asynchronous API call immediately returns control to the calling code, enabling the application to continue executing other tasks without waiting for the API response.
Asynchronous calls are designed to prevent the application from blocking and creating a poor user experience due to latency, instead handling the waiting in the background.
This statement describes a synchronous API call, where the code execution pauses and waits for the API call to complete before proceeding.
Callback functions are a common pattern in asynchronous programming, where a function is provided to be executed only after the API call has completed and its response is ready.
Concept tested: Asynchronous API call characteristics
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Asynchronous_JavaScript
Topics
Community Discussion
No community discussion yet for this question.
