Skip to content

lokendrarawat97/react-native-interview-questions3

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

πŸ–² Top 72 React Native interview questions and answers for mobile app developers

React Native is an open-source mobile application framework created by Facebook, Inc. It is used to develop applications for Android, iOS, macOS, Web, and Windows by enabling developers to use React's framework along with native platform capabilities. Follow along and check our list of essential React Native interview questions and answers that will trend on mobile developers interviews in 2021.



You can also find all 72 answers here πŸ‘‰πŸΌ https://devinterview.io/dev/reactNative-interview-questions


πŸ”Ή 1. What are native apps?

Answer:

  • Native mobile apps are the most common type of app.
  • They are built for specific platforms and are written in languages that the platform accepts. For example, Swift and Objective-C for native iOS apps and Java or Kotlin for native Android apps.
  • Native apps are also built using the specific Integrated Development Environment (IDE) for the selected operating systems
Source:Β clearbridgemobile.comΒ  Β 


πŸ”Ή 2. List some benefits of using React Native for building mobile apps?

Answer:

Some benefits of React Native are:

  • Known for Optimal Performance
  • Can Reuse the Codes and Pre-Developed Components
  • Large Community of Developers
  • Advantage of Live and Hot Reloading
  • Cost Effective Solution
  • Offers Simple User Interface
  • Support for Third-Party Plugins
  • Modular Architecture
  • Providing Handy Solutions and Libraries
Source:Β brainhub.euΒ  Β 


πŸ”Ή 3. Why do we use curly brace while importing some library?

Answer:

Problem

Consider:

import { Text, StyleSheet } from "react-native";

Curly braces are used to import small pieces of library. In above example we just want to make use of Text and StyleSheet component from react-native, so they are put in curly braces.

Source:Β github.comΒ  Β 


πŸ”Ή 4. What are the advantages of hybrid apps over native apps?

Answer:

  • Works across multiple platforms.
  • Unified development.
  • Faster build and lower cost of development.
  • Easier to make changes and update.
Source:Β Stackoverflow.comΒ  Β 


πŸ”Ή 5. What are hybrid apps?

Answer:

  • Hybrid mobile apps are applications that are installed on a device, just like any other app.
  • Hybrid apps are deployed in a native container that uses a mobile WebView object. When the app is used, this object displays web content thanks to the use of web technologies (CSS, JavaScript, HTML).
Source:Β brainhub.euΒ  Β 


πŸ”Ή 6. What is React Native?

Answer:

  • React Native is a mobile app development framework that enables the development of multi-platform Android and iOS apps using native UI elements.
  • It is based on the JavaScriptCore runtime and Babel transformers. With this setup react native supports new JavaScript (ES6+) features, e.g. arrow functions, async/await etc.
  • This famous framework for mobile app development started in the summer of 2013 as Facebook’s internal hackathon project.
  • Its first public preview was released in January of 2015 at Reactjs Conference and in March of 2015, Facebook made React Native open and available on GitHub.
Source:Β brainhub.euΒ  Β 


πŸ”Ή 7. How do you dismiss the keyboard in react native?

Answer:

Using Keyboard.dismiss()

import { Keyboard } from 'react-native' 

// Hiding the keyboard Keyboard.dismiss()

Source:Β stackoverflow.comΒ  Β 


πŸ”Ή 8. What is JSX?

Answer:

  • JSX is an XML/HTML-like syntax used by React that extends ECMAScript so that XML/HTML-like text can co-exist with JavaScript/React code.
  • The syntax is intended to be used by preprocessors (i.e., transpilers like Babel) to transform HTML-like text found in JavaScript files into standard JavaScript objects that a JavaScript engine will parse.
const nav = ( <ul id="nav"> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Clients</a></li> <li><a href="#">Contact Us</a></li> </ul> );
Source:Β www.reactenlightenment.comΒ  Β 


πŸ”Ή 9. What are props in React Native?

Answer:

  • The properties of React Native components are simply pronounced as props.
  • In React Native, most of the components can be customized at the time of their creation with different parameters. These parameters are known as props.
  • They are immutable, and they cannot be changed.
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Image,
Text,
View
} from 'react-native';

export default class App extends Component<{}> {
render() {
let imagePath = { uri: 'https://facebook.github.io/react-native/img/header_logo.png'};
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Image source={imagePath} style={{width: 250, height: 250}} />
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#a7a6a9',
},
welcome: {
fontSize: 30,
textAlign: 'center',
margin: 20,
}
});

Output

Source:Β facebook.github.ioΒ  Β 


πŸ”Ή 10. Tell us some options of storing persisting data in a react native app?

Answer:

Some popular options are:

  • Async Storage ("built-in" to React Native)
  • SQLite
  • Realm
  • Firebase
  • MongoDB
Source:Β stackoverflow.comΒ  Β 


πŸ”Ή 11. Will this piece of code work?

Answer:

Problem
<View> <Text>Hey there!</Text> <Text style={{ fontsize: 40 }} >Example of inline style</Text>; </View>

No. An error will be thrown as Text strings must be rendered within Text component. Because here semi-colon in third line will be treated as text, and in React native all texts needs to be rendered inside Text tag.

Source:Β github.comΒ  Β 


πŸ”Ή 12. What are the advantages of native apps over hybrid apps?

Answer:

  • They work efficiently as they are built for that specific platforms
  • Native apps are responsive on all the platform-specific devices
  • They are very fast and the best in the app performance
  • Native apps better integrate with mobile hardware
  • They have interactive and intuitive User Interface (UI) and User Experience (UX) as per the user expectations based on specific platforms
  • Some of the Native mobile apps work even without the Internet connection
  • Native apps are secured and reliable
  • They can easily access or utilize the other device-specific capabilities like GPS, Camera, Contacts, etc.
Source:Β www.quora.comΒ  Β 


πŸ”Ή 13. What are Refs used for in React Native?

Answer:

Refs provide you direct access to a DOM element or a components instance.

Source:Β github.comΒ  Β 


πŸ”Ή 14. What are the types of data that control a component?

Answer:

  • There are two types of data that control a component: props and state.
  • props are set by the parent and they are fixed throughout the lifetime of a component. For data that is going to change, we have to use state.
Source:Β facebook.github.ioΒ  Β 


πŸ”Ή 15. What does the Gesture Responder System do?

Answer:

The gesture responder system manages the lifecycle of gestures in an app.

Source:Β facebook.github.ioΒ  Β 


πŸ”Ή 16. What determines the size of a component and what are the ways?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 17. What are some ways of styling a react native component?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 18. What are components?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 19. When would you use ScrollView over FlatList or vice-versa?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 20. How is React Native different from ReactJs?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 21. What will be the output of following snippet?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 22. How do you check if the react native app is in debug or release build?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 23. Explain the use of Flexbox in React Native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 24. What is flex dimension and how is it different from fixed dimension?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 25. How are props and state different?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 26. What happens if you edit modules with exports that aren't React components in Fast Refresh?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 27. How is flexbox different in React Native and browser?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 28. How are Hot Reloading and Live Reloading in React Native different?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 29. What is AppRegistry? Why is it required early in "require" sequence?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 30. What does StyleSheet.create do and why is it useful?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 31. How do you re-render a FlatList?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 32. What is the use of ScrollView component?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 33. In Fast Refresh, what will happen if you edit files imported by modules outside of the React Tree?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 34. What are some best practices to consider for an action?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 35. What is Lifting State Up?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 36. What happens if you edit a module that only exports React components in Fast Refresh?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 37. What is the use of FlatList?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 38. What is State in react native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 39. What are Touchable Interactions in React Native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 40. What is "Fast Refresh"?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 41. How do you style a component in react native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 42. How do you perform logging in React native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 43. What does TouchableHighlight do and when do you use it?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 44. What is View and how important is it?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 45. What is "autolinking" in react-native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 46. What are some features of Fast Refresh?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 47. How to fetch data from local JSON file on React Native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 48. What is Component Driven Development (CDD)?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 49. What are Container/Smart components?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 50. What are Presentational/Dumb Components?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 51. What does React Native Packager do in the React Native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 52. What is Higher Order Component or HOC?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 53. What JavaScript engine does React native use?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 54. Are libraries such as TypeScript that compile to JavaScript compatible with React Naive?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 55. What are features of presentational/dumb components?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 56. Differentiate ScrollView and FlatList?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 57. How would you implement animations on events?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 58. How many threads run in a React Native app?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 59. State the lifecycle of Gesture Responder System?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 60. What are the features of Container/Smart components?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 61. What are some limitations of using react-native-cli for instantiating a project?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 62. What is AsyncStorage and how do you use it?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 63. What are some advantages of Component Driven Development?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 64. Does React Native compile JavaScript into Java for Android?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 65. How does the Fabric architecture work?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 66. What are some benefits of Container-Presentational pattern?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 67. What is InteractionManager and how is it used?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 68. What is wrong with this code for querying a native API?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 69. What is Fabric in React Native?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 70. Does React Native have a Virtual DOM?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 71. How is InteractionManager important?

πŸ‘‰πŸΌ Check all 72 answers


πŸ”Ή 72. What are the disadvantages of StyleSheet.create?

πŸ‘‰πŸΌ Check all 72 answers


About

🟣 React Native Interview Questions Answered to help you get ready for your next mobile app developer interview in 2021.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published