Sample questions
Question 1Easy
Does React Native's core library ship a full screen-navigation system such as stacks and tabs?
- No; apps use libraries such as React Navigation or Expo Router
- Yes; the core Navigator component handles stacks, tabs and drawers
- Yes; navigation is built into the View component as a prop
- No; each screen must be shipped as a separate native app
Answer: A. No; apps use libraries such as React Navigation or Expo Router
Explanation
Navigation lives in community libraries. React Navigation and Expo Router (built on it) are the most common choices.
Step-by-step solution
- React Native's core library does not include a full navigation system.
- Navigation is provided by community libraries such as React Navigation.
- Expo Router is built on React Navigation, so the answer is option A.
Why the other options are wrong
- B. Stacks, tabs and drawers come from navigation libraries, not the core Navigator in React Native.
- C. Navigation is not a prop of View; it is a library feature.
- D. Screens are not shipped as separate native apps.
Tip: Add React Navigation or Expo Router for stacks, tabs and drawers.
Question 2Easy
What is deep linking in a mobile app?
- Linking two apps so that they share one code bundle
- Preloading every screen into memory at startup
- Linking native libraries into the app at build time
- Opening a given screen from a URL like myapp://item/42
Answer: D. Opening a given screen from a URL like myapp://item/42
Explanation
Deep links map URLs to screens and params, so a link in an email or notification opens the right place in the app.
Step-by-step solution
- A deep link is a URL that opens a specific screen in the app.
- An example is myapp://item/42, which opens the item screen for id 42.
- So deep linking is opening a given screen from a URL, which is option D.
Why the other options are wrong
- A. Deep linking is about URLs and screens, not sharing a code bundle between apps.
- B. Deep linking does not preload screens into memory.
- C. Deep linking is about URLs, not linking native libraries at build time.
Tip: Deep links map a URL to a screen and its params, so emails and notifications can open the right place.
Question 3Easy
A screen is opened with navigation.navigate('Profile', { id: 7 }). How does the Profile screen read the id?
- navigation.id
- route.params.id
- props.id directly
- this.state.params.id
Answer: B. route.params.id
Explanation
Params passed during navigation are available on the route prop (or useRoute()) as route.params.
Step-by-step solution
- The params passed to navigate are stored on the screen's route object.
- The Profile screen reads them from route.params.
- So the id is read as route.params.id, which is option B.
Why the other options are wrong
- A. navigation.id is not where the params are stored.
- C. Params are not passed as props directly in React Navigation.
- D. Params are not in this.state; they are on the route.
Tip: Read navigation params from route.params, or use useRoute() in a function component.
Question 4Easy
Which navigator type typically shows a menu that slides in from the side of the screen?
- Drawer navigator
- Stack navigator
- Bottom tab navigator
- Modal navigator
Answer: A. Drawer navigator
Explanation
A drawer navigator renders a side menu. Tabs sit at the bottom or top, and stacks push screens on top of each other.
Step-by-step solution
- A drawer navigator shows a side menu that slides in from the edge of the screen.
- Bottom tabs sit at the bottom, and stacks push screens on top of each other.
- So the navigator with a side menu is option A, the drawer navigator.
Why the other options are wrong
- B. A stack pushes screens one on top of another; it has no side menu.
- C. Bottom tabs show tabs along the bottom, not a side menu.
- D. A modal screen covers the current screen; it is not a side menu.
Tip: Drawer for a side menu, tabs for top-level sections, and stack for screens that go deeper.
Question 5Medium
Why would an app nest a bottom tab navigator inside a stack navigator?
- Because tab navigators can only be used inside stacks
- So detail screens can be pushed over the tab bar
- To make every tab share one single scroll position
- To stop the tabs from keeping their screens mounted
Answer: B. So detail screens can be pushed over the tab bar
Explanation
A common layout is a root stack whose first screen is the tab navigator. Detail or modal screens are pushed on the stack and cover the tab bar.
Step-by-step solution
- A common layout uses a root stack whose first screen is the tab navigator.
- Detail screens pushed on the stack cover the tab bar.
- So the stack lets detail screens appear over the tabs, which is option B.
Why the other options are wrong
- A. Tab navigators can be used at the top level or inside a stack; they are not limited to stacks.
- C. Scroll positions are per screen and are not shared by tabs in this layout.
- D. Tabs keep their screens mounted once visited, so nesting does not stop that.
Tip: Nest tabs in a root stack when detail or modal screens must cover the tab bar.
Question 6Medium
How does Expo Router decide which routes an app has?
- From a routes.json file the developer edits by hand
- From the files in the app directory
- From the order of screens passed to a navigator prop
- From the native AndroidManifest and Info.plist files
Answer: B. From the files in the app directory
Explanation
Expo Router maps files under app/ to routes, much like file-based routing on the web, and builds on React Navigation underneath.
Step-by-step solution
- Expo Router is file-based.
- Files in app/ become routes.
Why the other options are wrong
- A. No routes.json.
- C. Not from navigator order.
- D. Not native files.
Tip: File = route.
Question 7Medium
Screen A must refetch data every time the user returns to it from screen B. Why is useEffect(fn, []) not enough?
- useEffect never runs in components that are used as screens
- A stays mounted, so its mount-only effect never reruns
- The empty array makes the effect run before every render
- useEffect runs only once per app launch, not per screen
Answer: B. A stays mounted, so its mount-only effect never reruns
Explanation
Because A was never unmounted, its mount effect does not repeat. useFocusEffect or the 'focus' event runs code each time the screen gains focus.
Step-by-step solution
- Screen A stays mounted when the user goes to B and back.
- A mount-only effect runs when the component mounts, and that happens only once.
- So the effect does not run again when A regains focus, which is option B.
Why the other options are wrong
- A. UseEffect runs normally in screens; screens are ordinary components.
- C. An empty array makes the effect run once after mount, not before every render.
- D. UseEffect runs on every mount, not once per app launch.
Tip: Use useFocusEffect or the focus event to run code each time a screen gains focus.
Question 8Medium
In a stack navigator, the user goes from screen A to screen B. What happens to screen A?
- It stays mounted underneath, keeping its state
- It is unmounted and rebuilt when the user returns
- It is paused and its state is written to storage
- It is unmounted only if B is a modal screen
Answer: A. It stays mounted underneath, keeping its state
Explanation
Stack screens below the top one remain mounted, so returning to A shows it exactly as it was. Tab screens are also kept mounted once visited.
Step-by-step solution
- Stack navigators keep screens below the top one mounted.
- When the user goes from A to B, A stays underneath with its state.
- So screen A stays mounted and keeps its state, which is option A.
Why the other options are wrong
- B. A is not unmounted, so it does not have to be rebuilt when the user returns.
- C. The state is kept in memory; it is not written to storage.
- D. A stays mounted whether or not B is a modal.
Tip: Screens below the top of a stack stay mounted, so their state is kept while the user is on a screen above.
Question 9Hard
What is the main reason to choose a native stack navigator over a JavaScript-based stack?
- It allows fully custom JS animations for every screen
- It uses the platform's own navigation primitives
- It works without a NavigationContainer at the root
- It removes the need to declare screens in advance
Answer: B. It uses the platform's own navigation primitives
Explanation
A native stack uses UINavigationController on iOS and fragments on Android, giving native gestures and performance. A JS stack trades that for more customisation.
Step-by-step solution
- A native stack uses the platform's own navigation primitives.
- On iOS that is UINavigationController, and on Android it uses fragments.
- So the main reason is native gestures and performance, which is option B.
Why the other options are wrong
- A. A JS stack allows more custom JS animations; a native stack does not.
- C. Both kinds of stack need a NavigationContainer at the root.
- D. Both kinds still need screens declared in advance.
Tip: Use a native stack for platform-like gestures and speed; use a JS stack for more custom behaviour.
Question 10Hard
What is the recommended way to stop users going 'back' to the login screen after they sign in?
- Render different screens based on auth state
- Call navigate('Home') and then hide the back button
- Disable the hardware back button for the whole app
- Clear AsyncStorage each time the login screen mounts
Answer: A. Render different screens based on auth state
Explanation
If the navigator only defines the signed-in screens when the user is signed in, the login screen does not exist in that state, so nothing can navigate back to it.
Step-by-step solution
- The app defines different screens for signed-in and signed-out users.
- When the user is signed in, the login screen is not in the navigator at all.
- So nothing can navigate back to it, which is option A.
Why the other options are wrong
- B. Navigate and hiding the back button still leave the login screen in the stack.
- C. Disabling the hardware back button affects the whole app and is not the recommended fix.
- D. Clearing AsyncStorage does not change the navigation stack.
Tip: Choose the screens by auth state so that the login screen does not exist after sign-in.
Practise all 14 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →