programming beginner 10 sample questions

Native Vs Hybrid Apps MCQ Practice Test

Comparing performance and development time for different app types.

Q1. When implementing a native module in a hybrid app, which of the following is a benefit of using a bridge to communicate between JavaScript and native code?

Explanation: The primary benefit of using a bridge is enabling native API access from JavaScript. Bridges actually add overhead rather than reduce it.

Q2. When using a hybrid app framework like React Native, what is the primary reason for using a library like React Native's <code>NativeModules</code>?

Explanation: In hybrid app frameworks like React Native, <code>NativeModules</code> is used to provide a cross-platform API for accessing native device features, such as camera, GPS, and contacts. This allows developers to access device-specific features from within the JavaScript thread, without having to write native code for each platform.

Q3. When using a hybrid app framework like React Native, which of the following is a limitation of using native modules?

Explanation: When using native modules in a hybrid app framework, there is an additional layer of abstraction between the JavaScript code and the native code. This can lead to performance degradation due to the overhead of this abstraction layer.

Q4. In a hybrid app built using React Native, which of the following statements is true about the Native Module?

Explanation: A React Native Module is native code (Java/Kotlin or Objective-C/Swift) that runs on the platform and is exposed to JavaScript through the bridge - on BOTH Android and iOS, which is why the keyed "only for Android" option contradicted its own explanation. JavaScript files cannot directly touch native APIs, and creating native UI components is the separate Native Components concept.

Q5. When using a hybrid app framework like React Native, which of the following is a benefit of using a library like React Native Maps for displaying maps?

Explanation: When using a hybrid app framework like React Native, using a library like React Native Maps can provide a number of benefits. One of the key advantages is that it enables the use of JavaScript and React components to render map views, which can make it easier to integrate maps into a React Native app and can also provide a more consistent and predictable user experience.

Q6. Which of the following is a key advantage of using a hybrid app framework like React Native for building a mobile app that requires access to the device's Bluetooth Low Energy (BLE) capabilities?

Explanation: Hybrid frameworks like React Native provide a more efficient way to access native APIs, including BLE capabilities, through the use of native modules. This allows developers to build cross-platform apps that can access device features without the need for platform-specific code.

Q7. When using a hybrid app framework, which of the following is a common approach to optimize the performance of a native module written in Java/Kotlin for Android?

Explanation: Hybrid app frameworks like React Native or Flutter often provide a built-in bridge that allows developers to directly call native modules written in Java/Kotlin for Android. This approach optimizes performance by reducing the overhead of JavaScript shims or native wrappers.

Q8. When building a mobile app using React Native, which of the following is a limitation of using the Native Module API to interact with native platform components?

Explanation: When using the Native Module API in React Native, developers have direct access to native platform APIs, which can be beneficial for performance-critical code. However, if not implemented correctly, this can lead to memory leaks, which can cause the app to crash or become unresponsive.

Q9. In a hybrid app built with React Native, which of the following statements about the JavaScript engine is correct?

Explanation: In hybrid apps built with React Native, the JavaScript engine is executed on a separate thread from the native thread, which improves performance and allows for more efficient execution of JavaScript code.

Q10. When developing a mobile app, which of the following is a key advantage of using a native app framework over a hybrid app framework when it comes to handling device hardware features such as GPS and camera?

Explanation: Native app frameworks have direct access to device hardware features, which allows for more efficient and accurate use of features such as GPS and camera. This is because native app frameworks are written in the device's native language, which provides a more direct interface to the device's hardware.

That was just a sample. Sign up to unlock the full question bank with timed tests and certificates.

Sign Up Free
Native Vs Hybrid Apps MCQ Practice Test | Mind Hustle