Blog

React Native Interview Questions: From Junior to Principal Engineer (2026)

By Ahsan Hafeez · 2026-11-10

Whether you are preparing for your first React Native role or a principal engineer interview, this guide covers real questions asked at each seniority level. Answers are kept short so you can review fast and build depth where you need it.

Core Foundations

Q: What was the JS Bridge and why did React Native move away from it?

The JS Bridge was an asynchronous, JSON-serialized messaging layer between the JavaScript thread and the native thread. Every call had to be serialized, sent across the bridge, deserialized, and then executed on the other side. This created a bottleneck for high-frequency operations like gestures and animations. JSI (JavaScript Interface) replaced it by allowing JS to hold direct references to C++ host objects, enabling synchronous native calls without serialization overhead.

Q: What is Hermes and why does React Native use it?

Hermes is a JavaScript engine built by Meta specifically for React Native. It compiles JS to bytecode at build time rather than at runtime, which cuts app startup time significantly. It also uses less memory than JavaScriptCore because of its optimized garbage collector and bytecode format. Since React Native 0.70, Hermes is the default engine on both Android and iOS.

Q: Explain the React Native threading model.

React Native runs on three main threads. The Main (UI) thread handles native view rendering and user touch events. The JS thread runs your JavaScript code, including React reconciliation and business logic. The Shadow thread (now part of the Fabric renderer) calculates layout using Yoga, a cross-platform layout engine that implements Flexbox.

Q: How do native modules work in React Native?

Native modules let you write platform-specific code in Java/Kotlin (Android) or Objective-C/Swift (iOS) and expose it to JavaScript. You register the module with React Native's module registry, define the methods you want to export, and call them from JS. With TurboModules, this process is codegen-driven: you write a JS spec, and the toolchain generates the native boilerplate and type-safe bindings automatically.

Q: What is the New Architecture (Fabric and TurboModules)?

Fabric is the new rendering system that replaces the old UIManager bridge-based approach. It renders views synchronously using C++ and can create shadow nodes directly from the JS thread via JSI. TurboModules replace legacy native modules with lazy-loaded, codegen-typed modules that use JSI for direct communication. Together, they remove the async bridge and enable concurrent features like React 18 transitions.

Q: How does React Native render a view from JSX to screen pixels?

React runs reconciliation on your component tree and produces a tree of React Native elements. The shadow thread takes this element tree and runs Yoga layout to compute exact positions and sizes for each node. Once layout is complete, the results are dispatched to the main thread where native views (UIView on iOS, android.view.View on Android) are created or updated. With Fabric, steps two and three can happen synchronously on any thread.

Q: What role does Metro play in the React Native build process?

Metro is React Native's JavaScript bundler. It resolves imports, transforms code through Babel, and produces a single JS bundle (or split bundles with RAM bundle format). During development, Metro serves the bundle over HTTP and supports Fast Refresh by hot-swapping changed modules. For production, it generates the optimized bundle that gets embedded in the native binary.

Q: How is React Native different from hybrid frameworks like Ionic or Cordova?

Hybrid frameworks run a web app inside a WebView, so all rendering goes through the browser engine. React Native renders actual native platform views: a <Text> component becomes a UILabel on iOS and a TextView on Android. This means React Native apps get native scroll physics, native accessibility, and native performance characteristics. The tradeoff is that you need to deal with platform-specific behavior and native build tooling.

Junior Level

Q: Why should you use StyleSheet.create instead of inline style objects?

StyleSheet.create validates your styles at creation time and sends them to native only once. Inline objects are re-created on every render, which means new references that can trigger unnecessary native view updates. Using StyleSheet also gives you autocomplete and catches typos early. The performance difference is small for simple screens but adds up in long lists.

Q: When should you use FlatList instead of ScrollView?

Use FlatList when rendering a dynamic or large list of items. ScrollView renders all its children at once, so 500 items means 500 views in memory. FlatList virtualizes the list by rendering only the items currently visible on screen plus a small buffer. For static content with a few items (like a settings page), ScrollView is perfectly fine.

Q: How do useState and useEffect work together in a React Native component?

useState declares a state variable and a setter function. When you call the setter, React schedules a re-render of that component. useEffect runs side effects after the render is committed to the screen: fetching data, subscribing to events, or interacting with native APIs. The dependency array controls when the effect re-runs: empty array means mount only, specific values means when those values change.

Q: What navigation library do most React Native apps use and what are the main navigator types?

React Navigation is the standard library. Stack navigator pushes screens onto a stack with forward/back transitions. Tab navigator shows a bottom or top tab bar with multiple screens. Drawer navigator adds a slide-out menu. You nest them: a tab navigator where each tab contains its own stack navigator.

Q: What is AsyncStorage and when should you avoid it?

AsyncStorage is a simple key-value store that persists data to disk asynchronously. It works well for small amounts of data like user preferences, auth tokens, or onboarding flags. Avoid it for large datasets, complex queries, or relational data because it has no indexing or query language. For those cases, use a database like WatermelonDB, Realm, or SQLite.

Q: How do you write platform-specific code in React Native?

You have two main approaches. Use Platform.OS or Platform.select for small inline differences like a padding value or a color. For larger differences, create platform-specific files with .ios.js and .android.js extensions, and React Native's module resolver picks the right one automatically based on the target platform.

Q: What debugging tools are commonly used with React Native?

Flipper is the primary desktop debugging tool: it shows logs, network requests, layout inspection, and performance data. React DevTools lets you inspect the component tree and props/state. For native crashes, Xcode and Android Studio debuggers are essential. Chrome DevTools can debug the JS thread but adds latency because it runs JS in Chrome's V8 instead of the on-device engine.

Q: What is SafeAreaView and why is it needed?

SafeAreaView adds padding so content does not overlap with device hardware like the iPhone notch, status bar, or home indicator. Without it, text and buttons can render behind the notch or under the system status bar. The react-native-safe-area-context library gives you more control with the useSafeAreaInsets hook, which returns exact inset values you can apply to any style property.

Q: What is the difference between controlled and uncontrolled TextInput?

A controlled TextInput has its value bound to state via the value prop, and updates through onChangeText. This gives you full control for validation, formatting, and predictable behavior. An uncontrolled input uses defaultValue and reads the value only when needed. Controlled is the standard pattern in React Native because it avoids sync issues between JS state and native input state.

Mid Level

Q: How do you optimize FlatList performance for large datasets?

Set getItemLayout if items have a fixed height so FlatList skips measurement. Use keyExtractor with stable unique IDs. Wrap row components in React.memo so unchanged rows do not re-render. Tune windowSize, maxToRenderPerBatch, and initialNumToRender based on your item height and screen size. Avoid anonymous functions in renderItem that create new references each render.

Q: When should you use React.memo, useMemo, and useCallback?

React.memo wraps a component to skip re-renders when props have not changed by shallow comparison. useMemo caches a computed value so expensive calculations only re-run when dependencies change. useCallback caches a function reference so child components receiving it as a prop do not re-render unnecessarily. Do not wrap everything: profile first and apply these where you measure actual wasted renders.

Q: How do you build a custom native module?

On Android, create a class extending ReactContextBaseJavaModule, annotate methods with @ReactMethod, and register it in a package class. On iOS, create a class that implements RCTBridgeModule, expose methods with RCT_EXPORT_METHOD, and ensure it is included in the build target. With TurboModules, you write a TypeScript spec file in your project, run codegen, and implement the generated interface on each platform.

Q: How does deep linking work in a React Native app?

Deep linking maps a URL scheme (myapp://profile/123) or a universal link (https://myapp.com/profile/123) to a screen in your navigation tree. You configure URL prefixes and a linking config in React Navigation that maps path patterns to screen names and params. On iOS, universal links require an apple-app-site-association file on your domain. On Android, you declare intent filters in AndroidManifest.xml.

Q: Describe a push notification architecture for React Native.

The device registers with APNs (iOS) or FCM (Android) and gets a device token. Your app sends this token to your backend. When a notification needs to go out, the backend sends the payload to APNs/FCM, which delivers it to the device. Libraries like @react-native-firebase/messaging and notifee handle registration, foreground display, background handlers, and notification categories.

Q: What patterns support offline-first in React Native?

Cache API responses locally using a database (WatermelonDB, SQLite) and serve from cache when the network is unavailable. Queue mutations locally and sync them when connectivity returns, handling conflict resolution on the server. Use NetInfo to detect connectivity state and show appropriate UI. Optimistic updates give users instant feedback while the sync happens in the background.

Q: How does Reanimated differ from the built-in Animated API?

The built-in Animated API runs on the JS thread by default, which means complex animations compete with business logic for thread time. Reanimated runs animations entirely on the UI thread using worklets (small JS functions compiled to run on native). This gives you 60fps animations even when the JS thread is busy. Reanimated also supports gesture-driven animations, spring physics, and layout animations that the built-in API cannot handle well.

Q: What does a CI/CD pipeline look like for a React Native app?

A typical pipeline runs lint, type checks, and unit tests on every PR. For builds, it compiles the JS bundle and builds the native binary using Fastlane or EAS Build. Android produces an AAB for Play Store and iOS produces an IPA signed with the right provisioning profile. Automated distribution goes through TestFlight (iOS) and internal testing tracks (Android), with production releases gated behind manual approval.

Q: Compare Redux, Zustand, and Context for state management.

Redux is verbose but predictable: it shines in large apps with complex state transitions, time-travel debugging, and middleware needs. Zustand is lightweight with a minimal API, no providers, and good performance out of the box. Context is built-in and perfect for low-frequency state like theme or auth, but re-renders all consumers on any state change, making it a poor choice for frequently updating data.

Senior Level

Q: How do you structure a large React Native codebase?

Feature-based architecture groups code by domain (auth, payments, messaging) rather than by type (components, screens, hooks). Each feature folder contains its own components, hooks, services, and types. Shared utilities live in a common or core folder. This makes features independently testable and lets teams own specific folders without stepping on each other.

Q: What monitoring and crash reporting strategy do you recommend?

Use Sentry or Bugsnag for crash reporting with source map upload so you get readable JS stack traces. Track native crashes separately since they have different root causes. Add performance monitoring for screen load times, API latency, and JS thread frame drops. Set up alerts on crash-free user rates and use breadcrumbs to trace user actions leading to a crash.

Q: How do you approach complex animation choreography?

Break the animation into discrete phases and define shared values for each animatable property. Use Reanimated's withSequence, withDelay, and withSpring to compose the timeline. For gesture-driven flows, combine react-native-gesture-handler with Reanimated's useAnimatedGestureHandler to keep everything on the UI thread. Test on low-end devices early because smooth performance on a flagship tells you nothing.

Q: What strategies exist for bridging legacy native code into React Native?

Wrap existing native SDKs as native modules (or TurboModules) with a thin JS API layer. For UI components, create native view managers that expose the native view as a React component with props mapped to native properties. If the legacy code has its own navigation, consider a hybrid approach where some screens are native and React Navigation hands off to native view controllers or activities.

Q: How do you share code between a React Native app and a web app?

Extract platform-agnostic business logic, hooks, and types into shared packages. Use .native.ts and .web.ts file extensions for platform-specific implementations behind a common interface. A monorepo with workspaces (Yarn or pnpm) makes this manageable. Avoid sharing UI components directly: the interaction patterns and layout expectations are fundamentally different between mobile and web.

Q: How do you manage multiple build variants (staging, production, QA)?

Use environment-specific .env files with react-native-config to inject API URLs, feature flags, and keys at build time. On Android, define product flavors in build.gradle for different app IDs and signing configs. On iOS, use Xcode schemes and build configurations. Each variant should have its own app icon and name so testers never confuse staging for production.

Q: What security measures should a React Native app implement?

Use certificate pinning (via TrustKit or a native pinning config) to prevent MITM attacks. Store sensitive data in the platform keychain (iOS) or Keystore (Android) using react-native-keychain, never in AsyncStorage. Enable ProGuard/R8 on Android and Bitcode on iOS to obfuscate compiled code. Disable JS debugging in production builds and strip console logs from the release bundle.

Q: How do you handle backward compatibility when updating native dependencies?

Pin native dependency versions and test upgrades in isolation on a separate branch. Read changelogs for breaking changes in native APIs before upgrading. Maintain a compatibility matrix that tracks which versions of your key native libraries work together. Run integration tests on both platforms after any native dependency change because a working Android build does not guarantee iOS works.

Team Lead

Q: How do you structure a mobile release process with rollback capability?

Define a release cadence (weekly or biweekly) with a code freeze date. Cut a release branch, run regression tests, and deploy to internal testing. Use staged rollouts (1%, 10%, 50%, 100%) on both stores. For rollback, keep the previous version's binary ready and use store rollback or publish a hotfix. OTA updates via EAS Updates or a custom CodePush alternative let you push JS fixes without a full store review.

Q: What code review standards do you set for a mobile team?

Require platform testing on both iOS and Android for any PR touching native code or platform-specific behavior. Check for accessibility (labels, contrast, touch target sizes) as part of every UI review. Review performance implications for list screens and navigation transitions. Enforce consistent error handling patterns and verify that new screens have crash reporting breadcrumbs.

Q: How do you manage tech debt in a fast-moving mobile codebase?

Allocate a fixed percentage of each sprint (15-20%) to tech debt. Track debt items in the backlog with severity and blast radius so you can prioritize. Attack debt that slows down feature work first: flaky tests, slow builds, and outdated native dependencies. Avoid big-bang rewrites. Migrate incrementally, screen by screen or module by module, behind feature flags.

Q: What do you look for when hiring React Native developers?

Strong JavaScript and React fundamentals matter more than React Native-specific knowledge because the framework changes fast. Ask candidates to debug a real performance problem or walk through how they would architect a feature. Check for native platform awareness: they should understand what happens below the JS layer even if they do not write native code daily. Cultural fit and communication skills weigh heavily for mobile teams because cross-platform work requires constant coordination.

Q: How do you align a React Native team with existing iOS and Android native teams?

Establish shared design system tokens so native and React Native screens look consistent. Define clear ownership boundaries: which screens are React Native and which stay native. Set up a shared testing device lab and CI infrastructure. Hold regular cross-team syncs to discuss platform updates, OS betas, and shared SDK upgrades. Write thin native wrappers for shared SDKs so both teams consume the same interface.

Q: What OTA update strategy do you recommend now that CodePush is deprecated?

EAS Updates (from Expo) is the primary replacement for managed and bare React Native projects. It supports channel-based rollouts, runtime version targeting, and rollback. For teams that need self-hosted control, react-native-ota-hot-update or a custom solution using S3 and a manifest endpoint works. Always gate OTA updates with a runtime version check so a JS bundle never loads against an incompatible native binary.

Q: How do you handle a critical production crash affecting 10% of users?

First, check Sentry or your crash tool to identify the exact stack trace, affected OS versions, and device models. If the crash is in JS, push an OTA hotfix immediately. If it is in native code, prepare an emergency build and request expedited App Store review (Apple supports this) and a staged rollout on Google Play. Communicate status to stakeholders every 30 minutes. After resolution, run a postmortem and add regression tests covering the failure.

Principal Engineer

Q: How do you decide between React Native and fully native for a new product line?

Evaluate team composition, timeline, and feature requirements. React Native works well when you need to ship on both platforms with a small team, the app is primarily data-driven UI, and you already have strong JS talent. Go native when the app is heavily GPU-dependent (games, AR/VR), relies on cutting-edge platform APIs on day one, or you have dedicated iOS and Android teams. Most business apps benefit from React Native's faster iteration speed.

Q: How do you scale React Native across multiple teams and apps?

Build a shared platform team that owns core infrastructure: navigation framework, networking layer, design system components, and native module wrappers. Publish these as versioned internal packages. Each product team consumes the packages and owns their feature code. Define clear API contracts between packages and enforce them with TypeScript types and integration tests. This prevents teams from diverging on core patterns.

Q: What monorepo strategy works for shared React Native packages?

Use pnpm or Yarn workspaces with a tool like Turborepo for build orchestration. Structure packages as: core (business logic, hooks, types), ui (design system), native-modules (shared native code), and app-specific packages. Each package has its own tsconfig, tests, and changelog. Hoist shared dependencies to the root to avoid version conflicts. Metro requires custom configuration for monorepo resolution, so invest in getting that right early.

Q: How do you plan a migration to the React Native New Architecture?

Start by auditing every native module and third-party library for New Architecture compatibility. Migrate your own modules to TurboModules first since you control that code. Enable the new architecture behind a build flag and run it on a staging build for weeks before production. Migrate renderer to Fabric screen by screen using the interop layer that lets old and new renderers coexist. Plan for 2-3 months of stabilization on a large codebase.

Q: What does build infrastructure look like at scale for React Native?

Dedicated CI machines (or EAS Build) with pre-warmed caches for CocoaPods, Gradle, and node_modules. Separate pipelines for JS-only changes (fast, minutes) and native changes (slow, 15-30 minutes). Build artifact caching so unchanged native code does not recompile. Parallel test execution across device farms (AWS Device Farm, BrowserStack) for integration and E2E tests. Monitor build times weekly and set a ratchet: builds must not get slower.

Q: How do you align mobile platform strategy with business goals?

Tie mobile metrics to business outcomes: app store rating to retention, crash-free rate to churn, startup time to conversion. Present platform investments (new architecture migration, CI improvements) in terms of developer velocity, which translates to faster feature delivery. Build a quarterly roadmap that balances platform health (20-30%) with feature work. Share mobile performance dashboards with product and leadership so platform investments have visible ROI.

Q: When should you invest in a design system versus ad-hoc components?

If you have more than two apps or more than one team building UI, a shared design system pays for itself within two quarters. Start with foundational tokens (colors, spacing, typography) and 10-15 high-use components (Button, Input, Card, Modal). Ship it as a versioned package with a Storybook-style catalog. Do not try to cover every edge case upfront: let product teams contribute components back as they build features, with the platform team reviewing for consistency.

Q: How do you evaluate build-vs-buy for native functionality?

Calculate the total cost of ownership, not just the initial integration. A third-party SDK saves months of development but adds a dependency you do not control: updates on their schedule, potential conflicts with other SDKs, and privacy compliance risk. Build in-house when the feature is core to your product differentiator or when no SDK meets your quality bar. For commodity features (analytics, crash reporting, payments), buy. For core product features, build.

Rapid Fire: Practical Q&A

Q: How Different is React Native from ReactJS?

ReactJS is a web library that renders HTML elements in the browser DOM. React Native uses the same React component model but renders native platform views (UIView on iOS, android.view.View on Android) instead of HTML. There is no browser, no CSS cascade, and no DOM. You share JS logic and React patterns, but the rendering target and available APIs are completely different.

Use Case: Deciding the tech stack when a company wants both a web dashboard and a mobile app. Real-Time Example: An e-commerce company uses React.js for their website and React Native for their iOS/Android app, sharing validation logic and API client code between both.

Q: Controlled / Uncontrolled Components

A controlled component has its value driven by React state via the value prop and updates through onChangeText. An uncontrolled component uses defaultValue and reads the native input value only when needed, like on form submit. Controlled components are the standard in React Native because they keep JS state and native state in sync.

Use Case: Building a form with real-time validation that shows errors as the user types. Real-Time Example: A signup form where the email field validates format on every keystroke and disables the submit button until all fields pass.

Q: AsyncStorage

AsyncStorage is a simple, unencrypted, asynchronous key-value storage system that persists data to disk. It stores strings only, so objects must be JSON-serialized. It has no query support, indexing, or encryption. For anything beyond small config values, use a proper database.

Use Case: Persisting user preferences like theme mode or language selection across app restarts. Real-Time Example: A news app saves the user's preferred content categories in AsyncStorage so the feed loads with their filters on next launch.

Q: Refresh token

A refresh token is a long-lived credential used to obtain a new access token when the current one expires, without requiring the user to log in again. The app stores the refresh token securely (keychain/keystore), and when an API call returns 401, it sends the refresh token to get a fresh access token. If the refresh token is also expired or revoked, the user must re-authenticate.

Use Case: Keeping users logged in for weeks without compromising security by using short-lived access tokens. Real-Time Example: A banking app uses 15-minute access tokens and 30-day refresh tokens, so users stay logged in but stolen access tokens expire quickly.

Q: JWT vs Session token

JWT (JSON Web Token) is stateless: the server encodes user data and signs it, so no server-side session store is needed. Session tokens are opaque strings stored in a server-side database, and the server looks up session data on every request. JWTs reduce database load but cannot be revoked instantly without a blocklist. Session tokens can be revoked immediately by deleting the server record.

Use Case: Choosing an auth strategy for a microservices backend that serves a mobile app. Real-Time Example: A food delivery app uses JWTs for speed across 10 microservices, with a Redis blocklist for forced logouts on password change.

Q: Props Drilling

Props drilling is passing data through multiple layers of components that do not use the data themselves, just to reach a deeply nested child. It makes components tightly coupled and hard to refactor. Solutions include React Context, state management libraries (Redux, Zustand), or component composition patterns.

Use Case: Sharing the authenticated user object from a root provider down to a deeply nested profile avatar component. Real-Time Example: Instead of passing user through 6 intermediate components, wrap the app in a UserContext.Provider and call useContext(UserContext) in the avatar component directly.

Q: Redux: Store, dispatch, action, useSelector, useDispatch, Saga

The store is the single source of truth holding global state. Actions are plain objects describing what happened. Dispatch sends an action to the store. Reducers handle the action and return new state. useSelector reads state from the store, and useDispatch gives you the dispatch function. Redux Saga handles complex async flows using generator functions that listen for dispatched actions and run side effects.

Use Case: Managing complex e-commerce cart state with async operations like price validation and inventory checks. Real-Time Example: User adds an item to cart (action dispatched), a saga intercepts it to check stock via API, then dispatches success or failure to update the cart state.

Q: Navigation 6: Types of Navigations

React Navigation 6 provides Stack (push/pop screens), Bottom Tab (tab bar at the bottom), Top Tab (swipeable tabs at the top), Drawer (slide-out menu), and Native Stack (uses platform-native transitions for better performance). You nest navigators to combine them: a bottom tab navigator where each tab has its own stack.

Use Case: Building an app with a bottom tab bar where each tab has its own independent navigation history. Real-Time Example: Instagram-style app: Home, Search, Reels, Shop, Profile tabs, each with their own stack of screens that navigate independently.

Q: On back does useEffect get called?

When you press back and a screen is popped from the stack, the component unmounts, so the useEffect cleanup function runs. When you navigate back to a screen that was still mounted (like switching tabs), useEffect does not re-run because the component never unmounted. Use useFocusEffect from React Navigation if you need to run code every time a screen comes into focus.

Use Case: Refreshing data every time a user navigates back to a list screen after editing an item. Real-Time Example: A task management app uses useFocusEffect on the task list screen to re-fetch tasks after the user edits a task on a detail screen and presses back.

Q: Responsive Design in RN

React Native does not have CSS media queries. Use the Dimensions API or useWindowDimensions hook to get screen width and height, then apply styles conditionally. Libraries like react-native-responsive-screen provide percentage-based sizing. Flexbox handles most responsive layouts natively. For tablets, detect screen size at launch and render different layouts.

Use Case: Building a dashboard that shows a single-column layout on phones and a two-column layout on tablets. Real-Time Example: A CRM app detects screen width on mount and renders the contact list alongside the detail view on iPads, but stacks them on iPhones.

Q: Styling RN Component

React Native uses JavaScript objects for styling, not CSS. Properties are camelCase (backgroundColor instead of background-color). There is no cascade or inheritance (except text properties inside <Text>). Use StyleSheet.create for validation and performance. You can also use libraries like Styled Components or NativeWind (Tailwind for RN).

Use Case: Building a design system with consistent spacing, colors, and typography across the app. Real-Time Example: A shared theme.js exports color tokens and spacing values that every component imports, ensuring visual consistency without duplicating style definitions.

Q: Flexbox in React Native

React Native uses Flexbox for layout with flexDirection defaulting to column (unlike CSS which defaults to row). The core properties are flex, flexDirection, justifyContent, alignItems, and flexWrap. All layout is Flexbox: there is no display: block, float, or CSS Grid. Yoga, a C++ layout engine, computes the Flexbox layout on a separate thread.

Use Case: Creating a responsive card grid that wraps items to the next row when the screen width is exceeded. Real-Time Example: A product listing screen uses flexDirection: 'row' with flexWrap: 'wrap' to show product cards in a grid that adapts to screen width.

Q: Different Threads in React Native

React Native has three threads. The Main/UI thread renders native views and handles touch events. The JS thread runs your JavaScript code, React reconciliation, and business logic. The Shadow thread calculates layout using Yoga. With the New Architecture, Fabric can run rendering work synchronously across threads, and JS worklets (Reanimated) can run on the UI thread.

Use Case: Understanding why a heavy API response parsing operation causes janky scroll animations. Real-Time Example: Parsing a 5MB JSON on the JS thread blocks React from processing scroll events, causing frame drops. Moving the parse to a worker or chunking it fixes the jank.

Q: Network Request: Axios, Fetch, RTK Query

Fetch is built into React Native and works like the browser Fetch API. Axios is a library that adds interceptors, automatic JSON transforms, request cancellation, and timeout support. RTK Query (from Redux Toolkit) is a full data-fetching and caching layer: it auto-generates hooks, handles loading/error states, caching, and re-fetching. Pick based on complexity: Fetch for simple calls, Axios for interceptor needs, RTK Query for app-wide data management.

Use Case: Choosing a networking approach for an app with 50+ API endpoints, auth token refresh, and caching needs. Real-Time Example: A social media app uses RTK Query to cache the feed, auto-refetch on focus, and deduplicate simultaneous requests for the same data.

Q: How to re-render the component

A component re-renders when its state changes (via useState setter), when its parent re-renders and passes new props, or when a context it consumes updates. You can force a re-render with a dummy state update like const [, forceUpdate] = useReducer(x => x + 1, 0). Avoid unnecessary re-renders by memoizing with React.memo, useMemo, and useCallback.

Use Case: Forcing a chart component to re-draw after data updates from a WebSocket. Real-Time Example: A stock trading app receives price updates via WebSocket, updates a Zustand store, and the chart component re-renders because its subscribed store slice changed.

Q: Gradle Clean

cd android && ./gradlew clean deletes the Android build output directory (android/app/build). This forces a full rebuild on the next run, resolving issues caused by stale compiled code, cached resources, or corrupted build artifacts. Run it when builds fail with cryptic errors or after changing native dependencies.

Use Case: Fixing a build failure after upgrading a native Android library that changed its resource structure. Real-Time Example: After upgrading react-native-maps, the Android build fails with a duplicate resource error. Running ./gradlew clean and rebuilding resolves it.

Q: Pod Clean

cd ios && pod deintegrate && pod install removes all CocoaPods integration and reinstalls pods from scratch. A simpler clean is deleting ios/Pods and ios/Podfile.lock then running pod install. This fixes issues from corrupted pod caches, version conflicts, or stale native dependencies on iOS.

Use Case: Resolving build errors after adding a new native iOS library that conflicts with an existing pod version. Real-Time Example: After adding react-native-vision-camera, the iOS build fails due to a duplicate symbol. Cleaning pods and reinstalling resolves the version conflict.

Q: Debug RN App

Use Flipper for network inspection, layout debugging, and logs. React DevTools inspects component trees and state. Shake the device or press Cmd+D (iOS simulator) / Cmd+M (Android emulator) to open the debug menu. Use console.log for quick checks and Reactotron for more structured debugging. For native crashes, use Xcode (iOS) and Android Studio (Android) debuggers.

Use Case: Tracking down why an API call succeeds in Postman but fails in the app. Real-Time Example: Using Flipper's network inspector reveals the app is sending an expired auth token in the header because the token refresh interceptor has a race condition.

Q: ScrollView vs FlatList vs ListView (Key Features)

ScrollView renders all children at once and works for small, static content. FlatList virtualizes its items, rendering only what is visible on screen, making it suitable for long dynamic lists. ListView is deprecated and should not be used. The key difference is memory: ScrollView with 1000 items keeps all in memory, FlatList keeps only a window.

Use Case: Choosing the right list component for a chat screen with thousands of messages. Real-Time Example: A messaging app uses FlatList with inverted prop to show the newest messages at the bottom, efficiently rendering only the visible messages.

Q: How to re-render a FlatList

FlatList uses shallow comparison on the data prop to decide if it should re-render. Pass a new array reference (not mutate the existing one). Use the extraData prop to tell FlatList about additional data it should watch for changes. If an item updates, create a new array with the updated item so the reference changes.

Use Case: Updating a single item's "liked" status in a feed without re-creating the entire data array. Real-Time Example: User likes a post: update the item in state with a new object spread, FlatList sees the new array reference and re-renders only the changed row (if using React.memo).

Q: SafeAreaView

SafeAreaView ensures content renders within the safe area boundaries of a device, avoiding the notch, status bar, home indicator, and rounded corners. The built-in SafeAreaView works only on iOS. Use react-native-safe-area-context for cross-platform support with the useSafeAreaInsets hook that gives exact pixel values for top, bottom, left, and right insets.

Use Case: Preventing header text from rendering behind the iPhone notch or the Android status bar. Real-Time Example: A custom header component uses useSafeAreaInsets().top to add the exact padding needed, working correctly on every device from iPhone SE to Pixel Fold.

Q: GeoLocation

Use react-native-geolocation-service or Expo Location to get the device's GPS coordinates. You must request location permissions (ACCESS_FINE_LOCATION on Android, NSLocationWhenInUseUsageDescription on iOS) before accessing location. Foreground location works for most apps. Background location requires additional permissions and careful battery management.

Use Case: Building a ride-sharing app that shows nearby drivers on a map. Real-Time Example: A delivery app uses watchPosition to stream the driver's location every 5 seconds and updates a Firebase Realtime Database so the customer sees live tracking.

Q: KeyboardAvoidingView

KeyboardAvoidingView adjusts its height or position when the software keyboard opens so input fields remain visible. It accepts a behavior prop: use padding on iOS and height on Android (or just padding with react-native-keyboard-aware-scroll-view for consistency). Without it, the keyboard covers bottom-positioned inputs and the user cannot see what they are typing.

Use Case: A chat screen where the message input at the bottom must stay visible when the keyboard opens. Real-Time Example: WhatsApp-style chat: the input bar pushes up with the keyboard, the message list scrolls to the latest message, and the user can type and see their text.

Q: Image Picker

Use react-native-image-picker or expo-image-picker to let users select photos from their gallery or take new ones with the camera. Both return the image URI, file size, and dimensions. You need camera and photo library permissions on both platforms. For cropping, pair it with react-native-image-crop-picker.

Use Case: Letting users upload a profile picture from their gallery or take a new photo. Real-Time Example: A social app shows a bottom sheet with "Take Photo" and "Choose from Library" options, launches the appropriate picker, crops to a circle, and uploads to S3.

Q: Icons: How to run on iOS

react-native-vector-icons requires linking native assets. On iOS, you must add the font files to your Xcode project and list them in Info.plist under UIAppFonts. Run pod install after linking. If icons show as blank squares, the fonts are not loaded. For Expo projects, use @expo/vector-icons which bundles the fonts automatically.

Use Case: Adding Material Design or FontAwesome icons throughout an app without using image files. Real-Time Example: A settings screen uses MaterialCommunityIcons for each menu item (account, notifications, privacy) with consistent sizing and color from the theme.

Q: Write different code for iOS and Android in the same codebase

Use Platform.OS === 'ios' or Platform.select({ ios: value, android: value }) for small inline differences. For larger divergence, create Component.ios.js and Component.android.js files and import Component: the bundler resolves the right file per platform. You can also use Platform.Version to target specific OS versions.

Use Case: Showing a date picker that uses the native iOS wheel picker and the Android Material date picker. Real-Time Example: DatePicker.ios.js wraps @react-native-community/datetimepicker with a modal spinner, while DatePicker.android.js uses the same library's dialog mode.

Q: Button vs TouchableWithoutFeedback

The built-in Button component is a simple, styled native button with limited customization. TouchableWithoutFeedback provides no visual feedback on press and is rarely the right choice. Use Pressable (the modern replacement) for full control over press states, or TouchableOpacity for a quick opacity effect. Pressable supports pressed state styling via a function.

Use Case: Building a custom-styled card that is tappable with a subtle opacity effect. Real-Time Example: A product card uses Pressable with style={({ pressed }) => [styles.card, pressed && styles.cardPressed]} to dim slightly on touch.

Q: Storage and Token Store

Use AsyncStorage for non-sensitive data (preferences, cached state). Use react-native-keychain for sensitive data (auth tokens, passwords) because it uses iOS Keychain and Android Keystore, which are encrypted and protected by the OS. Never store tokens in AsyncStorage in production apps because the data is unencrypted and accessible on rooted/jailbroken devices.

Use Case: Storing a JWT refresh token securely so it survives app restarts. Real-Time Example: On login, the app stores the refresh token in Keychain with biometric protection enabled. On next launch, it retrieves the token with Face ID/fingerprint before calling the refresh endpoint.

Q: Permissions

Use react-native-permissions or Expo Permissions to request runtime permissions (camera, location, microphone, contacts). Always check permission status before requesting, and handle the "denied" and "blocked" states with user-friendly messaging. On iOS, the permission dialog shows only once; after denial, you must direct users to Settings. On Android 13+, notification permission is also a runtime request.

Use Case: An app that needs camera access for QR code scanning. Real-Time Example: Before opening the camera, the app checks permission status. If "not determined," it requests. If "denied" on iOS, it shows a modal explaining why camera access is needed with a button that opens the Settings app.

Q: Modal

React Native's built-in Modal component overlays content on top of the current screen with animation support (slide, fade). It blocks interaction with the content behind it. For more control, use react-native-modal which adds swipe-to-dismiss, backdrop press handling, and custom animations. Modals live outside the normal navigation stack.

Use Case: Showing a confirmation dialog before a destructive action like deleting an account. Real-Time Example: User taps "Delete Account," a modal slides up asking "Are you sure?" with Cancel and Delete buttons. Pressing outside the modal dismisses it.

Q: Activity Indicators

ActivityIndicator is a built-in component that shows a platform-native spinner (iOS spinning wheel, Android Material circle). Use it for loading states during API calls, screen transitions, or heavy computations. For custom loading animations, use Lottie (lottie-react-native) with a JSON animation file from LottieFiles.

Use Case: Showing a loading state while fetching data after the user pulls to refresh. Real-Time Example: A feed screen shows a small ActivityIndicator at the top during pull-to-refresh and a full-screen Lottie animation on first load.

Q: Timers in RN

React Native supports setTimeout, setInterval, requestAnimationFrame, and setImmediate. These run on the JS thread. Long-running timers can be unreliable if the app goes to background because the OS may throttle or kill the JS thread. Use react-native-background-timer for timers that must fire in the background. Always clear timers in useEffect cleanup to avoid memory leaks.

Use Case: Implementing a countdown timer for an OTP verification screen. Real-Time Example: An OTP screen starts a 60-second countdown with setInterval. The cleanup function in useEffect clears the interval when the user navigates away or the component unmounts.

Q: Ref in React Native

useRef creates a mutable reference that persists across renders without causing re-renders when updated. It is commonly used to access native component methods (like scrollTo on a ScrollView or focus on a TextInput), store previous values, or hold timer IDs. Refs are the escape hatch from React's declarative model when you need imperative access.

Use Case: Programmatically scrolling a FlatList to the top when the user taps the tab bar icon. Real-Time Example: A chat app holds a FlatList ref and calls flatListRef.current.scrollToEnd() whenever a new message arrives.

Q: Authentication

Authentication in React Native typically involves storing tokens (JWT or session), intercepting API calls to attach the auth header, handling token refresh, and managing the auth state to switch between login and main app screens. Use a top-level auth context or state slice that guards navigation: if no valid token, show the auth stack; otherwise, show the app stack.

Use Case: Building a secure login flow with biometric re-authentication for a fintech app. Real-Time Example: User logs in with email/password, tokens are stored in Keychain. On next launch, the app checks for a valid refresh token and prompts Face ID before restoring the session.

Q: Platform module

The Platform module provides Platform.OS (returns 'ios' or 'android'), Platform.Version (OS version number), and Platform.select (returns a value based on the current platform). It lets you write conditional logic for platform-specific behavior without creating separate files. Use it for small differences like shadow styles (iOS) vs elevation (Android).

Use Case: Applying platform-specific shadow styling to a card component. Real-Time Example: Platform.select({ ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1 }, android: { elevation: 4 } }) gives the same visual result on both platforms.

Q: Bridge in React Native (Native Modules)

The bridge was the async JSON-serialized communication layer between JS and native code. When you called a native module method from JS, the call was serialized to JSON, sent across the bridge to the native side, deserialized, executed, and the result sent back the same way. This serialization overhead was the main performance bottleneck. The New Architecture replaces the bridge with JSI for direct, synchronous calls.

Use Case: Accessing a device sensor (accelerometer) that needs high-frequency data transfer from native to JS. Real-Time Example: A fitness app reads gyroscope data 60 times per second. On the old bridge, serialization caused lag and dropped readings. With JSI/TurboModules, native code passes data directly to JS without serialization.

Q: What happens if we use a FlatList inside a ScrollView?

React Native throws a "VirtualizedList should never be nested inside plain ScrollView" warning. Both components manage their own scroll, causing conflicts: FlatList's virtualization breaks because ScrollView renders all content at once, forcing FlatList to render all items and losing its performance benefit. Use FlatList's ListHeaderComponent and ListFooterComponent to include non-list content instead of wrapping in a ScrollView.

Use Case: A screen with a banner, filters, and a product list that all scroll together. Real-Time Example: Instead of putting a FlatList inside a ScrollView, move the banner and filter bar into ListHeaderComponent of the FlatList so everything scrolls together without nesting.

Q: Deployment on Play Store and App Store

For Android: generate a signed AAB (./gradlew bundleRelease), create a Google Play Console listing, upload the AAB, fill in metadata, and submit for review. For iOS: archive the app in Xcode, upload to App Store Connect via Xcode or Transporter, fill in metadata/screenshots, and submit for review. Both stores require privacy policies, age ratings, and content descriptions.

Use Case: Releasing the first version of a B2B app to both stores with staged rollout. Real-Time Example: Upload AAB to Google Play internal testing track for QA, then promote to production at 10% rollout. Upload IPA to TestFlight for beta, then submit to App Store with phased release enabled.

Q: Google Maps integration

Use react-native-maps with the Google Maps provider. On Android, add your Google Maps API key to AndroidManifest.xml. On iOS, add it to AppDelegate.m and configure the Google Maps pod. The library provides MapView, Marker, Polyline, Polygon, and Callout components. For directions, use the Google Directions API and draw polylines on the map.

Use Case: Building a delivery tracking screen that shows the driver's route in real time. Real-Time Example: A ride-share app renders a MapView with a driver Marker that moves along a Polyline (drawn from Directions API) and updates every 3 seconds from a WebSocket.

Q: How to show drawer tab, bottom tab and top tab in one screen

Nest navigators: create a Drawer navigator at the root, put a Bottom Tab navigator inside one of the drawer screens, and put a Top Tab navigator inside one of the bottom tab screens. Each navigator manages its own layer of navigation. The key is getting the nesting order right and hiding headers where needed to avoid double headers.

Use Case: A content-heavy app like YouTube that needs a drawer menu, bottom tabs for main sections, and top tabs for subcategories. Real-Time Example: Drawer (Settings, Profile) wraps Bottom Tabs (Home, Explore, Library). The Home tab contains a Top Tab navigator with "For You," "Trending," and "Subscriptions" tabs.

Q: How to integrate different SDK and make own library (Bluetooth, WiFi hardware)

Create a native module (or TurboModule) that wraps the hardware SDK's native API. Write the Kotlin/Java (Android) and Swift/Obj-C (iOS) code that calls the SDK methods, then expose those methods to JS via the React Native module system. Package it as a standalone npm library using create-react-native-library with a proper native build setup. Test on real devices because hardware SDKs do not work on simulators.

Use Case: Connecting a React Native app to a Bluetooth blood pressure monitor using a manufacturer's SDK. Real-Time Example: A health app wraps the Omron BLE SDK in a native module that exposes startScan(), connect(deviceId), and readMeasurement() to JS, with event emitters for real-time readings.

Q: OpenAI integration in React Native

Call the OpenAI API from your backend, not directly from the mobile app, to keep your API key secure. The React Native app sends user input to your server, which forwards it to OpenAI's Chat Completions or Assistants API, and streams the response back. For streaming, use Server-Sent Events or WebSocket from the app to your server. Never embed the OpenAI API key in client-side code.

Use Case: Adding an AI chatbot assistant inside a customer support section of a mobile app. Real-Time Example: A travel app has an "Ask AI" feature where users type questions about destinations. The app sends the query to a Node.js backend that calls OpenAI's API and streams the response token by token to the app.

Q: What is a Memory Leak in React Native?

A memory leak occurs when the app holds references to objects that are no longer needed, preventing garbage collection. Common causes in RN: un-cleared timers, event listeners not removed in useEffect cleanup, closures referencing unmounted component state, and retained navigation screen instances. Symptoms include increasing RAM usage, slower performance over time, and eventual crashes.

Use Case: Diagnosing why an app becomes sluggish after navigating between screens 50+ times. Real-Time Example: A chat screen subscribes to a WebSocket on mount but never unsubscribes on unmount. Each visit creates a new subscription, and all previous ones keep processing messages in the background.

Q: What is Babel?

Babel is a JavaScript compiler that transforms modern JS/JSX syntax into code that older JavaScript engines can execute. In React Native, Metro uses Babel to transform your source code: JSX becomes React.createElement calls, optional chaining becomes ternary checks, and modern syntax is downleveled. The Babel config lives in babel.config.js and can be extended with plugins like react-native-reanimated/plugin.

Use Case: Using the latest JavaScript features (nullish coalescing, optional chaining) in a React Native project targeting older Android devices. Real-Time Example: You write const name = user?.profile?.name ?? 'Guest' and Babel transforms it into nested ternary checks that Hermes or JSC can execute on any supported device.

Q: What is APNs (Apple Push Notification service)?

APNs is Apple's cloud service that delivers push notifications to iOS, iPadOS, macOS, and watchOS devices. Your backend sends a notification payload (title, body, badge, sound) to APNs with the device token. APNs handles delivery, including when the device is offline (it stores the last notification). You need a valid APNs certificate or key from your Apple Developer account.

Use Case: Sending real-time order status updates to iOS users of a food delivery app. Real-Time Example: When a restaurant marks an order as "ready for pickup," the backend sends a push via APNs with the order details, and the user's iPhone shows a notification even if the app is closed.

Q: useSharedValue (Reanimated)

useSharedValue from Reanimated creates a value that lives on the UI thread and can be read/written from both JS and UI thread worklets. Unlike React state, updating a shared value does not trigger a React re-render. Use it with useAnimatedStyle to drive animations at 60fps. The value persists across renders and updates are synchronous on the UI thread.

Use Case: Creating a smooth drag-to-dismiss gesture where the card position tracks the finger without any JS thread involvement. Real-Time Example: A bottom sheet uses useSharedValue for its translateY. A gesture handler updates the shared value on every frame, and useAnimatedStyle applies the transform, all running on the UI thread.

Q: How to use app on multiple environments (change baseUrl)

Use react-native-config to load environment variables from .env.development, .env.staging, and .env.production files. Each file sets API_BASE_URL to the correct server. On Android, select the environment via product flavors. On iOS, use different Xcode schemes. The env file is baked into the build at compile time, so switching environments requires a rebuild.

Use Case: Running the same app against local, staging, and production APIs during different phases of development. Real-Time Example: .env.staging sets API_BASE_URL=https://api-staging.myapp.com. The developer builds with ENVFILE=.env.staging react-native run-android and the app connects to the staging server.

Q: What is a Scheme in React Native?

A scheme is a URL prefix (like myapp://) that the OS associates with your app. When a link with your scheme is opened, the OS launches your app and passes the URL. On iOS, schemes are defined in Info.plist. On Android, they are declared as intent filters in AndroidManifest.xml. Universal links (https:// URLs) require additional server-side configuration but are more reliable than custom schemes.

Use Case: Opening a specific screen in the app when a user taps a link in an email. Real-Time Example: A password reset email contains myapp://reset-password?token=abc123. Tapping it opens the app directly to the reset password screen with the token pre-filled.

Q: Previous React Native architecture vs latest architecture

The old architecture used the Bridge: an async, JSON-serialized message queue between JS and native. Three separate threads (JS, UI, Shadow) communicated only through this bridge, creating bottleneck and lag. The new architecture uses JSI for direct synchronous calls, Fabric for concurrent rendering with C++ shadow nodes, and TurboModules for lazy-loaded native modules. The result is lower latency, better type safety through codegen, and support for concurrent React features.

Use Case: Deciding whether to migrate a large production app from old architecture to new architecture. Real-Time Example: A streaming app with complex gesture-driven UI (swipe cards, pinch-to-zoom) migrates to Fabric to eliminate bridge serialization lag during gesture handling, cutting dropped frames from 15% to under 1%.

Q: TurboModules

TurboModules are the new architecture's replacement for legacy native modules. You write a TypeScript spec that defines the module's interface, and codegen generates C++ type-safe bindings. TurboModules are lazily loaded (initialized only when first accessed, not at app startup), use JSI for direct synchronous calls, and support synchronous return values. This reduces startup time and eliminates bridge serialization.

Use Case: Creating a high-performance native module for image processing that needs synchronous return values. Real-Time Example: An image editing app uses a TurboModule to call native image filters. The JS code calls ImageFilter.applyBlur(imageUri, radius) and gets the result URI back synchronously, no bridge roundtrip needed.

Q: Life cycle methods in React Native

In functional components (the standard), lifecycle is handled by hooks. useEffect(() => {}, []) runs on mount (like componentDidMount). useEffect(() => { return cleanup }, [dep]) runs on dependency change and cleanup runs before the next effect or on unmount (like componentDidUpdate and componentWillUnmount). useLayoutEffect runs synchronously after DOM mutations but before paint. In class components, the full lifecycle exists: constructor, componentDidMount, shouldComponentUpdate, componentDidUpdate, componentWillUnmount.

Use Case: Setting up a WebSocket connection when a chat screen mounts and cleaning it up when the user leaves. Real-Time Example: useEffect(() => { const ws = new WebSocket(url); ws.onmessage = handleMessage; return () => ws.close(); }, []) connects on mount and disconnects on unmount, preventing memory leaks.

Contact