Desktop Application Ultimate Desktop Application 3 — Questions and Answers
Question 1: What is the role of a message queue (message loop) in a Windows desktop application?
- It stores application settings
- It dispatches OS and user input events to the appropriate window procedure (Correct answer)
- It manages file I/O operations
- It schedules background threads
Correct answer: It dispatches OS and user input events to the appropriate window procedure
The message loop continuously retrieves messages from the queue and dispatches them to window procedures so windows can respond to events.
Question 2: In WPF (Windows Presentation Foundation), what language is used to define UI layouts declaratively?
- HTML
- XAML (Correct answer)
- JSON
- XML-UI
Correct answer: XAML
XAML (Extensible Application Markup Language) is used in WPF to define UI elements, layouts, and bindings declaratively.
Question 3: Which macOS framework is the recommended modern approach for building native desktop UIs?
- Carbon
- AppKit
- SwiftUI (Correct answer)
- Cocoa Touch
Correct answer: SwiftUI
SwiftUI is Apple's modern declarative UI framework recommended for building native macOS (and iOS) applications.
Question 4: What is a sandbox in the context of desktop application security?
- A test environment database
- An isolated execution environment that restricts what resources a process can access (Correct answer)
- A cache for compiled code
- A folder for temporary files
Correct answer: An isolated execution environment that restricts what resources a process can access
A sandbox restricts an application's access to system resources and other processes, limiting the damage a compromised or malicious app can cause.
Question 5: When distributing a desktop application on Windows, what format is most commonly used for installers?
- .zip
- .exe or .msi (Correct answer)
- .tar.gz
- .deb
Correct answer: .exe or .msi
.exe (setup executables) and .msi (Windows Installer packages) are the standard distribution formats for Windows desktop applications.
Question 6: Which Linux display server protocol is the modern successor to X11 for desktop applications?
- Mir
- Wayland (Correct answer)
- XCB
- DBus
Correct answer: Wayland
Wayland is the modern display server protocol designed to replace X11, offering better security and performance for Linux desktop applications.
Question 7: What is the purpose of code signing a desktop application?
- To encrypt the source code
- To verify the publisher's identity and ensure the binary has not been tampered with (Correct answer)
- To obfuscate the application logic
- To enable auto-update features
Correct answer: To verify the publisher's identity and ensure the binary has not been tampered with
Code signing uses a digital certificate to verify the application's publisher and detect any post-signing modifications.
What is the role of a message queue (message loop) in a Windows desktop application?