Desktop Application Desktop Application Development 1 — Questions and Answers
Question 1: Which framework is commonly used to build cross-platform desktop applications using JavaScript?
- Django
- Electron (Correct answer)
- Laravel
- Flask
Correct answer: Electron
Electron combines Chromium and Node.js, enabling developers to build cross-platform desktop apps using web technologies like HTML, CSS, and JavaScript.
Question 2: What is the main advantage of using native APIs when developing a desktop application?
- Easier cross-platform porting
- Better performance and OS integration (Correct answer)
- Smaller development team needed
- No compilation step required
Correct answer: Better performance and OS integration
Native APIs give applications direct access to OS features and hardware, resulting in better performance and tighter integration with system services.
Question 3: In desktop application development, what is an 'event loop'?
- A loop that reads keyboard input files
- A mechanism that waits for and dispatches events like clicks and key presses (Correct answer)
- A background service that syncs data
- A compiler optimization technique
Correct answer: A mechanism that waits for and dispatches events like clicks and key presses
The event loop continuously waits for user input or system events and dispatches them to appropriate handlers, forming the core of GUI applications.
Question 4: Which programming language is primarily used to develop native Windows desktop applications with the Win32 API?
- Python
- Ruby
- C/C++ (Correct answer)
- PHP
Correct answer: C/C++
The Win32 API is a C-based interface; C and C++ are the primary languages used to call Win32 functions directly for native Windows development.
Question 5: What does the Model-View-Controller (MVC) pattern separate in a desktop application?
- Network, storage, and display layers
- Application logic, data, and UI presentation (Correct answer)
- Compilation, linking, and runtime stages
- Authentication, authorization, and logging
Correct answer: Application logic, data, and UI presentation
MVC separates data (Model), user interface (View), and application logic (Controller), making desktop applications easier to maintain and test.
Question 6: What is 'sandboxing' in the context of macOS desktop application distribution?
- Running the app inside a virtual machine
- Restricting app access to system resources via entitlements (Correct answer)
- Compiling the app in a clean build environment
- Encrypting the app bundle before distribution
Correct answer: Restricting app access to system resources via entitlements
macOS sandboxing limits what system resources an app can access, requiring explicit entitlement declarations to protect user data and system integrity.
Which framework is commonly used to build cross-platform desktop applications using JavaScript?