React Native Interview Questions Your Guide to Success

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.

Back

react native

    • What is React Native and how does it differ from React?

      React Native is a framework developed by Facebook that allows developers to build native mobile applications using...

    • What are the core components in React Native?

      React Native provides several core components that map directly to native UI elements: View (container), Text (text...

    • What is the purpose of the AppRegistry?

      AppRegistry is the entry point to run a React Native application. It provides the registerComponent method used to...

    • What is the difference between Expo and React Native CLI?

      Expo provides a managed workflow with pre-built components and services, making it easier to start but with limited...

    • What is the Metro bundler and its role?

      Metro is React Native's JavaScript bundler that combines all JavaScript code and dependencies into a single file. It...

    • How does React Native handle debugging?

      React Native offers multiple debugging options: Chrome Developer Tools for JavaScript debugging, React Developer...

    • What is the purpose of package.json in React Native?

      package.json manages project dependencies, scripts, and configuration. It lists all npm packages required by the...

    • What are the main threads in a React Native application?

      React Native runs on three main threads: 1) Main Thread (Native UI), 2) JavaScript Thread (JS execution), and 3)...

    • What is the role of babel.config.js in React Native?

      babel.config.js configures Babel transpilation settings for the project. It defines how modern JavaScript features...

    • What is Hot Reloading and how does it differ from Live Reloading?

      Hot Reloading updates only the changed components while maintaining the app's state. Live Reloading refreshes the...

    • What are the two types of components in React Native?

      React Native has two types of components: 1) Class Components - ES6 classes that extend React.Component and have...

    • What are props in React Native?

      Props (properties) are read-only components that are passed from a parent component to a child component. They are...

    • What is the difference between View and Text components?

      View is a container component that works like a div in web development, used for layouting and styling. Text is...

    • What is the purpose of the SafeAreaView component?

      SafeAreaView is a component that automatically adds padding to accommodate notches, status bars, and other...

    • How do you handle touch events in React Native?

      Touch events are handled using components like TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback, and...

    • What is the difference between FlatList and ScrollView?

      FlatList is optimized for long lists of data, rendering items lazily and only what's visible on screen. ScrollView...

    • How do you pass data between components in React Native?

      Data can be passed between components using props for parent-to-child communication, callback functions for...

    • What is the purpose of the Image component?

      The Image component is used to display images in React Native. It can handle both local and remote images, supports...

    • What are style props in React Native?

      Style props are used to customize the appearance of components. They can be applied directly as props or through...

    • What is the purpose of KeyboardAvoidingView?

      KeyboardAvoidingView is a component that adjusts its height or position based on the keyboard height to prevent the...

    • What is state in React Native and how does it differ from props?

      State is a mutable data store internal to a component that determines the component's behavior and rendering. Unlike...

    • What is the useState hook and how is it used?

      useState is a React hook that adds state management to functional components. It returns an array with two elements:...

    • How do you update state in class components?

      In class components, state is updated using this.setState(). It can accept either an object with new state values or...

    • What is the difference between useState and useReducer?

      useState is simpler and good for managing independent pieces of state. useReducer is preferred for complex state...

    • What is AsyncStorage and how is it used?

      AsyncStorage is a simple, unencrypted, asynchronous, persistent, key-value storage system that is global to the app....

    • What is the Context API and when should it be used?

      Context API provides a way to pass data through the component tree without manually passing props. It's useful for...

    • How do you handle form state in React Native?

      Form state can be handled using controlled components with useState, or through form management libraries like...

    • What is the purpose of useEffect in state management?

      useEffect handles side effects in functional components, including state-related operations like data fetching,...

    • How do you share state between components?

      State can be shared between components through: 1) Lifting state up to a common ancestor, 2) Using Context API, 3)...

    • What are the common pitfalls in state management?

      Common pitfalls include: 1) Mutating state directly instead of using setState/useState, 2) Async state updates race...

    • What is React Navigation and why is it used?

      React Navigation is a popular navigation library for React Native that provides a way to navigate between screens....

    • What are the main types of navigators in React Navigation?

      The main types are: 1) Stack Navigator for basic back/forward navigation, 2) Tab Navigator for switching between...

    • How do you navigate between screens using React Navigation?

      Navigation between screens is done using the navigation prop: navigation.navigate('ScreenName') for basic...

    • What is the difference between navigate() and push()?

      navigate() moves to a screen and avoids duplicating if it's already in the stack, while push() always adds a new...

    • How do you pass parameters between screens?

      Parameters can be passed between screens using: navigation.navigate('ScreenName', { paramName: value }) and accessed...

    • What is deep linking in React Native?

      Deep linking allows apps to handle external URLs and open specific screens. It's implemented using linking...

    • How do you handle the Android back button?

      The Android back button can be handled using the useFocusEffect or useBackHandler hooks from...

    • What is the NavigationContainer component?

      NavigationContainer is the root component that manages navigation state and integrates with the device's navigation...

    • How do you customize the header in React Navigation?

      Headers can be customized using screenOptions or options props on navigators or individual screens. Options include...

    • What are navigation lifecycle events?

      Navigation lifecycle events include focus/blur (when screens gain/lose focus) and beforeRemove (before screen...

    • What is the purpose of using React.memo?

      React.memo is a higher-order component that memoizes functional components to prevent unnecessary re-renders. It...

    • What is the importance of the FlatList component for performance?

      FlatList is optimized for long lists by implementing windowing, which only renders items currently visible on...

    • How does the React Native bridge affect performance?

      The bridge serializes data between JavaScript and native code, which can impact performance when sending large...

    • What is the role of Hermes in React Native performance?

      Hermes is a JavaScript engine optimized for React Native that improves start-up time, reduces memory usage, and...

    • How can you optimize image loading in React Native?

      Image optimization includes using proper image sizes, implementing lazy loading, caching images, using FastImage...

    • What is the importance of useCallback in performance optimization?

      useCallback memoizes functions to prevent unnecessary recreation between renders. It's particularly useful when...

    • How does console.log affect performance in production?

      console.log statements can significantly impact performance in production by creating unnecessary bridge traffic....

    • What is the purpose of useMemo?

      useMemo memoizes computed values to prevent expensive recalculations on every render. It's useful for optimizing...

    • How can you reduce app bundle size?

      Bundle size can be reduced by removing unused dependencies, implementing code splitting, using ProGuard/R8 for...

    • What are the benefits of using PureComponent?

      PureComponent implements shouldComponentUpdate with a shallow prop and state comparison, preventing unnecessary...

    • What is Platform.select() and how is it used?

      Platform.select() is a React Native utility that returns platform-specific values. It accepts an object with 'ios',...

    • How do you create platform-specific file extensions?

      React Native automatically picks platform-specific files using extensions like .ios.js or .android.js. For example,...

    • What is the purpose of the Platform.OS property?

      Platform.OS is a string that identifies the current operating system ('ios' or 'android'). It's used for conditional...

    • How do you handle platform-specific styles?

      Platform-specific styles can be handled using Platform.select(), platform-specific style files, or conditional style...

    • What are platform-specific components in React Native?

      React Native provides platform-specific components like DatePickerIOS and ProgressViewIOS for iOS, or...

    • How do you handle platform-specific permissions?

      Platform permissions are handled differently in iOS (Info.plist) and Android (AndroidManifest.xml). React Native...

    • What is the difference between Android's back button and iOS's back gesture?

      Android's back button is hardware/software-based and requires explicit handling using BackHandler, while iOS's back...

    • How do you handle platform-specific fonts?

      Font handling differs between platforms in naming conventions and loading mechanisms. iOS uses the font name, while...

    • What are the key differences in layout between iOS and Android?

      Layout differences include status bar height, navigation bar presence, safe areas (iOS), and default spacing...

    • How do you handle platform-specific gestures?

      Gestures can differ between platforms in behavior and implementation. iOS often uses swipe gestures for navigation,...

    • What is StyleSheet in React Native and why should you use it?

      StyleSheet is a React Native API for creating and managing styles. It provides performance optimizations by...

    • How does Flexbox work in React Native?

      React Native uses Flexbox for layout but with some differences from web. The default flexDirection is 'column'...

    • What are the differences between React Native styling and CSS?

      React Native styling uses JavaScript objects with camelCase properties instead of CSS syntax. There's no inheritance...

    • How do you handle dimensions in React Native?

      Dimensions can be handled using fixed numbers (density-independent pixels), percentages, or the Dimensions API. The...

    • What is the purpose of the SafeAreaView component?

      SafeAreaView is used to handle safe area insets (notches, status bars) on iOS devices. It automatically adds padding...

    • How do you create responsive layouts in React Native?

      Responsive layouts are created using flexbox, percentage values, the Dimensions API, and useWindowDimensions hook....

    • What are style arrays in React Native?

      Style arrays allow multiple styles to be applied to a component: [styles.container, styles.modified]. Later styles...

    • How do you handle text styling in React Native?

      Text styling in React Native is not inherited by default. Each Text component needs its own style. Text-specific...

    • What is the difference between width/height and flex in layouts?

      Width and height set fixed dimensions, while flex determines how components grow/shrink within available space. Flex...

    • How do you handle image sizing and scaling?

      Images can be sized using width/height properties or resizeMode prop ('contain', 'cover', 'stretch', 'center'). For...

    • How do you make API calls in React Native?

      API calls in React Native can be made using the Fetch API or Axios library. The Fetch API is built into React Native...

    • What is the useEffect hook's role in API calls?

      useEffect is commonly used for making API calls when a component mounts or when dependencies change. It helps manage...

    • How do you handle API error states?

      API errors should be caught using try/catch blocks or .catch() for promises. Error states should be stored in...

    • What is the difference between GET and POST requests?

      GET requests retrieve data and include parameters in the URL query string. POST requests send data in the request...

    • How do you handle loading states during API calls?

      Loading states should be managed in component state (e.g., isLoading boolean). Show loading indicators while data is...

    • What is JSON and how is it used in API integration?

      JSON (JavaScript Object Notation) is a data format used for API requests/responses. React Native can parse JSON...

    • How do you set headers in API requests?

      Headers can be set using the headers object in fetch options or Axios config. Common headers include Authorization...

    • What is REST and why is it important?

      REST (Representational State Transfer) is an architectural style for APIs using HTTP methods (GET, POST, PUT,...

    • How do you handle API authentication?

      API authentication typically involves sending tokens in request headers, often using JWT (JSON Web Tokens). Tokens...

    • What are query parameters and how are they used?

      Query parameters are key-value pairs added to URLs for filtering, sorting, or pagination. They're commonly used in...

What is React Native and how does it differ from React?

React Native is a framework developed by Facebook that allows developers to build native mobile applications using JavaScript and React. Unlike React which creates a virtual DOM for browser rendering, React Native creates actual native UI components that are rendered on mobile devices. This means React Native apps have native performance while still allowing cross-platform development using a single codebase.

What are the core components in React Native?

React Native provides several core components that map directly to native UI elements: View (container), Text (text display), Image (image display), ScrollView (scrollable container), TextInput (text input field), TouchableOpacity/TouchableHighlight (touchable elements), and FlatList/SectionList (optimized scrollable lists).

What is the purpose of the AppRegistry?

AppRegistry is the entry point to run a React Native application. It provides the registerComponent method used to register the root component of the application. This registration tells React Native which component to render when the application starts, similar to ReactDOM.render in web applications.

What is the difference between Expo and React Native CLI?

Expo provides a managed workflow with pre-built components and services, making it easier to start but with limited native module access. React Native CLI offers a bare workflow with full native code access but requires more setup and native development knowledge.

What is the Metro bundler and its role?

Metro is React Native's JavaScript bundler that combines all JavaScript code and dependencies into a single file. It handles transpilation, asset management, and provides hot reloading during development. It's optimized specifically for React Native's mobile environment needs.

How does React Native handle debugging?

React Native offers multiple debugging options: Chrome Developer Tools for JavaScript debugging, React Developer Tools for component inspection, built-in Debug menu on devices, and console logging. It also supports remote debugging and various third-party debugging tools.

What is the purpose of package.json in React Native?

package.json manages project dependencies, scripts, and configuration. It lists all npm packages required by the project, defines scripts for development and building, and contains metadata about the project including name, version, and license information.

What are the main threads in a React Native application?

React Native runs on three main threads: 1) Main Thread (Native UI), 2) JavaScript Thread (JS execution), and 3) Shadow Thread (layout calculations). These threads work together through the bridge to create the native application experience.

What is the role of babel.config.js in React Native?

babel.config.js configures Babel transpilation settings for the project. It defines how modern JavaScript features are converted to compatible code, handles JSX transformation, and can include various plugins and presets for additional functionality.

What is Hot Reloading and how does it differ from Live Reloading?

Hot Reloading updates only the changed components while maintaining the app's state. Live Reloading refreshes the entire app and resets state when code changes. Hot Reloading is more efficient during development as it preserves the development flow.

What are the two types of components in React Native?

React Native has two types of components: 1) Class Components - ES6 classes that extend React.Component and have lifecycle methods, state management, and render method. 2) Functional Components - JavaScript functions that accept props and return React elements, commonly used with hooks in modern React Native development.

What are props in React Native?

Props (properties) are read-only components that are passed from a parent component to a child component. They are used to customize and configure components, allowing for component reusability and maintaining the one-way data flow architecture in React Native applications.

What is the difference between View and Text components?

View is a container component that works like a div in web development, used for layouting and styling. Text is specifically designed for displaying text content and text-specific styling. Text components must be used to render any string content in React Native.

What is the purpose of the SafeAreaView component?

SafeAreaView is a component that automatically adds padding to accommodate notches, status bars, and other device-specific screen elements. It ensures content is displayed within the visible area of the device, particularly important for iOS devices with notches.

How do you handle touch events in React Native?

Touch events are handled using components like TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback, and Pressable. These components provide visual feedback and handle various touch interactions like taps, long presses, and press in/out events.

What is the difference between FlatList and ScrollView?

FlatList is optimized for long lists of data, rendering items lazily and only what's visible on screen. ScrollView renders all its child components at once, making it suitable for a small number of items. FlatList provides better performance for long lists but requires more setup.

How do you pass data between components in React Native?

Data can be passed between components using props for parent-to-child communication, callback functions for child-to-parent communication, and context or state management solutions for components that aren't directly related.

What is the purpose of the Image component?

The Image component is used to display images in React Native. It can handle both local and remote images, supports various image formats, provides loading and error states, and includes properties for resizing and styling images.

What are style props in React Native?

Style props are used to customize the appearance of components. They can be applied directly as props or through StyleSheet.create(). React Native uses a subset of CSS properties with camelCase naming convention and some platform-specific properties.

What is the purpose of KeyboardAvoidingView?

KeyboardAvoidingView is a component that adjusts its height or position based on the keyboard height to prevent the keyboard from overlapping with input fields. It's particularly useful for forms and input-heavy screens on iOS devices.

What is state in React Native and how does it differ from props?

State is a mutable data store internal to a component that determines the component's behavior and rendering. Unlike props which are read-only and passed from parent to child, state can be modified using setState() in class components or state updater functions in hooks, triggering re-renders when changed.

What is the useState hook and how is it used?

useState is a React hook that adds state management to functional components. It returns an array with two elements: the current state value and a function to update it. The hook accepts an initial state value and can be used multiple times in a single component for different state variables.

How do you update state in class components?

In class components, state is updated using this.setState(). It can accept either an object with new state values or a function that receives previous state as an argument. setState() performs shallow merging and updates are asynchronous for performance optimization.

What is the difference between useState and useReducer?

useState is simpler and good for managing independent pieces of state. useReducer is preferred for complex state logic, especially when state updates depend on multiple factors or when one action should update multiple state values. useReducer follows a Redux-like pattern with actions and reducers.

What is AsyncStorage and how is it used?

AsyncStorage is a simple, unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It's commonly used for storing user preferences, tokens, and other data that needs to persist across app restarts.

What is the Context API and when should it be used?

Context API provides a way to pass data through the component tree without manually passing props. It's useful for sharing global data like themes, user authentication, or language preferences. Should be used when data needs to be accessible by many components at different nesting levels.

How do you handle form state in React Native?

Form state can be handled using controlled components with useState, or through form management libraries like Formik or React Hook Form. State typically includes input values, validation errors, and form submission status.

What is the purpose of useEffect in state management?

useEffect handles side effects in functional components, including state-related operations like data fetching, subscriptions, or manual DOM manipulations. It runs after render and can clean up effects by returning a function.

How do you share state between components?

State can be shared between components through: 1) Lifting state up to a common ancestor, 2) Using Context API, 3) Implementing state management libraries like Redux or MobX, 4) Using custom hooks for shared state logic.

What are the common pitfalls in state management?

Common pitfalls include: 1) Mutating state directly instead of using setState/useState, 2) Async state updates race conditions, 3) Over-using global state, 4) Not considering component re-renders, 5) Improper state structure leading to performance issues.

What is the purpose of using React.memo?

React.memo is a higher-order component that memoizes functional components to prevent unnecessary re-renders. It performs a shallow comparison of props and only re-renders if props have changed, improving performance by reducing render cycles for components with stable props.

What is the importance of the FlatList component for performance?

FlatList is optimized for long lists by implementing windowing, which only renders items currently visible on screen. It provides better performance than ScrollView for long lists by recycling DOM elements and managing memory efficiently.

How does the React Native bridge affect performance?

The bridge serializes data between JavaScript and native code, which can impact performance when sending large amounts of data. Minimizing bridge traffic by batching updates and reducing unnecessary communication improves app performance.

What is the role of Hermes in React Native performance?

Hermes is a JavaScript engine optimized for React Native that improves start-up time, reduces memory usage, and decreases app size. It provides better performance than traditional JavaScript engines through ahead-of-time compilation and optimized bytecode.

How can you optimize image loading in React Native?

Image optimization includes using proper image sizes, implementing lazy loading, caching images, using FastImage component for better performance, and implementing progressive loading for large images. Also consider using image compression and proper formats.

What is the importance of useCallback in performance optimization?

useCallback memoizes functions to prevent unnecessary recreation between renders. It's particularly useful when passing callbacks to optimized child components that rely on reference equality to prevent unnecessary renders.

How does console.log affect performance in production?

console.log statements can significantly impact performance in production by creating unnecessary bridge traffic. They should be removed or disabled in production builds using babel plugins or proper configuration.

What is the purpose of useMemo?

useMemo memoizes computed values to prevent expensive recalculations on every render. It's useful for optimizing performance when dealing with complex calculations or data transformations that don't need to be recomputed unless dependencies change.

How can you reduce app bundle size?

Bundle size can be reduced by removing unused dependencies, implementing code splitting, using ProGuard/R8 for Android, enabling Hermes, implementing tree shaking, and properly configuring the Metro bundler.

What are the benefits of using PureComponent?

PureComponent implements shouldComponentUpdate with a shallow prop and state comparison, preventing unnecessary renders. It's useful for optimizing class components when you know that shallow comparison is sufficient for determining updates.

What is Platform.select() and how is it used?

Platform.select() is a React Native utility that returns platform-specific values. It accepts an object with 'ios', 'android', and 'default' keys, returning the value that matches the current platform. It's commonly used for platform-specific styles, components, or behavior.

How do you create platform-specific file extensions?

React Native automatically picks platform-specific files using extensions like .ios.js or .android.js. For example, Component.ios.js for iOS and Component.android.js for Android. This allows maintaining separate implementations while keeping a common interface.

What is the purpose of the Platform.OS property?

Platform.OS is a string that identifies the current operating system ('ios' or 'android'). It's used for conditional rendering and logic based on the platform, allowing developers to handle platform-specific differences in code.

How do you handle platform-specific styles?

Platform-specific styles can be handled using Platform.select(), platform-specific style files, or conditional style objects. This includes handling different shadow implementations, native components styling, and platform-specific measurements.

What are platform-specific components in React Native?

React Native provides platform-specific components like DatePickerIOS and ProgressViewIOS for iOS, or DatePickerAndroid and ProgressBarAndroid for Android. These components are designed to match native platform UI guidelines and behavior.

How do you handle platform-specific permissions?

Platform permissions are handled differently in iOS (Info.plist) and Android (AndroidManifest.xml). React Native provides APIs to request permissions at runtime, but setup and configuration must be done separately for each platform.

What is the difference between Android's back button and iOS's back gesture?

Android's back button is hardware/software-based and requires explicit handling using BackHandler, while iOS's back gesture is part of navigation and handled automatically by navigation libraries. Different approaches are needed for consistent behavior.

How do you handle platform-specific fonts?

Font handling differs between platforms in naming conventions and loading mechanisms. iOS uses the font name, while Android uses the file name. Custom fonts require different setup in Xcode and Android assets folder.

What are the key differences in layout between iOS and Android?

Layout differences include status bar height, navigation bar presence, safe areas (iOS), and default spacing behaviors. These need to be handled using platform-specific components like SafeAreaView and appropriate styling.

How do you handle platform-specific gestures?

Gestures can differ between platforms in behavior and implementation. iOS often uses swipe gestures for navigation, while Android relies more on the back button. PanResponder and gesture handlers need platform-specific configuration.

What is StyleSheet in React Native and why should you use it?

StyleSheet is a React Native API for creating and managing styles. It provides performance optimizations by validating styles at compile time, converting them to atomic IDs, and preventing new object creation on rerenders. It also provides better error checking and auto-completion support.

How does Flexbox work in React Native?

React Native uses Flexbox for layout but with some differences from web. The default flexDirection is 'column' instead of 'row'. Flexbox properties like flex, flexDirection, justifyContent, and alignItems are used to create flexible layouts that work across different screen sizes.

What are the differences between React Native styling and CSS?

React Native styling uses JavaScript objects with camelCase properties instead of CSS syntax. There's no inheritance of styles like CSS, no cascading, and no selectors. Units are unitless numbers (no px, em, etc.), and not all CSS properties are supported.

How do you handle dimensions in React Native?

Dimensions can be handled using fixed numbers (density-independent pixels), percentages, or the Dimensions API. The useWindowDimensions hook provides responsive dimensions. flex properties are commonly used for dynamic sizing.

What is the purpose of the SafeAreaView component?

SafeAreaView is used to handle safe area insets (notches, status bars) on iOS devices. It automatically adds padding to avoid overlay with system UI elements. It's essential for proper layout on modern iOS devices with notches or home indicators.

How do you create responsive layouts in React Native?

Responsive layouts are created using flexbox, percentage values, the Dimensions API, and useWindowDimensions hook. Platform.select can be used for platform-specific layouts, and dynamic styling based on screen size helps ensure proper display across devices.

What are style arrays in React Native?

Style arrays allow multiple styles to be applied to a component: [styles.container, styles.modified]. Later styles override earlier ones. This is useful for conditional styling and style composition. Arrays can include both StyleSheet styles and inline style objects.

How do you handle text styling in React Native?

Text styling in React Native is not inherited by default. Each Text component needs its own style. Text-specific properties like fontSize, fontWeight, lineHeight are available. Custom fonts require platform-specific setup.

What is the difference between width/height and flex in layouts?

Width and height set fixed dimensions, while flex determines how components grow/shrink within available space. Flex is preferred for responsive layouts as it adapts to different screen sizes. Fixed dimensions should be used sparingly.

How do you handle image sizing and scaling?

Images can be sized using width/height properties or resizeMode prop ('contain', 'cover', 'stretch', 'center'). For network images, dimensions must be specified explicitly. Image sizing should consider aspect ratio and responsive layout needs.

How do you make API calls in React Native?

API calls in React Native can be made using the Fetch API or Axios library. The Fetch API is built into React Native and supports promises, while Axios provides additional features like request/response interceptors, automatic JSON transformation, and better error handling.

What is the useEffect hook's role in API calls?

useEffect is commonly used for making API calls when a component mounts or when dependencies change. It helps manage side effects, cleanup functions for canceling requests, and proper data fetching lifecycle. The dependency array controls when the effect reruns.

How do you handle API error states?

API errors should be caught using try/catch blocks or .catch() for promises. Error states should be stored in component state, displayed to users appropriately, and logged for debugging. Consider implementing retry logic and proper error boundaries.

What is the difference between GET and POST requests?

GET requests retrieve data and include parameters in the URL query string. POST requests send data in the request body and are used for creating/updating resources. GET requests should be idempotent, while POST requests can modify server state.

How do you handle loading states during API calls?

Loading states should be managed in component state (e.g., isLoading boolean). Show loading indicators while data is being fetched, handle errors appropriately, and ensure good UX during loading. Consider skeleton screens or placeholder content.

What is JSON and how is it used in API integration?

JSON (JavaScript Object Notation) is a data format used for API requests/responses. React Native can parse JSON using JSON.parse() and stringify using JSON.stringify(). Most modern APIs use JSON for data exchange.

How do you set headers in API requests?

Headers can be set using the headers object in fetch options or Axios config. Common headers include Authorization for authentication tokens, Content-Type for specifying data format, and Accept for specifying expected response format.

What is REST and why is it important?

REST (Representational State Transfer) is an architectural style for APIs using HTTP methods (GET, POST, PUT, DELETE). It provides standardized ways to interact with resources, making APIs predictable and easier to understand.

How do you handle API authentication?

API authentication typically involves sending tokens in request headers, often using JWT (JSON Web Tokens). Tokens should be stored securely (e.g., AsyncStorage), refreshed when needed, and included in requests via interceptors.

What are query parameters and how are they used?

Query parameters are key-value pairs added to URLs for filtering, sorting, or pagination. They're commonly used in GET requests to modify the response. Parameters should be properly encoded using encodeURIComponent() when necessary.

Explore More

HR Interview Questions

Why Prepare with Stark.ai for react-native Interviews?

Role-Specific Questions

  • Mobile Developer
  • React Native Developer
  • Full Stack Developer

Expert Insights

  • Deep dive into React Native components, state management, and performance optimization.

Real-World Scenarios

  • Building a cross-platform mobile app with complex animations and API integrations.

How Stark.ai Helps You Prepare for react-native Interviews

Mock Interviews

Simulate React Native-specific interview scenarios.

Explore More

Practice Coding Questions

Solve React Native development challenges tailored for interviews.

Explore More

Resume Optimization

Showcase your React Native expertise with an ATS-friendly resume.

Explore More

Tips to Ace Your react-native Interviews

Master React Native Components

Understand core components, props, and state management techniques.

Optimize Performance

Learn best practices for handling animations, rendering optimizations, and memory management.

Work with Native Modules

Understand how to integrate native code for platform-specific functionalities.

Debugging & Troubleshooting

Familiarize yourself with React Native debugging tools and common issue resolution techniques.

Ready to Ace Your React Native Interviews?

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
practicing