Sample questions
Question 1Easy
Where are Android permissions such as CAMERA declared?
- AndroidManifest.xml
- package.json
- Info.plist
- build.gradle settings only
Answer: A. AndroidManifest.xml
Explanation
Android permissions are listed in AndroidManifest.xml. Dangerous ones must also be requested at runtime.
Step-by-step solution
- Android permissions are declared with uses-permission tags.
- These tags are placed in AndroidManifest.xml.
- Option A is the correct answer.
Why the other options are wrong
- B. package.json holds JavaScript dependencies and scripts, not native permissions.
- C. Info.plist is the iOS configuration file, not the Android one.
- D. Gradle settings do not declare manifest permissions.
Tip: Declare permissions in the manifest, and request dangerous ones again at runtime.
Question 2Easy
Which runtime API is used to request dangerous permissions on Android from JavaScript?
PermissionsAndroid.request()Platform.requestPermission()Linking.askPermission()AppState.permit()
Answer: A. PermissionsAndroid.request()
Explanation
PermissionsAndroid shows the system dialog and resolves with the result. Declaring the permission in the manifest alone is not enough for dangerous permissions.
Step-by-step solution
- Runtime permission requests on Android use the PermissionsAndroid API.
- PermissionsAndroid.request() shows the system dialog and resolves with the result.
- Option A is the correct answer.
Why the other options are wrong
- B. Platform has no requestPermission method.
- C. Linking opens URLs and apps; it does not request permissions.
- D. AppState tracks foreground and background state; it has no permit method.
Tip: Declare the permission in the manifest, then request dangerous ones at runtime with PermissionsAndroid.request().
Question 3Easy
A project has Button.ios.js and Button.android.js. What does import Button from './Button' load?
- Always Button.ios.js, as it comes first
- An error, because Button.js does not exist
- Both files merged into one component
- The file matching the platform being bundled
Answer: D. The file matching the platform being bundled
Explanation
The bundler picks the platform-specific extension automatically, so each platform gets its own implementation.
Step-by-step solution
- The bundler resolves platform file extensions such as .ios.js and .android.js.
- An import of './Button' is resolved to the file for the platform being built.
- Option D describes this, so it is the correct answer.
Why the other options are wrong
- A. Button.ios.js is only loaded for iOS builds, not always.
- B. No error occurs, because the platform file is found by the bundler.
- C. The two files are not merged; only the matching one is loaded.
Tip: Use Name.ios.js and Name.android.js for platform splits; the import path stays the same.
Question 4Easy
Which API shows a short toast message and exists only on Android?
- Alert
- ToastAndroid
- Snackbar
- Notification
Answer: B. ToastAndroid
Explanation
ToastAndroid is a core Android-only module. Alert works on both platforms.
Step-by-step solution
- ToastAndroid is a core module that shows short toast messages on Android.
- It is not available on iOS.
- Option B is the correct answer.
Why the other options are wrong
- A. Alert shows a dialog and works on both platforms.
- C. Snackbar is not a core React Native API.
- D. Notification is not the core React Native API for short messages.
Tip: ToastAndroid is Android-only; use Alert or a cross-platform option for both platforms.
Question 5Medium
What is a file named Header.native.js used for?
- Mobile-only code, while Header.js serves web
- Code that runs only on the Hermes engine
- A native module written in JavaScript
- Code that is compiled to Swift and Kotlin
Answer: A. Mobile-only code, while Header.js serves web
Explanation
The .native.js extension is picked on both mobile platforms, which is useful when the same project also targets web through react-native-web.
Step-by-step solution
- A .native.js file is picked by the bundler for iOS and Android builds.
- A plain Header.js file is used for other targets, such as web with react-native-web.
- Option A matches this, so it is the correct answer.
Why the other options are wrong
- B. Hermes is a JavaScript engine; the file suffix does not select an engine.
- C. The suffix does not make a native module; it only selects mobile code.
- D. JavaScript files are not compiled into Swift or Kotlin by this suffix.
Tip: Use .native.js for mobile-only variants and a plain .js file for the default.
Question 6Medium
Which API opens the phone dialer from React Native code?
Platform.call('9876543210')Alert.dial('9876543210')Linking.openURL('tel:9876543210')NativeModules.Phone.open()
Answer: C. Linking.openURL('tel:9876543210')
Explanation
Linking opens URLs with any registered handler; the tel: scheme hands the number to the dialer.
Step-by-step solution
- Linking.openURL opens URLs.
- tel: opens the dialer.
Why the other options are wrong
- A. No Platform.call.
- B. Alert has no dial.
- D. No such module.
Tip: tel: scheme.
Question 7Medium
How are drop shadows usually added on each platform in React Native?
- box-shadow strings on both platforms
- shadow* props on iOS, elevation on Android
- elevation on iOS, shadow* props on Android
- Only with images, as neither platform supports it
Answer: B. shadow* props on iOS, elevation on Android
Explanation
iOS uses shadowColor, shadowOffset, shadowOpacity and shadowRadius. Android uses elevation, which also affects stacking order.
Step-by-step solution
- IOS shadows are set with shadowColor, shadowOffset, shadowOpacity and shadowRadius.
- Android shadows are set with the elevation style.
- Option B matches both platforms, so it is the correct answer.
Why the other options are wrong
- A. Box-shadow is a web CSS property; the usual mobile pair is shadow props and elevation.
- C. This is reversed: elevation is the Android property and shadow props are the iOS ones.
- D. Shadows can be set on both platforms with these styles, so this is false.
Tip: IOS uses shadow props and Android uses elevation; set both for a cross-platform shadow.
Question 8Medium
What does Platform.Version return on Android?
- The app's versionName string
- The React Native version
- The Android API level as a number
- The device model name
Answer: C. The Android API level as a number
Explanation
On Android, Platform.Version is the API level (an integer). On iOS it is the OS version as a string.
Step-by-step solution
- On Android, Platform.Version is the API level.
- The API level is an integer that identifies the Android version.
- Option C matches, so it is the correct answer.
Why the other options are wrong
- A. VersionName is an app setting; Platform.Version does not return it.
- B. Platform.Version does not give the React Native version.
- D. Platform.Version does not give the device model.
Tip: Platform.Version is a number on Android and a string on iOS, so check the type before comparing.
Question 9Hard
An iOS app accesses the camera without NSCameraUsageDescription in Info.plist. What happens?
- The app is terminated when it tries to access it
- The camera opens with a generic system message
- The permission is granted without asking the user
- Only a warning is logged in release builds
Answer: A. The app is terminated when it tries to access it
Explanation
iOS requires a usage description string for protected resources. Without it, the app is killed when it tries to access the resource.
Step-by-step solution
- iOS needs a usage description for the camera.
- If NSCameraUsageDescription is missing, the system kills the app at access.
Why the other options are wrong
- B. No dialog appears.
- C. Permission is never granted silently.
- D. It crashes, not just a warning.
Tip: No description = crash.
Question 10Hard
On Android, which manifest setting is commonly used so the window resizes when the keyboard opens?
- android:keyboardMode="resizeWindow"
- android:configChanges="keyboard"
- android:windowSoftInputMode="adjustResize"
- android:screenOrientation="keyboard"
Answer: C. android:windowSoftInputMode="adjustResize"
Explanation
adjustResize makes the activity's window shrink to fit above the soft keyboard, which many apps pair with KeyboardAvoidingView on iOS.
Step-by-step solution
- AdjustResize makes the activity window shrink to sit above the soft keyboard.
- This is set with the android:windowSoftInputMode attribute.
- Option C has that attribute and value, so it is the correct answer.
Why the other options are wrong
- A. KeyboardMode is not the attribute that controls keyboard resizing.
- B. ConfigChanges lists changes the activity handles itself; it does not resize the window.
- D. ScreenOrientation sets screen rotation, not keyboard resizing.
Tip: For keyboard resizing on Android, use windowSoftInputMode with adjustResize or adjustPan.
Practise all 14 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →