Desktop Application Desktop Application MCQ 3 — Questions and Answers
Question 1: What is 'data binding' in desktop application frameworks like WPF or WinForms?
- Encrypting data before saving it to disk
- Automatically synchronizing UI controls with underlying data objects (Correct answer)
- Binding a database connection string at startup
- Linking two executable files together at compile time
Correct answer: Automatically synchronizing UI controls with underlying data objects
Data binding automatically keeps UI controls in sync with underlying data models, reducing boilerplate update code.
Question 2: In desktop application development, what does 'sandboxing' an application mean?
- Running the app in a designated testing environment only
- Restricting the app's access to system resources and other processes (Correct answer)
- Packaging the app with its own copy of the OS
- Compiling the app with debug symbols removed
Correct answer: Restricting the app's access to system resources and other processes
Sandboxing restricts an application's permissions so it cannot access arbitrary system resources, files, or other applications without explicit permission.
Question 3: Which file format is the standard package for distributing macOS desktop applications?
- .exe
- .dmg or .pkg (Correct answer)
- .deb
- .msi
Correct answer: .dmg or .pkg
.dmg (disk image) is used for distribution and .pkg is used for installer packages on macOS; .app bundles contain the actual application.
Question 4: What is the role of a 'thread pool' in a desktop application?
- Managing database connection pools
- Reusing a set of pre-created threads to execute tasks efficiently without constant thread creation (Correct answer)
- Grouping windows into a tabbed interface
- Pooling memory allocations for UI components
Correct answer: Reusing a set of pre-created threads to execute tasks efficiently without constant thread creation
A thread pool maintains a set of worker threads that can be reused for tasks, avoiding the overhead of creating and destroying threads repeatedly.
Question 5: In WPF (Windows Presentation Foundation), what language is used to define the UI layout?
- HTML
- XAML (Correct answer)
- JSON
- XML-Forms
Correct answer: XAML
XAML (Extensible Application Markup Language) is a declarative XML-based language used to define UI elements and their properties in WPF.
Question 6: What does 'crash reporting' in a desktop application typically involve?
- Intentionally crashing the app to test stability
- Capturing stack traces, system info, and error details when the app crashes and sending them to developers (Correct answer)
- Reporting crashes to the operating system event log only
- Disabling the app after too many errors
Correct answer: Capturing stack traces, system info, and error details when the app crashes and sending them to developers
Crash reporting captures diagnostic information (stack trace, OS version, memory state) on an unhandled exception and transmits it to developers for analysis.
Question 7: Which IPC (Inter-Process Communication) mechanism is commonly used for communication between a desktop application and a background service on Windows?
- WebSockets over localhost
- Named Pipes (Correct answer)
- Shared clipboard
- REST API calls to a cloud server
Correct answer: Named Pipes
Named Pipes provide a fast, reliable IPC channel between processes on the same machine or across a network on Windows.
What is 'data binding' in desktop application frameworks like WPF or WinForms?