All 75 React Native quiz questions below come with a short explanation, visible right on the page — no sign-in needed. They're grouped by beginner and intermediate levels and 75 subtopics, so you can revise one part at a time. Choose Try React Native quiz above to take a scored run and review the questions you got wrong.
What is the main difference between React Native and React on the web?
A.State management works on a completely different mechanism from React
B.It does not support hooks so class components are required
C.The components render to native views rather than the DOM
D.It uses its own syntax in place of JSX
Answer: C
Same React, different render target: View and Text become native views on Android and iOS instead of DOM elements. So there is no HTML, no real CSS, and every browser-related API is absent.
What does StyleSheet.create give you over an inline style object in JSX?
A.It applies different styles for Android and iOS automatically
B.The style is created once and the property names are checked
C.It lets styles be inherited from a parent component
D.It allows CSS-like selectors in React Native
Answer: B
StyleSheet.create creates the style object once instead of on every render, and validates property names so typos are caught early. With an object written inline in JSX, each render produces a new reference and breaks prop comparison.
ScrollView renders all children as soon as it displays, so a long list makes the screen stutter and uses memory. FlatList renders only what is visible plus a buffer, and reclaims what has scrolled past.
What is the default flexDirection in React Native?
A.There is no default; it must be declared explicitly
B.row, exactly as flexbox defaults on the web
C.It depends on whether the platform is Android or iOS
D.column, unlike the web's row default
Answer: D
The default is column, unlike the web which defaults to row. Also flex: 1 in React Native equals flex: 1 1 0, and every View is a flex container, no display declaration needed.
How do you write code that runs only on iOS in React Native?
A.Put the code inside a conditional compilation directive
B.Use an environment variable set when the app runs
C.Declare it in the project's configuration file
D.Check Platform.OS or split the files by suffix
Answer: D
Two ways: check Platform.OS in code, or split files into Component.ios.tsx and Component.android.tsx so the bundler picks at build time. Also Platform.select lets you choose values by platform right inside a style object.
A.Light key-and-string settings that are not sensitive
B.Image and video files downloaded from the server
C.Login tokens and payment details
D.Relational data needing querying and filtering
Answer: A
AsyncStorage is an unencrypted key-and-string store, good for light settings like language, dark mode, or a seen-the-tutorial flag. Tokens must go in secure storage, and data that needs querying should use a local database.
Why prefer Pressable over TouchableOpacity in new code?
A.It lets you define the press feedback yourself
B.It handles gestures faster because it runs at the native layer
C.It adds screen reader labels automatically
D.It is the only component that receives a long press
Answer: A
Pressable is the newer API replacing the Touchable family. It lets style and children receive the pressed state, supports an extended touch area via hitSlop, long-press delay, and a cancel threshold when dragging outside.
What is the core difference between an Expo project and a bare React Native project?
A.Expo does not allow third-party libraries
B.Expo uses a different React version from bare React Native
C.Expo only runs on Android
D.Expo manages the native side for the developer
Answer: D
Expo manages the native side: config is generated from a config file and builds run on a cloud service. A bare project keeps the android and ios folders in the repo, and every native change is done by the developer.
D.It bundles the JavaScript into a package the app loads
Answer: D
Metro is React Native's JavaScript bundler: it bundles code and assets into a bundle for the app to load, and runs a dev server for fast updates when code changes. The native side is still compiled by Gradle and Xcode.
Content is hidden behind the notch and gesture bar. What is the correct fix?
A.Enable full-screen mode for the application
B.Set marginTop from the status bar height
C.Set a fixed top padding of around 44 points
D.Use the safe area to get the real insets
Answer: D
Use the safe area context to read the device's actual insets, then apply them as padding or use a ready-made wrapper component. Hard-coded numbers are always wrong on at least one device line, and this bug only shows up when testing on multiple devices.
How do you truncate a long string to one line with an ellipsis in React Native?
A.Set a fixed height on the Text
B.Slice the string before displaying it
C.Set numberOfLines on the Text
D.Set overflow hidden on the enclosing View
Answer: C
Use numberOfLines on Text, along with ellipsizeMode to choose truncation at the start, middle, or end. Truncating with slice is wrong because how many characters fit on a line depends on the system font size and device width.
Why prefer useWindowDimensions over Dimensions.get?
A.It works outside a component too
B.It updates when the size changes
C.It returns a size accurate to the exact pixel
D.It already subtracts the device's safe area
Answer: B
useWindowDimensions is a hook, so it updates when the size changes: screen rotation, split screen, or unfolding a foldable device. Dimensions.get only takes a one-time snapshot, and that value is stale by the first rotation.
What happens when a TextInput has value but no onChangeText?
A.React Native throws an error when the component is built
B.The content is buffered until the field loses focus
C.The input is completely disabled
D.The user types but the content does not change
Answer: D
The input becomes controlled but not updating: the user types, React re-renders and puts the content back to the old value, so the text seems not to go in. If you have value, you must have onChangeText, or use defaultValue for an uncontrolled input.
Which API opens the dialer or a browser from React Native?
A.Fetch to the URL you want to open
B.Linking, with a URL using the matching scheme
C.Navigation with an external screen name
D.A WebView embedded in the current screen
Answer: B
Linking.openURL with an address using the appropriate scheme: tel: to call, mailto: to compose mail, https: to open the browser, or another app's custom scheme. Check whether it can be opened before calling so you can handle the case where no app receives it.
Why must project images be loaded with require rather than a string path?
A.A string path only works on iOS
B.require compresses the image so it saves space
C.The bundler must know about the image at build time to include it
D.A string path does not support high-resolution images
Answer: C
The bundler resolves requireat build time to know which images to include in the bundle and pick the right resolution variant. Dynamically concatenated runtime paths are invisible, so the image is not bundled and renders empty.
Where does the React Native Modal component render its content?
A.On an overlay layer above the whole interface
B.In a new screen of the navigation library
C.Right where it is declared in the component tree
D.In a separate operating system window
Answer: A
Modal renders on an overlay covering the whole UI, so it is not clipped by parent elements. In return it sits outside the navigation stack, so the Android back button must be handled separately via onRequestClose.
Status bar text is unreadable on a light background. How do you fix it?
A.Set barStyle on StatusBar per screen
B.Wrap the screen in a safe area with a dark background
C.Hide the status bar entirely on that screen
D.Darken the screen's background colour
Answer: A
Set barStyle to dark-content for light backgrounds and light-content for dark backgrounds, declared per screen. On Android you can also set the status bar background color, but on iOS you should not set it only once at the app root.
A list needs sections with sticky headers while scrolling. Which component?
A.A ScrollView with several FlatLists nested inside
B.A SectionList with grouped sections and their items
C.A VirtualizedList configured from scratch
D.A FlatList with the data flattened
Answer: B
SectionList takes an array of sections, each with a header and a child data array, plus an option to pin headers while scrolling. It keeps the same lazy rendering as FlatList, making it suitable for contacts, date-grouped history, and product categories.
How do you intercept the Android back button on a form with unsaved input?
A.Set a navigation-blocking flag in the app configuration
B.Listen for the hardware back button event
C.Open the screen as a full-screen modal
D.Hide the back button in the navigation bar
Answer: B
Register a listener for the back button and return a value indicating it was handled, usually with a confirmation dialog for leaving the screen. Remember to unregister when the screen loses focus, otherwise the behavior will leak into other screens.
Why is useEffect with an empty dependency array not enough to refresh data when returning to a screen?
A.useEffect does not work in React Native
B.The screen is still in the stack
C.The data is cached by the bundler so it does not change
D.An empty array means the effect never runs
Answer: B
The navigation library keeps screens in the stack when opening a new screen, so returning does not remount the component and a run-once effect does not run again. Use a hook that runs on screen focus.
What does JSI change compared with the old React Native bridge?
A.The JavaScript is compiled to native code at build time
B.The interface is painted with its own graphics technology
C.JavaScript calls native functions directly, without the queue
D.Every native call moves to a separate thread
Answer: C
The old bridge turned every call into a queued asynchronous JSON message. JSI lets JavaScript hold references to native objects and call them directly, removing serialization overhead and allowing synchronous calls when needed.
What does Hermes most clearly improve in a React Native app?
A.The network speed, through automatic compression
B.The startup time, thanks to precompiled bytecode
C.The interface painting speed on the render thread
D.The animation quality, through frame synchronization
Answer: B
Hermes compiles JavaScript to bytecode at build time, so the app no longer has to parse and compile code at startup. The clearest result is reduced time to the first screen, along with lower memory usage in some configurations.
A FlatList janks on fast scroll. Which prop helps most when all rows have equal height?
A.Set scrollEventThrottle to its smallest value
B.getItemLayout, to skip measuring each row
C.Enable removeClippedSubviews on every platform
D.Set initialNumToRender to a very large value
Answer: B
getItemLayout lets the list know each row's height and position ahead of time, removing dynamic measurement during scrolling and allowing instant jumps to any index. It only works when row height is fixed or computable.
A child wrapped in memo still rerenders on every parent render. Why?
A.A displayName must be set for memo to take effect
B.The props are functions or objects recreated each time
C.The child has its own state so it ignores memo
D.memo only works with class components
Answer: B
memo compares props by reference. A callback or style object created inline in JSX produces a new reference on every render, so the comparison always fails. Use useCallback and useMemo for those props.
How does the native stack navigator differ from the JavaScript stack navigator?
A.It supports deep links while the JavaScript one does not
B.It allows passing more complex parameters between screens
C.It needs no navigation container wrapping the app
D.It uses native navigation so the transitions match the platform
Answer: D
Native stack uses the real Android and iOS navigation components, so screen transition animations and the back-swipe gesture are handled by the platform. In return, it offers less animation customization than the JavaScript implementation.
What does useNativeDriver do in Animated and when can it not be used?
A.It raises the frame rate to the device's maximum
B.It runs the animation on a separate JS thread
C.It lets the animation continue when the app goes to the background
D.It moves the animation to native, except for layout properties
Answer: D
useNativeDriver sends the animation description down to the native layer to run independently of the JS thread, so animations don't stutter when JavaScript is busy. It only applies to geometric transforms and opacity, not layout properties like width or spacing.
Why do React Native projects usually replace PanResponder with a dedicated gesture library?
A.Gestures are recognized natively rather than depending on JavaScript
B.PanResponder has been removed from React Native
C.A dedicated library generates the animation for every gesture
D.PanResponder cannot handle multi-touch gestures
Answer: A
Dedicated gesture libraries recognize gestures at the native layer, so feedback isn't delayed when the JS thread is busy. They also come with built-in coordination between simultaneous or mutually exclusive gestures, which you'd have to implement yourself with PanResponder.
An image list gets the app killed for memory. What is the most common cause?
A.The list items lack stable keys
B.The list keeps too many rows in memory
C.The images decode at their full size even when shown small
D.The images are refetched from the server repeatedly
Answer: C
Images consume memory based on their actual decoded pixel size, not their display size. A four-thousand-pixel image shown in a hundred-point box still costs as much as the original, so you must ask the server for correctly sized images or downscale before display.
A bug appears only in release builds, not debug. Where do you look first?
A.Code stripped by the optimizer, and different configuration
B.The bundler's cache has not been cleared
C.The real device has a different operating system version
D.The development server was not running for the release build
Answer: A
Release builds minify code, disable development checks, and use different configuration. Common causes: code relying on class or function names that get renamed during minification, missing keep rules for the minifier, environment variables pointing to the wrong place, and resources that only exist in the debug build.
What problem comes from using Context for rapidly changing state such as a search box?
A.Context cannot hold a string value
B.Every component reading the context rerenders
C.Context cannot be used with hooks
D.Context only works with sibling components
Answer: B
Context has no selector mechanism: changing a value re-renders every component that reads it, even ones that only care about a different field. For state that changes with every keystroke, that means a flood of unnecessary renders.
What is correct handling when the user leaves a screen while a request is in flight?
A.Set a very short timeout so the request fails by itself
B.Cancel the request and ignore a late result
C.Block navigation until the request completes
D.Let the request continue and store the result in a global variable
Answer: B
Cancel the request with an abort signal and ignore late responses. In React, cleanup in the return function of useEffect is the right place; if you use a server data library, this is already handled for you.
How do you install dev and production builds side by side on one device?
A.Install one build from the store and one from an installer file
B.Give each build variant a different package identifier
C.Change the application's display name per build
D.Set different version numbers for the two builds
Answer: B
They must differ in package identifier: applicationId on Android and bundle identifier on iOS. Along with that, you usually change the display name and icon to tell them apart visually, and each variant points to its own endpoint.
How does the React Native testing library encourage finding elements?
A.By the file path containing the component under test
B.By what the user sees, such as labels and text
C.By component name and their hierarchy
D.By the order the elements appear on screen
Answer: B
Find elements by what the user perceives: displayed text, accessibility labels, input placeholders. That way tests describe behavior rather than structure, and refactoring a component doesn't break the tests.
What is the limitation of over-the-air updates for React Native apps?
A.It only applies to Android and cannot be used on iOS
B.You cannot go back to the previous version when a new one is faulty
C.It only updates JavaScript and assets, never the native side
D.It forces the user to reopen the app three times
Answer: C
Only the JavaScript and assets are updated. Adding native libraries, changing permissions, or upgrading React Native all require going through the store. Also, the update must comply with store policy and must not change the fundamental nature of the app's features.
The keyboard covers the last input in a form. What is the most appropriate fix?
A.Add a fixed bottom padding of around 300 points
B.Use a keyboard-avoiding component together with a scroll area
C.Turn off the screen-shifting effect when the keyboard appears
D.Move the input to the top of the form
Answer: B
Use a keyboard-avoiding component wrapping the scroll area, and set different behavior for the two platforms because they handle keyboard insets differently. A fixed padding is always wrong on some device.
B.Server data needs caching, refreshing and retrying
C.Interface state cannot live in the same store
D.Redux does not support asynchronous data
Answer: B
Server data is a copy of something owned elsewhere, so it can always be stale and needs caching, refreshing, retrying, and request deduplication. UI state is owned by the app and has none of those needs.
When do you need to write a native module in a React Native project?
A.When you need a platform API no library wraps yet
B.When you need to access files on the device
C.When you need periodic background tasks
D.When you need to speed up a computation in JavaScript
Answer: A
When you need a platform API that no library wraps yet, or must integrate a toolkit that only has a native version, such as a payment partner's SDK or specialized hardware.
Push notifications work in the background but are silent in the foreground. Why?
A.The operating system blocks notifications to avoid interrupting
B.The notification library was not initialized correctly
C.The device token is only valid in the background
D.With the app open, the application code handles it itself
Answer: D
While the app is in the foreground, the OS delivers the data to the app instead of drawing the notification itself. To show something, display a local notification or an in-app banner based on the received data.
What is required for an https link to open the app instead of a browser?
A.A verification file on the server proving domain ownership
B.The app must be installed from the official store
C.The user picks the app as the default handler
D.Declare a custom scheme in the app configuration
Answer: A
You need to verify domain ownership: assetlinks.json for Android and apple-app-site-association for iOS, placed at the correct well-known path over https. Without this step, the link only opens the browser.
What most effectively reduces the Android app size of a React Native app?
A.Publish an app bundle and enable code shrinking
B.Convert the in-app images to a more strongly compressed format
C.Remove the least-used screens from the app
D.Disable the optimized JavaScript engine to shrink the bundled library
Answer: A
Ship an app bundle so the store generates per-device installs by architecture and screen density, while enabling code shrinking and removing unused resources. These are the two biggest cuts without touching functionality.
Stack traces from real users show only minified symbols. What is missing?
A.A stable network connection at the moment of the error
B.The source map for exactly the released version
C.Permission to write logs on the user's device
D.Debug mode enabled in the released build
Answer: B
A source map matching the exact version is missing. Release builds minify code so function names lose meaning; you must upload the source map to the monitoring service on every release, and for Android you also need the symbol file for the native part.
What does an icon-only button need for screen reader users?
A.An accessibility label and the button role
B.A higher contrast colour
C.A clearer visual press feedback
D.An icon larger than the recommended size
Answer: A
It needs an accessibilityLabel describing the action and accessibilityRole set to button. The label should say what will happen rather than describe the graphic: reading out "save post" is useful, while reading out "star icon" is not.
What must layout account for when supporting right-to-left languages?
A.Reverse the order of the items in the data array
B.Give every text block a fixed width
C.Use separate images for each reading direction
D.Use start and end rather than left and right
Answer: D
Use direction-aware properties like marginStart, paddingEnd, and textAlign set to left only when truly fixed. They flip automatically for right-to-left languages, whereas marginLeft does not change and skews the layout.
How should a refresh token be stored in a React Native app?
A.A secure store based on the Keychain and Keystore
B.AsyncStorage with your own encryption
C.A variable in memory, re-fetched from the server on each launch
D.A file in the application's data directory
Answer: A
Use secure storage backed by iOS Keychain and Android Keystore. That is the only place with OS-level protection. Access tokens should be short-lived and kept in memory, while refresh tokens must be revocable from the server.
What usually breaks when moving a React Native app into a multi-package repo?
A.Metro does not watch directories outside the project folder
B.React Native does not support TypeScript in such a repository
C.The app can no longer run on a real device
D.The whole native side must be rewritten
Answer: A
Metro only watches the project folder by default, so code in another package is not resolved. You must declare watch folders in the Metro config and handle cases where the same library appears in multiple places in the dependency tree.
When is the right moment to request location permission?
A.After the user has used the app for a week
B.When the user taps a feature that needs the location
C.In the settings screen for the user to enable themselves
D.On the first screen when the app first opens
Answer: B
Ask at the moment the user taps the feature that needs the permission. The reason is obvious then, so acceptance is high. Asking on the launch screen is the fastest way to be denied, and on iOS the dialog appears only once.
Why must the build number increase for every store upload?
A.The store uses it to distinguish uploads
B.The bundler needs it to name the package file
C.The error monitoring service needs it to group errors
D.The device uses it to decide whether to update
Answer: A
Stores distinguish uploads by build number, so a duplicate is rejected. The durable approach is to have CI assign the number automatically instead of editing by hand, while the displayed version name is decided by humans.
The app takes seconds to show its first screen. Where do you look first?
A.The number of components on the first screen
B.Initialization running synchronously before the first paint
C.The size of the splash screen's background image
D.The device's network speed when the app opens
Answer: B
Audit the initialization that runs before the UI renders: service setup, storage reads, remote config calls. Keep only what determines the first screen and move the rest to run after the UI is shown.
A render error blanks the whole app. How do you limit the damage?
A.Turn off React's strict mode
B.Catch the error in the root component's useEffect
C.Wrap every render function in a try-catch
D.Put error boundaries around each region of the screen
Answer: D
Use error boundaries around each area: a tab, a list, a content card. The error stays contained in that area and shows a fallback UI, instead of blanking the whole app.
In which case is React Native not a suitable choice?
A.An e-commerce app with many list screens
B.An app needing to run on both platforms with a small team
C.An internal enterprise app with many forms
D.A graphics-heavy app with deep system integration
Answer: D
React Native is weak for heavy graphics apps like games or real-time image processing, and for apps needing deep system integration such as home screen widgets. A team already strong in native for a single platform should also think carefully.
A worklet is a JavaScript function compiled to run on the UI thread. That keeps animations and gesture responses smooth while the main JS thread is busy, at the cost of not being able to access React state directly.
How does a recycling-based list library differ from FlatList?
A.It compresses the data in memory to save RAM
B.It reuses old views instead of creating new ones
C.It draws the list with its own graphics technology
D.It fetches data from the server page by page automatically
Answer: B
The view recycling mechanism: when a row scrolls off screen, its view is assigned new data instead of being destroyed and recreated. This is how it differs from FlatList in performance during fast scrolling.
Why is writing state.items.push valid inside a Redux Toolkit reducer?
A.The reducer runs on a draft and produces a new state
B.Redux Toolkit allows mutating the original state directly
C.Arrays in JavaScript are copied when passed
D.The reducer runs on its own thread so it is safe
Answer: A
The reducer receives a change-tracked draft. The syntax looks like direct mutation, but the library builds a new immutable state from those changes, so Redux's immutability rule is still preserved.
What happens when you read the whole store instead of using a narrow selector?
A.The component rerenders on every change in the store
B.The store is locked until the component finishes rendering
C.The other selectors stop working
D.The state is copied so it uses twice the memory
Answer: A
The component re-renders on every change in the store, including parts it doesn't use. On mobile, a long list subscribing to the whole store is the fastest way to make every small interaction drop frames.
Values are kept outside React state, so typing doesn't re-render the whole form. On a long form running on mid-range devices, this difference is immediately visible through the lag between pressing a key and the character appearing.
A custom font is added but text still renders in the default font. Common cause?
A.Restarting the development server is enough
B.The font file was not compressed in the right format
C.The font family name in the code does not match the file's real name
D.A font can only be applied to headings rather than body text
Answer: C
Wrong font family name: the system looks up the internal name inside the file, not the file name, and when it isn't found it silently falls back to the default font without an error. Also, adding a font requires rebuilding the native side.
Why should icons be SVG rather than bitmap images in a mobile app?
A.They stay sharp at any density and can be recoloured
B.SVGs are cached automatically while bitmaps are not
C.SVGs draw faster than bitmaps on every device
D.An SVG is always lighter than a bitmap in every case
Answer: A
One vector file serves every pixel density, with no image set needed per resolution, and recoloring via a property means a single icon works for both light and dark mode. In return, very complex shapes may render slower than bitmap images.
A map with thousands of markers is janky. What is the right approach?
A.Cluster the points and only draw those in the viewport
B.Shrink each point's icon
C.Turn off the animation while panning the map
D.Load every point at once when the screen opens
Answer: A
Cluster the points by zoom level and only show those inside the current viewport. Thousands of individual views overload the native layer, while clustering keeps the view count in the dozens regardless of the total number of points.
What extra step should precede uploading a photo from a phone?
A.Resize and compress the image on the device
B.Split the image into several small files and reassemble on the server
C.Rename the file with the user's id before sending
D.Convert the image to a base64 string
Answer: A
Downscale and compress on the device before sending. Original camera photos are usually several megabytes, so sending them raw wastes mobile data, easily times out on weak networks, and the server still has to downscale them anyway.
How should on-device biometric authentication be understood in a security design?
A.A local unlock layer rather than a replacement for authentication
B.A way to store the user's password more safely
C.A way to encrypt the data travelling between app and server
D.A way to authenticate the user to the server in place of a password
Answer: A
Biometrics are a local unlock layer: they protect access to the session stored on the device, not an identity proof sent to the server. The server still has to authenticate with a token and check permissions as usual.
Why agree an event naming convention before adding analytics?
A.The analytics service rejects names not following a standard
B.The event name affects the application's performance
C.A convention reduces the amount of data sent
D.Inconsistent data is hard to analyse
Answer: D
Without a convention, everyone names things their own way, and after a few months the dashboard is full of near-identical events that can't be joined. Fixing it later is expensive because historical data was already recorded under the old names and can't be changed.
What mobile-specific problem do feature flags solve?
A.Fully replacing the need for testing before release
B.Reducing the app size because disabled features are not bundled
C.Turning off a broken feature without waiting for a new release to be approved
D.Allowing interface updates without new code
Answer: C
On mobile, a bug fix has to go through review and users may not update for weeks. Feature flags let you instantly disable a broken feature on already-installed builds, and gradually roll out a new feature to a subset of users.
Where should an app get its light or dark mode setting?
A.Only from an option the user sets inside the app
B.From the device's time of day
C.From a per-account setting stored on the server
D.From the system setting, with an override allowed
Answer: D
Default to following the system setting and allow an in-app override with three choices: follow system, always light, always dark. The override value is stored locally because it belongs to the device, not the account.
What scope should on-device end-to-end tests focus on?
A.A few flows critical to the product
B.The computation and data conversion functions
C.Every screen in the application
D.The appearance of each small component
Answer: A
Keep them few and focused on critical paths: login, payment, and the core business flows that generate revenue. Each run costs minutes and is prone to flakiness, so covering broadly with unit tests and component tests is far more economical.
An app must work offline. What is the hardest part?
A.Storing the data on the device
B.Resolving conflicts when the changes are synced back
C.Showing the pending-sync state
D.Detecting whether the device has a network
Answer: B
The hard part is conflicts: the same record gets modified on the device and on the server while offline. You have to choose between last-write-wins, keeping the server version, merging field by field, or asking the user, and each option has a cost.
B.Store it in UTC and display it in the device's zone
C.Store the minutes since the application started
D.Store it in the local time of whoever created the record
Answer: B
Store it in UTC and only convert to the device time zone for display. Users travel, change time zones, and device clocks can be wrong, so the raw data must be independent of all that.
What is the most common memory leak cause in a React Native screen?
A.Using too many components on one screen
B.Setting styles with objects written inline in JSX
C.Event subscriptions and timers that are never cleaned up
D.Fetching data in useEffect rather than in the constructor
Answer: C
Event subscriptions, timers, and realtime connections not cleaned up in the effect's return function. They hold references to the component, so the whole subtree never gets released, and every time the screen is reopened another copy is added.
How should a large project upgrade to a new React Native version?
A.Only upgrade the libraries and keep the React Native version
B.Upgrade directly on the main branch so the whole team fixes it
C.Create a new project and copy the source across
D.Upgrade on a separate branch and diff the native configuration
Answer: D
Upgrade on a separate branch and use the diff tool between the two versions to know exactly which native config files need changes. Then upgrade libraries in small batches and re-test the main thread on both platforms.
How do you reduce JavaScript bundle evaluation time at startup?
A.Move some of the code to the server
B.Compress the JavaScript bundle more heavily at build time
C.Combine every module into a single file
D.Defer loading modules until they are needed
Answer: D
Defer loading modules by requiring them inline at the usage site instead of importing at the top of the file. Modules are only evaluated on first use, so rarely visited screens don't slow down startup.
Beyond the data state, which states must a list screen handle?
A.The user rotating the device to landscape
B.Loading failed, with a retry button
C.Loading for the first time
D.Loaded but with an empty list
Answer: B, C, D
Three minimum states: loading, empty, and error with retry button. Missing the empty state is the most common cause of a blank screen, and missing the error branch leaves users with no way to continue.
Tabs prerendered at launch slow startup. What is the fix?
A.Reduce the tabs to two or three
B.Turn the tabs into screens in a stack
C.Load every tab's data at startup
D.Only build a tab the first time the user opens it
Answer: D
Enable the lazy rendering option for tabs so each tab is only rendered when first opened by the user. Also, only fetch data when the tab is focused instead of fetching everything at startup.
Two fast taps on submit create two orders. What is the durable fix?
A.Show a confirmation dialog before submitting
B.Debounce the tap event for about a second
C.A lock at the state layer plus a server-side idempotency key
D.Disable the button inside the tap handler
Answer: C
Two layers are needed: an isSubmitting flag at the state layer to block the second call and put the button in a pending state, and an idempotent key sent with the request so the server recognizes retries and returns the original record.
How should a message list scroll when a new message arrives?
A.Scroll to the top of the list to show the newest message
B.Never auto-scroll and let the user drag
C.Always scroll to the bottom whenever a new message arrives
D.Only auto-scroll when already near the bottom
Answer: D
Only auto-scroll when the user is near the bottom. If they are reading old messages, show a new-message indicator instead of pulling the view, letting them choose when to jump down.
Which metric best reflects smoothness as real users feel it?
A.The application's average memory usage
B.The proportion of slow frames at the high percentiles
C.The API calls' average response time
D.The session's average frames per second
Answer: B
Look at the high-percentile distribution, e.g., slow frames in the worst 5%. Averages hide jank spikes, and the experience is shaped by exactly those janks.
How should an API key embedded in a mobile app be regarded?
A.A safe secret if it is only sent over an encrypted connection
B.A safe secret if it is stored in the operating system's secure store
C.A safe secret if the code has been minified
D.Public information, since it can be extracted from the installed package
Answer: D
Treat it as public. Any string in the app bundle can be extracted, and code minification doesn't change that. Real secrets must stay on the server; any key that must ship in the app should be scoped and assumed compromised.