
Ultimate access to all questions.
How should you design a single-page web application where the UI communicates with a third-party API via XMLHttpRequest, ensuring that non-critical API data doesn't block UI rendering, while maintaining good performance during API errors or timeouts?
A
Set the asynchronous option for your requests to the API to false and omit the widget displaying the API results when a timeout or error is encountered.
B
Set the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered.
C
Catch timeout or error exceptions from the API call and keep trying with exponential backoff until the API response is successful.
D
Catch timeout or error exceptions from the API call and display the error response in the UI widget.