Basic Interview Questions
Basic Interview Questions Interview with follow-up questions
1. What is React Native and why is it used?
React Native is an open-source framework (from Meta) for building cross-platform mobile apps with JavaScript/TypeScript and React. You write one codebase that runs on both iOS and Android, and it renders real native UI views — not a webview — so the app looks and feels native.
It's used because it offers:
- Code reuse across iOS and Android (and a large shared base with web React skills), cutting cost and time.
- Fast iteration via Fast Refresh and over-the-air updates.
- Near-native UX, since components map to platform-native widgets, with an escape hatch to write native modules when you need platform-specific APIs.
A crisp 2026 answer also notes that modern RN (latest 0.85) runs on the New Architecture (Fabric renderer + TurboModules + JSI) with Hermes as the default JS engine — the old serialized "bridge" is gone — which improves startup and rendering performance.
Follow-up 1
Can you explain some of the advantages of using React Native?
Some advantages of using React Native are:
Code Reusability: With React Native, developers can write code once and use it for both iOS and Android platforms, saving time and effort.
Native Performance: React Native uses native components, which allows the apps to have the same performance as native apps.
Hot Reloading: React Native supports hot reloading, which means developers can see the changes in the app instantly without rebuilding the entire app.
Large Community and Ecosystem: React Native has a large and active community, which means developers can find support, libraries, and tools easily.
Cost-Effective: Since React Native allows code sharing between platforms, it reduces the development cost compared to building separate apps for iOS and Android.
Follow-up 2
What are some limitations of React Native?
Some limitations of React Native are:
Performance Limitations: Although React Native provides native performance, complex animations and heavy computations may still have some performance issues.
Limited Native Functionality: React Native may not have access to all the native features and functionalities of iOS and Android platforms. In such cases, developers may need to write custom native code.
Third-Party Dependencies: React Native heavily relies on third-party libraries and dependencies, which may introduce compatibility issues and require additional maintenance.
Learning Curve: React Native requires knowledge of JavaScript and React, which may have a learning curve for developers who are new to these technologies.
Debugging: Debugging React Native apps can be challenging, especially when dealing with native code and third-party libraries.
Follow-up 3
Can you name some popular apps built with React Native?
Some popular apps built with React Native are:
Facebook: The Facebook app is built using React Native, which demonstrates the capabilities of the framework.
Instagram: Instagram uses React Native for its Explore feature, which allows users to discover new content.
Airbnb: Airbnb uses React Native for its mobile app, providing a seamless experience for users to book accommodations.
Tesla: Tesla's mobile app is built with React Native, allowing users to control their Tesla vehicles.
Skype: Skype uses React Native for its mobile app, enabling users to make audio and video calls.
These are just a few examples, and there are many more apps that have been built with React Native.
2. What is the difference between React Native and ReactJS?
ReactJS is a JavaScript library for building user interfaces, primarily for the web. It renders to the browser DOM and you build UI from HTML elements (<div>, <span>, etc.) styled with CSS.
React Native is a framework for building mobile apps. It shares React's component model, JSX, hooks, and state/props, but instead of the DOM it renders to native platform views. You use RN's own primitives (,, `) rather than HTML, style with a JSStyleSheet` (a flexbox subset, not full CSS), and reach native capabilities through native modules.
Key distinctions an interviewer wants:
- What they share: React itself — the reconciler, component lifecycle/hooks, and one-way data flow.
- What differs: the rendering target (DOM vs native views via Fabric/JSI), the primitives (HTML vs RN components), styling (CSS vs StyleSheet), and APIs (browser APIs vs native device APIs).
In short: same React mental model and library underneath, different render target and platform primitives.
Follow-up 1
Can you explain how React Native handles rendering on different platforms?
React Native uses native components to render the user interface on different platforms. It provides a set of pre-built components that map to the native UI components of each platform. These components are written in JavaScript and are then compiled into native code. This allows React Native apps to have a native look and feel on each platform, while still using a single codebase.
Follow-up 2
What are the key differences in the development environment between React Native and ReactJS?
The development environment for React Native and ReactJS is quite different. React Native requires the installation of additional tools and dependencies, such as the React Native CLI and the Android SDK or Xcode. It also requires a simulator or a physical device to test the app. ReactJS, on the other hand, can be developed and tested directly in a web browser without the need for any additional tools or dependencies. Additionally, React Native has its own set of components and APIs that are specific to mobile development, while ReactJS focuses on web development.
3. Can you explain what JSX is and how it's used in React Native?
JSX is a syntax extension for JavaScript that lets you write markup-like code describing your UI directly inside JavaScript. In React Native it's how you declare what a component renders.
const Greeting = ({ name }) => (
Hello, {name}!
);
Key points:
- JSX is syntactic sugar: a build step (Babel, via the React Native preset) compiles each tag into a
React.createElement(...)call (or the newer automatic JSX runtime). It isn't HTML and isn't required — you could callcreateElementby hand — but it's far more readable. - In RN the tags are React Native components (
,,), not HTML elements. Text must live inside, and styling uses thestyleprop, not CSS classes. - Curly braces
{ }embed any JavaScript expression, enabling dynamic content and conditional rendering.
A common follow-up: JSX produces the element tree that React reconciles before Fabric commits the corresponding native views.
Follow-up 1
What are the benefits of using JSX in React Native?
There are several benefits of using JSX in React Native:
Familiar syntax: JSX closely resembles HTML, making it easier for developers who are familiar with HTML to learn and use React Native.
Component-based structure: JSX allows you to define the structure and appearance of components in a declarative manner, which makes it easier to understand and maintain the code.
Dynamic content: JSX allows you to embed JavaScript expressions within curly braces, which enables dynamic content and logic in your components.
Code optimization: JSX code is transpiled into regular JavaScript code, which is optimized for performance by tools like Babel. This helps in reducing the size of the final bundle and improving the overall performance of the application.
Follow-up 2
Can you give an example of how JSX is used in a React Native component?
Sure! Here's an example of how JSX is used in a React Native component:
import React from 'react';
import { View, Text } from 'react-native';
const MyComponent = () => {
return (
Hello, JSX!
);
};
export default MyComponent;
In this example, we define a functional component called MyComponent using the arrow function syntax. The component returns a JSX expression that defines the structure and appearance of the component. The View component represents a container with flexbox layout, and the Text component represents a text element. The style prop is used to apply styles to the View component, and the text content is specified within the Text component. This JSX code will be transpiled into regular JavaScript code by Babel before execution.
4. What are the different types of components in React Native?
React Native components come in two forms:
Functional components: plain functions that take
propsand return JSX. With Hooks (useState,useEffect,useContext, etc.) they handle state and side effects, so they're the standard, recommended way to write components today.Class components: ES6 classes extending
React.Component, withthis.state/setStateand lifecycle methods (componentDidMount,componentDidUpdate,componentWillUnmount). Still supported and worth recognizing in older code, but rarely written for new code — the notable case where you still need a class is an Error Boundary.
In an interview, also distinguish components by role:
- Built-in core components RN provides (
View,Text,Image,ScrollView,FlatList,TextInput,Pressable) versus custom components you compose from them. - The older presentational vs container split — though with hooks, logic and presentation are usually separated via custom hooks rather than container classes.
Bottom line: prefer functional components with hooks; know class components for legacy code and error boundaries.
Follow-up 1
Can you explain the difference between stateful and stateless components?
Stateful components, also known as class components, have their own internal state that can be updated and managed. They are defined using ES6 classes and extend the React.Component class. Stateful components have lifecycle methods and can hold and modify state.
Stateless components, also known as functional components, do not have their own internal state. They are defined as plain JavaScript functions that return JSX. Stateless components are simpler and easier to test and maintain, as they only rely on the props passed to them.
Follow-up 2
How do you decide when to use each type of component?
The decision to use either a stateful or stateless component depends on the specific requirements of your application.
Stateful components should be used when you need to manage and update state within the component. They are useful for handling user interactions, managing form data, and performing complex logic.
Stateless components should be used when you have a simple component that only needs to render based on the props it receives. They are useful for displaying static content, such as headers, footers, or reusable UI elements.
In general, it is recommended to use stateless components whenever possible, as they are simpler and easier to reason about. However, if you need to manage state or use lifecycle methods, you will need to use a stateful component.
5. Can you explain what state and props are in React Native?
State and props are how React Native components hold and receive data.
State is data a component owns and can change over time. A change to state triggers a re-render so the UI reflects the new value. In functional components you manage it with the useState (or useReducer) hook:
const [count, setCount] = useState(0);
// setCount(count + 1) updates state and re-renders
Props are data passed into a component from its parent. They're read-only — a child must not mutate its props; to change something owned above, the parent passes a callback down and the child invokes it ("data down, events up").
Interviewer follow-ups:
- State is local and mutable (via the setter); props are external and immutable.
- Calling the state setter is asynchronous/batched, and updates that depend on the previous value should use the functional form:
setCount(c => c + 1). - "Lifting state up" — moving shared state to a common parent and passing it down as props — is the standard way to share data; for app-wide state you reach for Context or a store (Redux Toolkit/Zustand).
(this.state/setState is the class-component equivalent, but hooks are the norm now.)
Follow-up 1
What is the difference between state and props?
The main differences between state and props in React Native are:
Mutability: State is mutable and can be changed using the
setStatemethod, while props are read-only and cannot be modified by the component that receives them.Ownership: State is owned and managed internally by the component itself, while props are passed down from parent components.
Scope: State is local to a component and can only be accessed within that component, while props can be accessed by the component that receives them as well as its child components.
Updates: Changes to state trigger a re-render of the component, while changes to props do not automatically trigger a re-render. However, if the props passed to a component change, React will re-render that component and update its props.
Follow-up 2
Can you give an example of when you would use state and when you would use props?
Sure! Here are some examples:
- State: You would use state when you need to manage and update data within a component. For example, if you have a counter component that needs to keep track of the current count, you can use state to store and update the count value.
import React, { Component } from 'react';
class Counter extends Component {
constructor(props) {
super(props);
this.state = {
count: 0
};
}
incrementCount = () => {
this.setState(prevState => ({
count: prevState.count + 1
}));
}
render() {
return (
<div>
<p>Count: {this.state.count}</p>
Increment
</div>
);
}
}
export default Counter;
- Props: You would use props when you need to pass data from a parent component to its child components. For example, if you have a
Usercomponent that needs to display the name and age of a user, you can pass these values as props from a parent component.
import React from 'react';
const User = (props) => {
return (
<div>
<p>Name: {props.name}</p>
<p>Age: {props.age}</p>
</div>
);
}
export default User;
Live mock interview
Mock interview: Basic Interview Questions
- Read your scene and goals
- Talk it out; goals tick off live
- Get a score and stronger lines
Your voice and your AI key never touch our servers; the key stays in this browser and is sent only to Google. Only your round scores are saved to track progress.