12. React Native New Architecture
What is a key benefit of the React Native New Architecture (JSI, Fabric and TurboModules), which is the default in recent versions?
- A.It compiles JavaScript directly to Swift and Kotlin
- B.It removes the need for any native code
- C.JavaScript can call native code directly through JSI instead of sending async JSON messages over the old bridge
- D.It runs the app inside a WebView for better compatibility
Show answer
Answer: C. JavaScript can call native code directly through JSI instead of sending async JSON messages over the old bridge
The old architecture serialised every call into JSON and sent it asynchronously across a bridge, which added latency. JSI lets JavaScript hold references to C++ host objects and call them directly, even synchronously. Fabric is the new renderer and TurboModules load native modules lazily.
13. Listener without effect cleanup
What is the problem with this React Native effect?
useEffect(() => {
const sub = AppState.addEventListener('change', onChange)
}, [])- A.It never removes the listener; return () => sub.remove() so it is cleaned up when the component unmounts
- B.useEffect cannot use AppState
- C.The dependency array must contain AppState and onChange, otherwise the listener is never registered at all
- D.addEventListener must be awaited
Show answer
Answer: A. It never removes the listener; return () => sub.remove() so it is cleaned up when the component unmounts
Each time the component mounts it adds a listener, and without a cleanup function the listener stays alive after unmount. That leaks memory and calls handlers on dead components. Returning a cleanup function from useEffect removes the subscription at the right time.
14. What expo prebuild does
An Expo project has no android or ios folders in Git. What does `npx expo prebuild` do?
- A.Uploads the JavaScript bundle straight to the app stores
- B.Deletes all native code so the app runs in Expo Go
- C.Converts the project into a Flutter app
- D.Generates native projects from the app config and plugins
Show answer
Answer: D. Generates native projects from the app config and plugins
With Continuous Native Generation, native projects are treated as build output. prebuild creates android and ios folders from the app config and config plugins, so native settings live in code that is easy to review and upgrade. Many teams regenerate them in CI instead of committing them.
15. What Fabric is
In the React Native New Architecture, what is Fabric?
- A.The new JavaScript engine that replaces Hermes on Android
- B.A cloud service for distributing OTA updates
- C.The new renderer, with a shared C++ core for the UI tree
- D.A styling library that replaces StyleSheet
Show answer
Answer: C. The new renderer, with a shared C++ core for the UI tree
Fabric reimplements the renderer with a shared C++ core that builds and diffs the shadow tree. It supports concurrent React features and synchronous layout reads when needed. It works alongside Turbo Modules and JSI.
16. What autolinking does
Why do you rarely need to edit MainApplication or Podfile by hand when adding a React Native library?
- A.The library is compiled into the JS bundle by Metro itself
- B.Autolinking finds native code in node_modules and wires it in
- C.Hermes loads the native code at runtime from npm
- D.Native modules are no longer allowed in React Native
Show answer
Answer: B. Autolinking finds native code in node_modules and wires it in
The React Native CLI scans dependencies for native Android and iOS code and adds them to Gradle and CocoaPods. Manual linking is only needed for unusual setups. Expo config plugins go further and also adjust manifests and plists.
17. Querying in React Native Testing Library
Which query best follows React Native Testing Library's guidance for finding a "Submit" button?
- A.screen.getByRole('button', { name: 'Submit' })
- B.wrapper.find('TouchableOpacity').at(2)
- C.screen.UNSAFE_getByType(Pressable)
- D.component.props.children[3]
Show answer
Answer: A. screen.getByRole('button', { name: 'Submit' })
The library encourages queries that match how users and assistive tech see the screen: role, label and text. Such tests survive refactors that change component structure. Querying by component type or child index ties tests to implementation details.
18. What Kotlin Multiplatform shares
How does Kotlin Multiplatform (KMP) typically differ from Flutter and React Native?
- A.It shares only the UI and requires separate business logic
- B.It shares business logic in Kotlin while each platform can keep native UI
- C.It runs JavaScript on iOS through a Kotlin interpreter
- D.It replaces Swift with Dart on Apple devices
Show answer
Answer: B. It shares business logic in Kotlin while each platform can keep native UI
KMP compiles shared Kotlin code to JVM bytecode for Android and native binaries for iOS. Teams often share networking, storage and domain logic while keeping SwiftUI and Jetpack Compose screens. Compose Multiplatform can share UI as well if the team wants it.
19. React Native in a native app
What does "brownfield" React Native integration mean?
- A.Adding React Native screens to an existing native iOS or Android app
- B.Starting a new React Native app from the default template
- C.Running React Native code on a smart TV platform
- D.Moving a React Native app over to the Flutter framework
Show answer
Answer: A. Adding React Native screens to an existing native iOS or Android app
In a brownfield setup, a mature native app hosts a React Native root view for some screens, often new features. The native app owns startup and navigation, and the teams agree on how the two sides share data and routing. Large apps have used this to migrate step by step.
20. Shrinking a React Native Android app
A React Native Android app is 70 MB. Which step usually gives the biggest size reduction for users who install from Play?
- A.Upload an App Bundle so Play sends only the needed ABI
- B.Convert all of the PNG images to BMP format
- C.Disable Hermes and ship the plain JavaScript source
- D.Move every image into the JavaScript bundle
Show answer
Answer: A. Upload an App Bundle so Play sends only the needed ABI
A universal APK includes native libraries for all CPU architectures (arm64-v8a, armeabi-v7a, x86, x86_64), and React Native ships several large .so files. An App Bundle lets Play send only the matching ABI and screen density. Enabling R8 shrinking and removing unused assets helps further.
21. Unreadable JS stack traces in crashes
Crash reports from a release React Native build show stack frames like `index.android.bundle:1:84213`. What makes them readable?
- A.Turning on remote JS debugging for release builds
- B.Uploading the release source maps to the crash reporting tool
- C.Logging every function name with console.log
- D.Building the release with the debug flag set
Show answer
Answer: B. Uploading the release source maps to the crash reporting tool
Release bundles are minified and, with Hermes, compiled to bytecode, so frames point at offsets. The build can emit source maps (for Hermes, composed maps), and tools such as Sentry or Crashlytics use them to map frames back to original files and lines. Upload them for every release build.
22. Expo push token or FCM token
An Expo app gets a token from `getExpoPushTokenAsync()`. How is a push sent to that device?
- A.Your server sends it directly to APNs with the Expo token
- B.The device polls the Expo token endpoint every minute
- C.Expo tokens only work for local notifications
- D.Your server calls the Expo push service, which forwards to FCM or APNs
Show answer
Answer: D. Your server calls the Expo push service, which forwards to FCM or APNs
An Expo push token identifies the device to Expo's push service. Your backend sends messages to that service, which relays them to FCM on Android and APNs on iOS using credentials stored in EAS. Apps that need direct control can use getDevicePushTokenAsync and talk to FCM or APNs themselves.
23. Pages that should expire
An event page for a Dubai expo should drop from Google after the event. Which robots rule fits?
- A.unavailable_after with a date
- B.noarchive with the event name
- C.nosnippet on the event details
- D.max-snippet set to zero
Show answer
Answer: A. unavailable_after with a date
The unavailable_after rule tells Google to stop showing a page after a given date. It suits time-limited pages like events or offers. After that time, Google treats the page like noindex.