Desktop Application Desktop Application Development 2 — Questions and Answers
Question 1: What is the purpose of a .NET assembly in Windows desktop application development?
- A hardware driver module
- A compiled unit of code containing IL and metadata for the CLR (Correct answer)
- A package manager configuration file
- A UI theme definition
Correct answer: A compiled unit of code containing IL and metadata for the CLR
A .NET assembly is a compiled output file (DLL or EXE) containing Intermediate Language code and metadata that the Common Language Runtime executes.
Question 2: Which technology allows a WPF application to separate UI design from code-behind logic?
- HTML templates
- XAML (eXtensible Application Markup Language) (Correct answer)
- JSON schemas
- CSS stylesheets
Correct answer: XAML (eXtensible Application Markup Language)
XAML is a declarative XML-based markup language that defines WPF UI structure separately from C# or VB.NET code-behind files.
Question 3: What is data binding in a desktop application framework like WPF or JavaFX?
- Connecting a database directly to a UI form
- Automatically synchronizing UI controls with data source properties (Correct answer)
- Serializing objects to JSON for storage
- Encrypting sensitive form fields
Correct answer: Automatically synchronizing UI controls with data source properties
Data binding automatically keeps UI controls and underlying data objects in sync, so changes in one are reflected in the other without manual update code.
Question 4: In Qt desktop development, what is a 'signal and slot'?
- A memory allocation pattern
- A mechanism for event-driven communication between objects (Correct answer)
- A thread synchronization primitive
- A file I/O pattern
Correct answer: A mechanism for event-driven communication between objects
Qt's signal and slot mechanism allows objects to communicate: an object emits a signal when an event occurs, and connected slots (functions) respond to it.
Question 5: What is the role of a package manager like NuGet in .NET desktop development?
- Compile and link .NET projects
- Download, install, and manage third-party library dependencies (Correct answer)
- Deploy applications to end-user machines
- Monitor application performance at runtime
Correct answer: Download, install, and manage third-party library dependencies
NuGet is the package manager for .NET that automates downloading and updating third-party libraries, managing versioning and dependency resolution.
Question 6: Which technique allows a desktop application to perform background operations without freezing the UI?
- Polling in the main thread
- Async/await or background threading (Correct answer)
- Disabling UI event handlers
- Increasing the frame rate
Correct answer: Async/await or background threading
Async/await and background threads offload long-running tasks from the UI thread, keeping the interface responsive while work continues in the background.
What is the purpose of a .NET assembly in Windows desktop application development?