To prepare for an interview on React Native, one should hone on both React and mobile-based concepts. A good understanding of these concepts enables developers to develop high-performance applications, prevent various errors, and justify why they have made those choices.
Where do useMemo and useCallback actually store values in React Native?
Both useMemo and useCallback do not store anything on a device in a device warehouse, sync, or a universal cache. Rather, they reside in the in-memory system of React attached to every instant of the component.
- A Fiber node is the hidden structure used by React to track what changes in any of its rendered components.
- Hooks on that part are represented as a linked list in the fibers.memoizedState of the node.
- In the case of useMemo, the current state is something like: [computedValue, dependencies].
- In case of useCallback, the saved stuff is: [reference or function, dependencies].
- During re-render, React is recommended to check the existence of dependencies. Otherwise, it recycles the previous value or something. Otherwise it recalculates and substitutes it.
Think of each component as having its own private “hook table.” Each call to useMemo or useCallback fills a row in that table. The values are discarded once the component unmounts or the app restarts.
When to use
- useMemo: In case you have to do some calculation which is too expensive to run at each render.
- useCallback: When everything needs to remain constant (particularly with a prop that goes to a memoized child).
Common mistakes
- Off everywhere without actual necessity.
- Making an assumption that results are shared across components (they are not).
- Not to persist after unmount (not possible).
What are Turbo Modules in React Native?
React Native Next React Native is the next-generation native module system whose modules are composed of Turbo Modules. These allow the JavaScript Interface (JSI) to replace the old JSON bridge by enabling JavaScript to directly communicate to native code with virtually zero overhead.
Why Turbo Modules are important
- Faster software: No step to serialize the data as Gateway.
- Lazy loading: Modules are loaded only when they are needed, so it has better to start them, and it consumes less memory.
- Type safety: TypeScript / Flow generates native bindings automatically and minimizes runtime errors.
Where you’ll notice improvements
- Quicker app launches.
- Native features (Camera, Sensors, or Location) should be executed more smoothly.
- Less latency on hardware.
Migration tips
- Adopt the New Architecture (Turbo Modules + Fabric).
- Define module specs → let codegen handle boilerplate glue code.
What is a Worklet in React Native?
The worket is a better type of JavaScript function, running in a separate thread, commonly (but not necessarily) on the UI thread. This will be essential when doing smooth animation and gestures since it will avoid the situation where tail can occur due to a busy JS thread.
- Worklets are a core concept in react-native-reanimated v2+.
- To indicate a worklet, you either use the directive worklet, or the library build process.
- They have access to shared values that are synchronized to the UI runtime.
Why they matter
- Get 60fps (ultra smooth) animations.
- Gestures with small latency.
- Run asynchronously outside of the event loop without UI jank.
Constraints
- Run in a sandbox, such that they can no longer follow arbitrary JS objects.
- Keep to serializable values and reanimated primitives.
How do I connect a TV with an Android app?
There are several ways to connect your Android app to a TV, depending on your use case
A) Google Cast (Chromecast / Android TV with Cast built-in)
- Best for: Video/audio streaming.
- How: Use Cast SDK in the mobile app and either default or custom receiver on TV.
- Pros: Reliable, familiar UX, supports multi-device control.
B) Native Android TV App + Mobile Companion App
- Best for: Rich two-way interactions and custom UIs.
- How: Build a TV app (Leanback / Jetpack Compose for TV) and connect via WebSockets, WebRTC, or Firebase.
- Pros: Full customization, low latency.
C) DLNA/UPnP
- Best for: Local media playback to smart TVs.
- How: Discover devices on the LAN and stream via media URIs.
D) Wi-Fi Direct / Local Sockets
- Best for: Environments without routers.
- How: Use peer-to-peer streaming or messaging.
E) Screen Mirroring (Cast / Miracast)
- Best for: Quick demos with minimal coding.
- Trade-off: Latency may vary; UX customization is limited.
What is React Fiber?
React Fiber is the reconciliation engine of React. Fiber has rendering work in small, incremental units, then React can pause it, prioritize it or resume its execution instead of updating everything immediately.
Why it exists
- Applications remain responsive even when there is a large burden.
- Supports such capabilities as Concurrent Rendering and Suspense.
How it works
- Every instance of a component is a Fiber node, the state of which holds the state, the prop, the effects, and even the pointers to other nodes.
- React captures updates in slices so that important tasks (such as user input) can be prioritized over less important (such as background rendering).
What you’ll notice
- Faster UIs with reduced input delay.
- More intelligent decisions in rendering particularly in complex apps.
What is Hermes in React Native?
Hermes is lightweight, capable React Native JavaScript library focused on Android, in particular.
Advantages of Hermes
- Faster startup: Runs a precompiled bytecode rather than running-time parsing of JS.
- Lower memory usage: Works with low-RAM machines.
- Smaller app size: Can often make the APK size smaller than with other JS engines.
Developer benefits
- Completely based on React Native tooling.
- Debugging using Hermes Inspector, that are compatible with common RN dev tools.
How to enable
- Hermes can also be enabled with a config flag in most recent React Native templates.
- When activated, the JS bundle is delivered as Hermes code, making it faster to start up.