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.
Saved automatically
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.
Related Questions in Visual Basic
VB 6, COM, DCOM, Microsoft platform interview questions
Advanced level • 730 views
Visual Basic Interview questions
Advanced level • 647 views
How would you validate integer input without using exceptions for an expected invalid value?
Medium level • 9 views
What do Option Strict On and Option Explicit On help catch in VB.NET?
Easy level • 7 views
In VB.NET, how do Sub and Function differ?
Easy level • 6 views