Verified Jobs Live
Visual Basic Medium Level ~3 min read

A VB.NET desktop application freezes while waiting for a web request. How would you redesign it?

Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Model Answer & Deep-Dive Explanation

Use a genuinely asynchronous I/O API and Await it from an asynchronous event handler so the UI message loop can continue processing input. Keep longer CPU-bound work off the UI thread where appropriate, and update controls on the correct thread. Disable or coordinate repeated submissions, expose cancellation, and handle exceptions with a useful UI state. Avoid blocking on Task.Result or Wait. Async Sub is appropriate for framework event-handler signatures; reusable asynchronous methods should generally retu Task or Task(Of T) so callers can await completion and observe errors.