Questions
- In a multi-threaded environment, which of the following data structures should you use to protect data from getting overwritten/corrupted?
a.
async
-await
.b. Tasks.
c. Synchronization constructs such as locks.
d. Data never gets corrupted.
- If you have a WPF application that retrieves data from a REST API, which of the following should you implement for better responsiveness?
a. Concurrent collection
b. Parallel.For
c.
async
-await
for the REST API calls - Which of the following should be passed to cancel a task?
a.
CancellationToken
b.
ConcurrentDictionary
c.
SemaphoreSlim
- Which of the following is the recommended return type for an asynchronous method that uses async-await and does not return anything?
a.
async void
b.
async Task
c.
async book
d.
async Task<bool>