




















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A set of practice questions and answers for a react native certificate exam. It covers key concepts such as native modules, ui rendering, virtual dom, cli tools, and es6 syntax. The questions are designed to test knowledge of react native architecture, component types, flexbox layout, hooks, and more, making it a valuable resource for developers preparing for certification or seeking to deepen their understanding of react native development. It includes explanations for each answer, enhancing its educational value. This resource is ideal for those looking to test their knowledge and prepare for certification.
Typology: Exams
1 / 92
This page cannot be seen from the preview
Don't miss anything!





















































































Question 1. Which component in React Native acts as the bridge between JavaScript code and native platform APIs? A) Metro Bundler B) JavaScriptCore C) Native Modules D) Virtual DOM Answer: C Explanation: Native Modules expose platform‑specific APIs to JavaScript, allowing the JS thread to invoke native functionality through the bridge. Question 2. In the React Native architecture, which thread is primarily responsible for rendering UI components? A) JavaScript thread B) UI thread C) Bridge thread D) Network thread Answer: B Explanation: The UI thread (also called the main thread) executes native UI rendering, while the JavaScript thread runs the JS code. Question 3. Compared to a pure native app, React Native typically offers which advantage? A) Access to all device sensors without permission handling B) Faster compile‑time builds C) Single codebase for iOS and Android D) Direct use of Swift/Objective‑C in UI layer Answer: C
Explanation: React Native lets developers write one JavaScript codebase that runs on both iOS and Android, reducing duplication. Question 4. What is the main purpose of the Virtual DOM in React Native? A) To generate native XML layout files B) To cache images on the device C) To compute a diff of UI changes before sending updates through the bridge D) To replace the need for a native bridge Answer: C Explanation: The Virtual DOM holds a lightweight representation of UI; React computes differences and sends only changed props to native components. Question 5. Which CLI tool provides a managed workflow that hides native code from the developer? A) React Native CLI (bare) B) Expo CLI C) Yarn CLI D) Android Studio CLI Answer: B Explanation: Expo CLI offers a managed environment where most native configurations are handled automatically. Question 6. When setting up an iOS development environment, which tool is required to install native dependencies? A) Homebrew B) CocoaPods C) Gradle
D) Arrow function Answer: C Explanation: Object destructuring lets you pull properties into distinct variables. Question 10. Which of the following statements about arrow functions is FALSE? A) They inherit the lexical this value. B) They can be used as constructors with the new keyword. C) They have an implicit return when the body is an expression. D) They cannot have their own arguments object. Answer: B Explanation: Arrow functions cannot be used as constructors; they lack a [[Construct]] method. Question 11. How does async/await improve readability over plain Promises? A) It removes the need for error handling. B) It forces synchronous execution of async code. C) It allows asynchronous code to be written in a linear, try/catch style. D) It automatically caches network responses. Answer: C Explanation: async/await lets you write asynchronous code that looks like synchronous code, using try/catch for errors. Question 12. Which React component type is recommended for new React Native codebases? A) Class components B) Functional components with Hooks
C) PureComponent classes only D) Stateless components using createClass Answer: B Explanation: Functional components combined with Hooks provide a simpler API and avoid lifecycle method boilerplate. Question 13. In React, props are passed to a component in which direction? A) Bottom‑up (child to parent) B) Bidirectional C) Top‑down (parent to child) D) Random access Answer: C Explanation: Props flow one‑way from parent components to their children, ensuring predictable data flow. Question 14. Which rule must be followed when writing JSX? A) All tags must be closed, even self‑closing ones. B) Only one root element is allowed per component. C) Attributes must be camelCased. D) All of the above. Answer: D Explanation: JSX requires closed tags, a single root element, and camelCased attribute names. Question 15. Which core component is best suited for displaying scrollable, non‑virtualized content? A) FlatList
B) maxToRenderPerBatch C) windowSize D) updateCellsBatchingPeriod Answer: A Explanation: initialNumToRender defines the number of items rendered on the first mount. Question 19. In Flexbox, which value aligns children along the cross‑axis? A) justifyContent B) alignItems C) flexDirection D) flexWrap Answer: B Explanation: alignItems controls alignment perpendicular to the main axis (cross‑axis). Question 20. To make a view fill the remaining space in a column layout, which style should you apply? A) flex: 0 B) flex: 1 C) height: 100% D) position: absolute Answer: B Explanation: flex: 1 tells the component to take up all available space in the flex container. Question 21. Which API provides device screen dimensions that automatically update on rotation? A) Dimensions.get('window')
B) PixelRatio.get() C) useWindowDimensions hook D) ScreenInfo module Answer: C Explanation: useWindowDimensions returns up‑to‑date width and height and re‑renders on orientation changes. Question 22. On Android, which style property is ignored for shadows? A) shadowColor B) shadowOpacity C) elevation D) shadowRadius Answer: D Explanation: Android uses elevation for shadows; iOS uses the other shadow properties. Question 23. Which Hook is used to manage simple state in a functional component? A) useEffect B) useReducer C) useState D) useContext Answer: C Explanation: useState returns a state variable and a setter function for basic state handling. Question 24. Which rule of Hooks must never be violated? A) Hooks can be called inside loops.
Question 27. How do you consume a value from a React Context inside a functional component? A) Context.Consumer component B) this.context property C) useContext(MyContext) Hook D) getContext() method Answer: C Explanation: useContext Hook reads the current context value and subscribes to updates. Question 28. Which of the following is a valid reason to create a custom Hook? A) To share UI markup between components B) To encapsulate reusable side‑effect logic C) To replace useState entirely D) To avoid the need for props Answer: B Explanation: Custom Hooks abstract reusable logic (e.g., data fetching, subscriptions) while preserving Hook rules. Question 29. Which global state library uses a single store and pure functions called reducers? A) Zustand B) Recoil C) Redux D) MobX Answer: C
Explanation: Redux's core concepts are a single immutable store, actions, and reducers that compute the next state. Question 30. In Redux, what is the purpose of an action creator? A) To directly modify the store state B) To return an action object describing a state change C) To render UI components D) To listen for store updates Answer: B Explanation: Action creators are functions that produce action objects, which are dispatched to reducers. Question 31. Which middleware enables asynchronous dispatches in Redux by allowing functions to be returned from action creators? A) Redux Saga B) Redux Thunk C) Redux Logger D) Redux Persist Answer: B Explanation: Redux Thunk intercepts functions returned from action creators and invokes them with dispatch and getState. Question 32. Which React Navigation navigator is best suited for a tab‑based UI at the bottom of the screen? A) StackNavigator B) DrawerNavigator C) BottomTabNavigator
B) All screens are placed in a single navigator and hidden via display:none. C) Authentication is handled by a modal that overlays the main navigator. D) Use a DrawerNavigator for both logged‑in and logged‑out screens. Answer: A Explanation: Conditional rendering of two separate navigation trees (auth vs. app) isolates unauthenticated routes. Question 36. Which JavaScript API is commonly used for making HTTP requests in React Native? A) XMLHttpRequest only B) fetch API or Axios library C) WebSocket API D) navigator.geolocation Answer: B Explanation: The standard fetch API is built‑in; Axios is a popular wrapper that provides extra features. Question 37. When using the Fetch API, which method should you call to parse a JSON response? A) .json() B) .parse() C) .toJSON() D) .stringify() Answer: A Explanation: response.json() returns a promise that resolves to the parsed JSON object.
Question 38. Which library offers declarative data fetching, caching, and background updates for React Native? A) Redux Persist B) React Query (TanStack Query) C) AsyncStorage D) SQLite Answer: B Explanation: React Query handles caching, refetching, and synchronization of server state. Question 39. How would you securely store an authentication token on the device? A) In a plain text file in the project root B) In AsyncStorage without encryption C) In SecureStore (Expo) or Keychain/Keystore via a library D) In a global JavaScript variable Answer: C Explanation: Secure storage APIs encrypt data and protect it from other apps, making them suitable for tokens. Question 40. Which of the following is a lightweight key‑value storage solution for React Native? A) Realm B) SQLite C) AsyncStorage D) Firebase Realtime Database Answer: C Explanation: AsyncStorage provides simple persistent storage of strings/JSON objects.
Question 44. Which component from React Native is used to render an image from a remote URL? A) <Image source={{uri: 'https://example.com/pic.png'}} /> B) <ImageView src='https://example.com/pic.png' /> C) <Picture uri='https://example.com/pic.png' /> D) <RemoteImage url='https://example.com/pic.png' /> Answer: A Explanation: The Image component accepts a source prop with a {uri: ...} object for remote images. Question 45. How can you add platform‑specific styling for iOS only? A) Use StyleSheet.create({ ... }) with a conditional if (Platform.OS === 'ios') B) Create a separate file named Component.ios.js and import it. C) Both A and B are valid approaches. D) Platform‑specific styling is not supported. Answer: C Explanation: You can conditionally apply styles or use file naming conventions (.ios.js) for platform‑specific code. Question 46. Which file extension tells React Native to load the file only on Android devices? A) .android.js B) .native.js C) .ios.js D) .mobile.js
Answer: A Explanation: The .android.js suffix makes the bundler prioritize that file on Android builds. Question 47. To retrieve the current geographic location, which permission must be granted on iOS? A) NSLocationAlwaysAndWhenInUseUsageDescription B) NSCameraUsageDescription C) NSPhotoLibraryAddUsageDescription D) NSBluetoothPeripheralUsageDescription Answer: A Explanation: iOS requires location usage description keys; the combined “always and when in use” key covers both scenarios. Question 48. Which Expo module provides push notification handling? A) expo-notifications B) expo-location C) expo-camera D) expo-constants Answer: A Explanation: expo-notifications abstracts both local and remote push notification APIs. Question 49. When creating a custom native module for Android, which Java class must extend? A) ReactContextBaseJavaModule B) Activity C) Application
C) An alternative to useState for asynchronous data. D) A way to access the component’s DOM node. Answer: A Explanation: useRef returns a mutable .current property that survives re‑renders and does not trigger updates when changed. Question 53. Which hook would you use to memoize a callback function to avoid unnecessary re‑creation? A) useMemo B) useCallback C) useEffect D) useLayoutEffect Answer: B Explanation: useCallback returns a stable reference to a function as long as its dependencies do not change. Question 54. When should you use useLayoutEffect instead of useEffect? A) For side effects that do not affect layout. B) For measuring layout or synchronously updating DOM before paint. C) For asynchronous data fetching. D) Never; it is deprecated. Answer: B Explanation: useLayoutEffect runs synchronously after DOM mutations but before the browser paints, useful for layout measurements. Question 55. Which of the following is NOT a valid way to style a component in React Native?
A) Inline style object B) StyleSheet.create object C) External CSS file imported via import './styles.css' D) Array of style objects Answer: C Explanation: React Native does not support traditional CSS files; styling must be done via JavaScript objects. Question 56. What does the flexShrink property control? A) The amount a flex item will grow to fill space. B) The amount a flex item will shrink when space is limited. C) The order of items in a flex container. D) The direction of the main axis. Answer: B Explanation: flexShrink determines how much an item reduces its size relative to others when overflow occurs. Question 57. Which of these components automatically adds padding to avoid the notch on iOS devices? A) View B) SafeAreaView C) ScrollView D) KeyboardAvoidingView Answer: B Explanation: SafeAreaView respects the device's safe area insets, preventing UI from being overlapped by notches or home indicators.