# React Hooks (React Native) > useState, useEffect, useContext, useRef, useCallback, useMemo, custom hooks - 20 interview questions - Junior - [Interview Questions: React Native](https://sharpskill.dev/en/technologies/react-native/interview-questions.md) ## 1. Which function allows declaring a state variable in a React functional component? **Answer** useState is the fundamental hook for managing local state in functional components. It returns an array containing the current state value and a function to update it. Unlike class components that use this.state, functional components use useState for each independent state variable. ## 2. What is the correct syntax to use useState with an initial value of 0? **Answer** The useState syntax uses array destructuring. The first element is the current state value, the second is the setter function to update it. The naming convention is to prefix the setter with 'set' followed by the capitalized variable name, like setCount for the count variable. ## 3. When does the useEffect callback without a dependency array execute? **Answer** Without a dependency array, useEffect runs after every render of the component, including the first render and all subsequent re-renders. This can cause performance issues as the code runs on every update. To limit executions, provide a dependency array specifying which values to watch. ## 17 more questions available - How to run a useEffect only on component mount? - What is the purpose of the function returned by a useEffect? Sign up for free: https://sharpskill.dev/en/login ## Other React Native interview topics - [JavaScript Essentials](https://sharpskill.dev/en/technologies/react-native/interview-questions/javascript-essentials.md): 25 questions, Junior - [React Fundamentals](https://sharpskill.dev/en/technologies/react-native/interview-questions/react-fundamentals.md): 20 questions, Junior - [React Native Basics](https://sharpskill.dev/en/technologies/react-native/interview-questions/react-native-basics.md): 22 questions, Junior - [TypeScript for React & React Native](https://sharpskill.dev/en/technologies/react-native/interview-questions/typescript-for-react-native.md): 22 questions, Junior - [React Native Components & API](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-components-api.md): 20 questions, Junior - [React Native Styling & Layout](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-styling-layout.md): 18 questions, Junior - [React Native Navigation](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-navigation.md): 22 questions, Mid-Level - [React Native State Management](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-state-management.md): 24 questions, Mid-Level - [React Native Networking & API](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-networking-api.md): 20 questions, Mid-Level - [Data Persistence](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-data-persistence.md): 20 questions, Mid-Level - [Forms & Validation](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-forms-validation.md): 18 questions, Mid-Level - [React Native Animations](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-animations.md): 22 questions, Mid-Level - [Native Modules & Bridge](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-native-modules.md): 20 questions, Mid-Level - [Platform-Specific Code](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-platform-specific-code.md): 18 questions, Mid-Level - [Permissions & Device APIs](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-permissions-apis.md): 20 questions, Mid-Level - [Push Notifications](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-push-notifications.md): 18 questions, Mid-Level - [React Native Testing](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-testing.md): 20 questions, Mid-Level - [React Native Debugging](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-debugging.md): 18 questions, Mid-Level - [Build & Deployment](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-build-deployment.md): 20 questions, Mid-Level - [Expo vs React Native Bare](https://sharpskill.dev/en/technologies/react-native/interview-questions/expo-vs-bare-rn.md): 18 questions, Mid-Level - [Performance Optimization](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-performance-optimization.md): 24 questions, Senior - [Memory Management](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-memory-management.md): 20 questions, Senior - [Architecture Patterns](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-architecture-patterns.md): 22 questions, Senior - [React Native New Architecture](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-new-architecture.md): 24 questions, Senior - [Security Best Practices](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-security-best-practices.md): 20 questions, Senior - [Offline-First Architecture](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-offline-first.md): 20 questions, Senior - [React Native CI/CD](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-ci-cd.md): 20 questions, Senior - [Monorepo & Code Sharing](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-monorepo-architecture.md): 18 questions, Senior - [Advanced Topics](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-advanced-topics.md): 22 questions, Senior - [App Lifecycle & Background Execution](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-app-lifecycle-background.md): 20 questions, Mid-Level - [Authentication & Session Management](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-auth-session-management.md): 22 questions, Mid-Level - [Monitoring & Crash Reporting](https://sharpskill.dev/en/technologies/react-native/interview-questions/rn-monitoring-crash-reporting.md): 20 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/react-native/interview-questions/react-hooks