
React Native is a powerful framework for building cross-platform mobile applications using JavaScript and React. Stark.ai offers a curated collection of React Native interview questions, real-world scenarios, and expert guidance to help you excel in your next technical interview.
The bridge is the communication layer between JavaScript and native code. It serializes data and handles...
React Native provides Platform.select(), platform-specific file extensions (.ios.js/.android.js), Platform.OS...
Native modules expose platform-specific APIs to JavaScript through the bridge. They're used when requiring direct...
The Shadow Thread handles layout calculations using Yoga (Facebook's cross-platform layout engine). It processes...
iOS uses JavaScriptCore (JSC) by default, while Android can use either JSC or Hermes. Hermes is Facebook's custom JS...
Linking handles deep linking and URL scheme integration in React Native apps. It provides methods to open external...
React Native provides APIs to request and check platform permissions (camera, location, etc.). These are handled...
metro.config.js customizes the Metro bundler's behavior, including module resolution, asset handling, and...
Assets are handled through the Metro bundler, which can process images, fonts, and other resources....
Component composition involves building larger components from smaller ones using props.children, render props, and...
Refs provide a way to access DOM nodes or React elements directly. They should be used sparingly for cases like...
FlatList performance can be optimized by: 1) Using getItemLayout to avoid measurement of items, 2) Implementing...
Controlled components have their state managed by React through props and callbacks (e.g., value and onChangeText)....
Modern React Native uses hooks like useEffect for lifecycle management. useEffect replaces componentDidMount,...
PureComponent implements shouldComponentUpdate with a shallow prop and state comparison. It's used to optimize...
Prop validation is handled using PropTypes or TypeScript. PropTypes provide runtime checking of prop types, while...
HOCs are functions that take a component and return a new component with additional props or behavior. They're used...
Modal dialogs can be implemented using the Modal component or third-party libraries. Considerations include proper...
Render props are a pattern where a component receives a function prop that returns React elements. Unlike HOCs,...
Redux implements a unidirectional data flow with a single store holding the application state. Actions describe...
Redux Toolkit is the official toolset for Redux development. It simplifies store setup, reduces boilerplate through...
State persistence involves: 1) Using AsyncStorage or similar storage solutions, 2) Implementing redux-persist for...
MobX offers simpler setup than Redux, automatic tracking of state dependencies, and more flexibility in state...
Real-time updates can be handled through: 1) WebSocket connections with state synchronization, 2) Push notifications...
Custom hooks are JavaScript functions that use React hooks to encapsulate reusable state logic. They help abstract...
Form validation state involves: 1) Tracking input values and errors, 2) Implementing validation rules and error...
Middleware intercepts actions before they reach reducers, enabling side effects, async operations, logging, and...
Context optimization includes: 1) Split contexts by functionality, 2) Memoize context values, 3) Use context...
Complex state patterns include: 1) State machines with XState, 2) Command pattern for actions, 3) Observable pattern...
Nested navigation involves placing one navigator inside another (e.g., tab navigator inside stack navigator). Each...
Navigation state can be persisted using persistNavigationState and loadNavigationState props on NavigationContainer....
Authentication flows typically use conditional navigation based on auth state, often implementing stack switching or...
Navigation events (focus, blur, beforeRemove, state) can be listened to using addListener. They're useful for...
Custom animations can be implemented using cardStyleInterpolator for stack navigator or custom transition...
Navigation middlewares intercept and modify navigation actions before they're processed. They're useful for logging,...
Deep linking with parameters requires proper linking configuration with parameter extraction from URLs, parameter...
Navigation performance optimization includes: 1) Screen preloading, 2) Lazy loading screens, 3) Minimizing...
Navigation testing involves mocking navigation props, simulating navigation actions, testing deep linking handling,...
Linking configuration defines URL pattern matching for deep links, including parameter extraction and screen...
FlatList optimization includes: 1) Using getItemLayout to avoid measurement, 2) Implementing proper key extraction,...
Bridge traffic can be reduced by: 1) Batching updates, 2) Minimizing state updates, 3) Using native modules for...
Efficient animations involve: 1) Using native driver when possible, 2) Implementing proper interpolation, 3) Using...
Memory management includes: 1) Proper cleanup in useEffect, 2) Removing event listeners, 3) Clearing timeouts and...
Network optimization includes: 1) Implementing proper caching, 2) Using request batching, 3) Implementing retry...
Dependencies impact includes: 1) Bundle size increase, 2) Startup time effects, 3) Runtime performance overhead, 4)...
Efficient state management involves: 1) Proper state structure, 2) Minimizing state updates, 3) Using appropriate...
Startup optimization includes: 1) Using Hermes engine, 2) Implementing proper code splitting, 3) Optimizing native...
Layout optimization includes: 1) Using LayoutAnimation properly, 2) Minimizing layout depth, 3) Implementing proper...
Profiling techniques include: 1) Using React DevTools, 2) Implementing performance monitoring, 3) Using native...
Native modules require separate implementations in Swift/Objective-C for iOS and Java/Kotlin for Android. This...
iOS typically uses edge swipe gestures and navbar buttons, while Android uses the back button and different...
Animation implementations may need platform-specific tuning for timing, easing, and performance. Native drivers...
Debugging tools and processes differ between platforms. iOS uses Xcode debugging tools while Android uses Android...
Push notifications require different setup and handling for APNs (iOS) and FCM (Android). This includes different...
App lifecycle events and background handling differ between iOS and Android. This includes different background...
Storage mechanisms like AsyncStorage have platform-specific implementations and limitations. Secure storage, file...
Performance optimization requires platform-specific approaches for memory management, UI rendering, and native...
Network security configuration differs between platforms, including SSL pinning, network permissions, and security...
Biometric authentication requires different implementations for Touch ID/Face ID (iOS) and Fingerprint/Face Unlock...
Custom fonts require platform-specific setup: iOS needs font files added to the Xcode project and Info.plist,...
Dynamic styling can be implemented using style arrays, conditional styles in objects, or dynamic style generation...
Orientation changes require responsive layouts using flex, Dimensions API updates handling, and potentially...
Shadows require different implementations: iOS uses shadow* properties, Android uses elevation. Platform-specific...
KeyboardAvoidingView component with appropriate behavior prop ('height', 'position', 'padding') handles keyboard...
Grid layouts can be implemented using FlatList with numColumns, flexbox with flex-wrap, or custom grid components....
RTL support requires proper use of start/end instead of left/right, handling text alignment, and considering layout...
Screen density handling involves using density-independent pixels, proper image asset management (including @2x,...
Animated layouts use LayoutAnimation or Animated API. LayoutAnimation provides simple animations for layout changes....
Style performance considerations include using StyleSheet.create, avoiding inline styles, minimizing style...
API caching can be implemented using in-memory caching, AsyncStorage, or specialized caching libraries. Consider...
Offline sync requires local storage of data, queue management for offline actions, conflict resolution strategies,...
File uploads require proper multipart/form-data handling, progress tracking, chunked uploads for large files, and...
Request cancellation can be implemented using AbortController with fetch, or cancelToken with Axios. Important for...
Rate limiting requires implementing request queuing, proper error handling for rate limit responses, exponential...
WebSockets provide real-time bidirectional communication. Implementation involves socket connection management,...
API versioning strategies include URL versioning, header versioning, or content negotiation. Apps should handle...
Security considerations include SSL/TLS, token management, certificate pinning, request/response encryption, and...
Response compression involves proper handling of Content-Encoding headers, decompression of gzipped responses, and...
Request batching involves combining multiple requests into single requests, implementing proper request queuing, and...
The bridge is the communication layer between JavaScript and native code. It serializes data and handles asynchronous communication between JS and native threads. All native module calls and UI updates pass through the bridge, which can impact performance with heavy data transfers.
React Native provides Platform.select(), platform-specific file extensions (.ios.js/.android.js), Platform.OS checks, and platform-specific components. These methods allow writing platform-specific logic while maintaining a shared codebase.
Native modules expose platform-specific APIs to JavaScript through the bridge. They're used when requiring direct access to platform APIs, implementing performance-critical features, or integrating third-party SDKs that don't have React Native implementations.
The Shadow Thread handles layout calculations using Yoga (Facebook's cross-platform layout engine). It processes flex layouts and converts them to native layouts, running separately from the main thread to ensure smooth UI performance.
iOS uses JavaScriptCore (JSC) by default, while Android can use either JSC or Hermes. Hermes is Facebook's custom JS engine optimized for React Native, offering better performance, reduced memory usage, and faster startup times.
Linking handles deep linking and URL scheme integration in React Native apps. It provides methods to open external links and handle incoming deep links, enabling integration with other apps and web content.
React Native provides APIs to request and check platform permissions (camera, location, etc.). These are handled through native modules and require configuration in platform-specific files (AndroidManifest.xml, Info.plist).
metro.config.js customizes the Metro bundler's behavior, including module resolution, asset handling, and transformation settings. It can be modified to support different file types, customize bundling, and optimize build performance.
Assets are handled through the Metro bundler, which can process images, fonts, and other resources. Platform-specific asset selection is supported through asset suffixes, and the require syntax is used for static asset references.
Component composition involves building larger components from smaller ones using props.children, render props, and higher-order components. This promotes code reuse, maintainability, and separation of concerns in the application architecture.
Refs provide a way to access DOM nodes or React elements directly. They should be used sparingly for cases like managing focus, text selection, animations, or integrating with third-party libraries. Refs should not be used for tasks that can be handled through props and state.
FlatList performance can be optimized by: 1) Using getItemLayout to avoid measurement of items, 2) Implementing windowSize and maxToRenderPerBatch, 3) Using removeClippedSubviews, 4) Implementing proper key extraction, and 5) Optimizing renderItem function with memo or PureComponent.
Controlled components have their state managed by React through props and callbacks (e.g., value and onChangeText). Uncontrolled components maintain their own internal state. Controlled components provide more predictable behavior but require more setup.
Modern React Native uses hooks like useEffect for lifecycle management. useEffect replaces componentDidMount, componentDidUpdate, and componentWillUnmount. The dependency array controls when effects run, and cleanup functions handle teardown.
PureComponent implements shouldComponentUpdate with a shallow prop and state comparison. It's used to optimize performance by preventing unnecessary renders when props or state haven't changed. Should be used for components with simple props/state structures.
Prop validation is handled using PropTypes or TypeScript. PropTypes provide runtime checking of prop types, while TypeScript offers compile-time type checking. Both help catch bugs early and improve code documentation.
HOCs are functions that take a component and return a new component with additional props or behavior. They're used for code reuse, adding functionality like authentication, logging, or data fetching. HOCs follow the principle of composition over inheritance.
Modal dialogs can be implemented using the Modal component or third-party libraries. Considerations include proper animation handling, backdrop press handling, accessibility, and platform-specific behaviors like hardware back button on Android.
Render props are a pattern where a component receives a function prop that returns React elements. Unlike HOCs, render props provide more flexibility in composing behavior and avoid naming collisions. They're useful for sharing stateful logic between components.
Redux implements a unidirectional data flow with a single store holding the application state. Actions describe state changes, reducers specify how actions transform state, and components connect to the store using hooks or HOCs. Middleware handles side effects.
Redux Toolkit is the official toolset for Redux development. It simplifies store setup, reduces boilerplate through createSlice, handles immutable updates with Immer, and includes RTK Query for data fetching. It provides utilities for common Redux patterns.
State persistence involves: 1) Using AsyncStorage or similar storage solutions, 2) Implementing redux-persist for Redux state, 3) Handling storage serialization/deserialization, 4) Managing storage versioning, 5) Implementing proper error handling and fallbacks.
MobX offers simpler setup than Redux, automatic tracking of state dependencies, and more flexibility in state structure. Drawbacks include potential overuse of observables, harder debugging due to automatic updates, and less predictable state changes.
Real-time updates can be handled through: 1) WebSocket connections with state synchronization, 2) Push notifications with state updates, 3) Polling with proper state merging, 4) Optimistic updates with rollback handling.
Custom hooks are JavaScript functions that use React hooks to encapsulate reusable state logic. They help abstract complex state management, share stateful logic between components, and improve code organization and reusability.
Form validation state involves: 1) Tracking input values and errors, 2) Implementing validation rules and error messages, 3) Managing submission state, 4) Handling async validation, 5) Coordinating multiple form fields' validation state.
Middleware intercepts actions before they reach reducers, enabling side effects, async operations, logging, and routing. Common middleware includes redux-thunk for async actions, redux-saga for complex workflows, and custom middleware for specific needs.
Context optimization includes: 1) Split contexts by functionality, 2) Memoize context values, 3) Use context selectors to prevent unnecessary rerenders, 4) Implement context providers at appropriate levels, 5) Consider alternative solutions for frequently changing values.
Complex state patterns include: 1) State machines with XState, 2) Command pattern for actions, 3) Observable pattern for state streams, 4) Reducer composition for modular state logic, 5) Event sourcing for state history.
FlatList optimization includes: 1) Using getItemLayout to avoid measurement, 2) Implementing proper key extraction, 3) Using removeClippedSubviews, 4) Optimizing renderItem with memo, 5) Adjusting windowSize and maxToRenderPerBatch, 6) Implementing proper item height calculations.
Bridge traffic can be reduced by: 1) Batching updates, 2) Minimizing state updates, 3) Using native modules for heavy computations, 4) Implementing proper data serialization, 5) Using Hermes engine, 6) Optimizing image loading and processing.
Efficient animations involve: 1) Using native driver when possible, 2) Implementing proper interpolation, 3) Using layoutAnimation for simple layouts, 4) Optimizing gesture handling, 5) Managing animation memory usage, 6) Using proper timing functions.
Memory management includes: 1) Proper cleanup in useEffect, 2) Removing event listeners, 3) Clearing timeouts and intervals, 4) Implementing proper image caching, 5) Managing large data structures, 6) Monitoring memory leaks.
Network optimization includes: 1) Implementing proper caching, 2) Using request batching, 3) Implementing retry logic, 4) Optimizing payload size, 5) Using proper compression, 6) Implementing offline support, 7) Managing concurrent requests.
Dependencies impact includes: 1) Bundle size increase, 2) Startup time effects, 3) Runtime performance overhead, 4) Memory usage implications, 5) Bridge traffic increase. Proper dependency management and auditing is crucial.
Efficient state management involves: 1) Proper state structure, 2) Minimizing state updates, 3) Using appropriate state management tools, 4) Implementing proper memoization, 5) Managing state persistence efficiently.
Startup optimization includes: 1) Using Hermes engine, 2) Implementing proper code splitting, 3) Optimizing native module initialization, 4) Managing asset loading, 5) Implementing proper splash screen, 6) Reducing initial bundle size.
Layout optimization includes: 1) Using LayoutAnimation properly, 2) Minimizing layout depth, 3) Implementing proper flex layouts, 4) Managing dynamic layouts efficiently, 5) Using proper measurement techniques.
Profiling techniques include: 1) Using React DevTools, 2) Implementing performance monitoring, 3) Using native profiling tools, 4) Analyzing bridge traffic, 5) Monitoring memory usage, 6) Implementing proper logging.
Native modules require separate implementations in Swift/Objective-C for iOS and Java/Kotlin for Android. This includes proper method mapping, event handling, and data type conversion while maintaining a consistent JavaScript interface.
iOS typically uses edge swipe gestures and navbar buttons, while Android uses the back button and different navigation patterns. Navigation libraries need platform-specific configuration for proper behavior and animations.
Animation implementations may need platform-specific tuning for timing, easing, and performance. Native drivers might work differently, and some animations may need platform-specific implementations for optimal performance.
Debugging tools and processes differ between platforms. iOS uses Xcode debugging tools while Android uses Android Studio. Chrome Developer Tools work differently, and native debugging requires platform-specific approaches.
Push notifications require different setup and handling for APNs (iOS) and FCM (Android). This includes different configuration, payload structures, and handling mechanisms while maintaining a consistent app experience.
App lifecycle events and background handling differ between iOS and Android. This includes different background modes, state restoration, and process lifecycle management requiring platform-specific implementations.
Storage mechanisms like AsyncStorage have platform-specific implementations and limitations. Secure storage, file system access, and data persistence require different approaches and configurations per platform.
Performance optimization requires platform-specific approaches for memory management, UI rendering, and native module optimization. Different profiling tools and optimization techniques are needed for each platform.
Network security configuration differs between platforms, including SSL pinning, network permissions, and security policies. Different configuration files and implementation approaches are needed for each platform.
Biometric authentication requires different implementations for Touch ID/Face ID (iOS) and Fingerprint/Face Unlock (Android). This includes different APIs, security models, and user experience considerations.
Custom fonts require platform-specific setup: iOS needs font files added to the Xcode project and Info.plist, Android needs fonts in android/app/src/main/assets/fonts. React Native config needs updating, and linking may be required. Font names might differ between platforms.
Dynamic styling can be implemented using style arrays, conditional styles in objects, or dynamic style generation functions. StyleSheet.create should be used outside component render for performance. Consider memoization for complex style calculations.
Orientation changes require responsive layouts using flex, Dimensions API updates handling, and potentially different layouts for portrait/landscape. useWindowDimensions hook helps track dimensions, and specific orientation styles may be needed.
Shadows require different implementations: iOS uses shadow* properties, Android uses elevation. Platform-specific shadow styles are needed for consistent appearance. Consider using libraries for cross-platform shadow implementation.
KeyboardAvoidingView component with appropriate behavior prop ('height', 'position', 'padding') handles keyboard overlap. Platform-specific adjustments may be needed. Consider scroll view integration and input accessibility.
Grid layouts can be implemented using FlatList with numColumns, flexbox with flex-wrap, or custom grid components. Consider performance for large grids, responsive behavior, and proper item sizing calculations.
RTL support requires proper use of start/end instead of left/right, handling text alignment, and considering layout direction. Use I18nManager for RTL control, and test layouts in both directions.
Screen density handling involves using density-independent pixels, proper image asset management (including @2x, @3x), and responsive design practices. Consider platform-specific density differences and testing on various devices.
Animated layouts use LayoutAnimation or Animated API. LayoutAnimation provides simple animations for layout changes. Complex animations might require Animated API with proper measurement and layout calculation.
Style performance considerations include using StyleSheet.create, avoiding inline styles, minimizing style calculations in render, proper use of flex for layouts, and implementing efficient dynamic styling strategies.
API caching can be implemented using in-memory caching, AsyncStorage, or specialized caching libraries. Consider cache invalidation strategies, TTL (Time To Live), and proper cache updates when data changes.
Offline sync requires local storage of data, queue management for offline actions, conflict resolution strategies, and proper sync when online. Consider using libraries like WatermelonDB or implementing custom sync logic.
File uploads require proper multipart/form-data handling, progress tracking, chunked uploads for large files, and proper error handling. Consider platform-specific file access APIs and compression before upload.
Request cancellation can be implemented using AbortController with fetch, or cancelToken with Axios. Important for preventing memory leaks and unnecessary updates when components unmount or dependencies change.
Rate limiting requires implementing request queuing, proper error handling for rate limit responses, exponential backoff for retries, and tracking request counts. Consider using libraries for request throttling.
WebSockets provide real-time bidirectional communication. Implementation involves socket connection management, proper event handling, reconnection strategies, and state management for real-time data.
API versioning strategies include URL versioning, header versioning, or content negotiation. Apps should handle different API versions gracefully, possibly supporting multiple versions during transition periods.
Security considerations include SSL/TLS, token management, certificate pinning, request/response encryption, and proper error handling. Avoid storing sensitive data in plain text and implement proper authentication flows.
Response compression involves proper handling of Content-Encoding headers, decompression of gzipped responses, and optimization of data transfer. Consider implementing compression for requests when appropriate.
Request batching involves combining multiple requests into single requests, implementing proper request queuing, and handling responses efficiently. Consider trade-offs between reduced network calls and increased complexity.
Solve React Native development challenges tailored for interviews.
Explore MoreUnderstand core components, props, and state management techniques.
Learn best practices for handling animations, rendering optimizations, and memory management.
Understand how to integrate native code for platform-specific functionalities.
Familiarize yourself with React Native debugging tools and common issue resolution techniques.
Join thousands of successful candidates preparing with Stark.ai. Start practicing React Native questions, mock interviews, and more to secure your dream role.
Start Preparing now