Top 30 Navigation Interview Questions and Answers
30 multiple-choice questions on Navigation, drawn from 30 bites out of the 54 tagged Navigation on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
You repeatedly open Profile screens for different users and want each to stack so back steps through them. Which API and why?
Show the answer
Answer: a · push, because it unconditionally adds a new instance even if the route already exists
push always stacks a new instance, which is what a drill-down chain needs. navigate reuses an existing instance of the route rather than always adding one, and replace removes the current screen from history rather than stacking.
Question 2 of 30
Why is conditionally rendering separate auth and app stacks preferred over calling navigation.navigate after login?
Show the answer
Answer: c · State drives which screens exist, so the old stack is unmounted and unreachable
Declarative conditional rendering ties screen existence to auth state, automatically unmounting unreachable stacks. The navigate approach leaves the login screen on the back stack, which is exactly the bug to avoid.
Read the full bite: Structuring an auth flow in React Navigation
Question 3 of 30
Which approach correctly navigates from an Axios interceptor that runs outside any React component?
Show the answer
Answer: c · Use a navigationRef passed to NavigationContainer and call navigate after isReady
Hooks only work inside components, so useNavigation throws in an interceptor. A navigationRef gives non-React code a stable handle, guarded by isReady to avoid early calls.
Read the full bite: Accessing navigation outside a screen component
Question 4 of 30
You need a header title that updates live as the user edits a text field held in component state. What should you use?
Show the answer
Answer: b · navigation.setOptions inside useLayoutEffect with the state as a dependency
The static options object evaluates outside the component and cannot see evolving state. setOptions in useLayoutEffect updates the header from current state without a visible flash.
Read the full bite: Setting screen options statically versus dynamically
Question 5 of 30
Which callback sequence occurs when a user leaves an Activity and returns later without the system destroying it?
Show the answer
Answer: b · onPause, onStop, onRestart, onStart, onResume
Navigating away triggers onPause and onStop, while returning from the stopped state calls onRestart, onStart, and onResume. onCreate only runs after the Activity has been fully destroyed, so including it is a common misconception.
Read the full bite: Describe the Android Activity lifecycle and callback order
Question 6 of 30
Under which circumstance would a developer most likely choose Stack Navigator over a native navigation solution?
Show the answer
Answer: d · For applications where a highly unique and custom navigation appearance is crucial.
The card states that Stack Navigator is ideal when "having a highly custom look and feel is more important than achieving maximum performance," due to its JavaScript-based implementation allowing deep customization. Option B is incorrect because Stack Navigator trades performance for customization, and option C describes a benefit more aligned with native solutions.
Read the full bite: Stack Navigator: JavaScript-based Screen Transitions
Question 7 of 30
When is a Drawer Navigator the most appropriate choice for an app's primary navigation?
Show the answer
Answer: c · To manage 5 or more distinct, top-level sections that don't require constant on-screen presence.
The card states Drawer Navigators are best for "primary, app-wide navigation, especially with five or more items where a bottom tab bar would feel cluttered." Option C directly reflects this, while options A and B describe use cases for Stack and Bottom Tab Navigators, respectively.
Read the full bite: Drawer Navigator: Your App's Slide-Out Main Menu
Question 8 of 30
How are navigation actions typically processed within a nested navigator structure?
Show the answer
Answer: d · The action is first attempted by the currently focused navigator, then bubbles up to its parent if unhandled.
The card states that actions are first attempted by the currently focused navigator and only bubble up to its parent if that navigator cannot handle the action. This ensures localized control and isolated state for each navigator, rather than immediate global handling.
Read the full bite: Nested Navigators: Building Complex UI Flows
Question 9 of 30
When is tree testing most appropriately utilized in the product development lifecycle?
Show the answer
Answer: b · To evaluate the findability of a proposed navigation structure before any visual design is implemented.
Tree testing is specifically designed to validate a proposed information architecture in a text-only format before any UI is built, focusing purely on the findability of the structure. Option D describes card sorting, which is used to generate an IA, not validate it, and Option C describes a full usability test, which includes visual and interactive elements that tree testing deliberately excludes.
Read the full bite: Tree Testing: Validate Your Site's Navigation Structure
Question 10 of 30
In which scenario would Native Stack Navigator be the least suitable choice for screen navigation?
Show the answer
Answer: d · An app requiring highly customized screen transition animations.
The card explicitly states to avoid Native Stack Navigator if highly customized screen transitions are needed, as its customizability is limited due to being a wrapper around native components. The other options describe scenarios where Native Stack Navigator is the recommended or default choice.
Read the full bite: Native Stack Navigator: Native Performance, Less Customization
Question 11 of 30
Which approach best implements modern SwiftUI navigation from a product list to a detail view using only an identifier?
Show the answer
Answer: d · Use NavigationStack with NavigationLink(value: id), a stack-level navigationDestination(for: Product.ID.self), and a bound NavigationPath.
This uses the iOS 16 value-based API that separates routing state from views, passes only identifiers for loose coupling, and enables programmatic control via NavigationPath. Option C is tempting but wrong because NavigationView triggers legacy split-view behavior on iPad and lacks bound path control.
Read the full bite: Implement SwiftUI navigation between list and detail with product ID
Question 12 of 30
When a user taps a link in your app, launching an external browser, what is the expected behavior upon pressing the back button from the browser?
Show the answer
Answer: b · The user returns to your app, as the browser typically runs in its own distinct task.
The card's canonical example explicitly states that launching an external app like a browser typically creates a new, separate Task. When the user presses the back button from this new task, they are returned to the original app's task. Option A is incorrect because while the browser has its own back stack, the primary action when returning from a separate task is to go back to the originating task.
Question 13 of 30
Which architecture best decouples auth state from the view hierarchy while ensuring smooth transitions and no memory leaks?
Show the answer
Answer: b · Use an app coordinator to swap the window rootViewController on auth changes, crossfade with a snapshot, and nil the outgoing stack.
A dedicated coordinator that swaps the window root and releases the old hierarchy prevents retain cycles and keeps auth logic out of the app delegate. Presenting onboarding modally over the tab bar (D) tightly couples the two flows and forces the main interface to know about authentication state.
Read the full bite: How would you architect the app root for onboarding vs authenticated flows?
Question 14 of 30
How should a parent screen correctly capture data sent back from a route it pushed with Navigator.push?
Show the answer
Answer: c · Await the Future returned by Navigator.push, which completes with the Navigator.pop result.
Navigator.push returns a Future that completes with the value passed to Navigator.pop, so awaiting it is the correct pattern. Reading it synchronously fails because the route is still active and the result is not yet available.
Read the full bite: How do you pass data with Navigator.push and return data with Navigator.pop?
Question 15 of 30
Which statement accurately describes a tradeoff of using Navigator.pushNamed instead of Navigator.push?
Show the answer
Answer: b · It centralizes route definitions but sacrifices compile-time type safety for arguments.
Navigator.pushNamed centralizes routes in a single map, but its arguments parameter is dynamic, requiring casting or wrapper classes to stay safe. Option C is wrong because named routes do not automatically handle complex objects; passing them without casting creates runtime errors and maintenance burden.
Read the full bite: Navigator.push vs Navigator.pushNamed in Flutter
Question 16 of 30
Inside a GoRoute builder for path '/users/:userId', what is the correct way to provide the userId to the target widget?
Show the answer
Answer: d · Read state.params['userId'] and handle the possibility of a null value
GoRouter exposes matched path parameters in the state.params map, and because the map values are nullable Strings you must null-check before using the userId. Using ModalRoute.of or parsing context.location manually bypasses GoRouter's declarative state, while state.extra breaks deep linking and web navigation because it is not serialized to the URL.
Read the full bite: Implement a GoRouter path parameter route and access userId in a widget
Question 17 of 30
Why does StatefulShellRoute.indexedStack preserve a tab's pushed pages and scroll position when the user switches away and returns?
Show the answer
Answer: d · Each branch keeps its own Navigator and stays mounted in the IndexedStack
Each StatefulShellBranch owns a Navigator and remains mounted in the IndexedStack, so its state survives switches. A single shared Navigator (last option) would mix the tabs' histories together.
Read the full bite: Per-tab navigation stacks with StatefulShellRoute
Question 18 of 30
When adding a custom fade-and-scale transition to a GoRoute, which detail is essential to avoid rebuilding the destination page on every animation frame?
Show the answer
Answer: d · Use GoRoute.pageBuilder and return a CustomTransitionPage, passing the child into the transitionsBuilder.
CustomTransitionPage provides a transitionsBuilder whose child parameter is the pre-built page, so nesting it in FadeTransition and ScaleTransition avoids per-frame rebuilds. Option A is wrong because constructing the destination widget inside transitionsBuilder rebuilds the entire route on every animation tick.
Read the full bite: Custom fade-and-scale transition with PageRouteBuilder and GoRoute
Question 19 of 30
What is the recommended, type-safe method for passing a user ID from a list fragment to a detail fragment using the Jetpack Navigation component?
Show the answer
Answer: a · Define an argument in the navigation graph, then use the generated NavDirections and NavArgs classes to pass and retrieve the data.
The correct approach uses the Safe Args plugin to generate type-safe classes for navigation actions and arguments, preventing runtime errors. Manually creating a Bundle is the older, error-prone method that lacks compile-time safety.
Read the full bite: How do you pass data between Fragments with Jetpack Navigation?
Question 20 of 30
Which approach is recommended for passing simple, one-way data between Fragments using Jetpack Navigation?
Show the answer
Answer: a · Define arguments in the navigation graph XML and use the generated Safe Args classes.
The card highlights that defining arguments in the navigation graph XML and using the generated Safe Args classes is the modern, type-safe, and recommended approach. Manually creating Bundles is an older, error-prone method that Safe Args was designed to replace.
Read the full bite: How to pass data between Fragments with Jetpack Navigation?
Question 21 of 30
What is the primary reason to house a login flow inside its own nested navigation graph rather than placing all destinations in the root graph?
Show the answer
Answer: c · To encapsulate login-specific routes and allow the entire flow to be reused or popped as one unit
A nested graph creates a true modular boundary that lets the entire login flow be reused, deep-linked, and cleared at once. Treating it as purely visual grouping ignores the runtime encapsulation and the required start destination contract.
Read the full bite: How would you use a nested navigation graph for a login flow?
Question 22 of 30
For which navigation pattern is UINavigationController primarily designed?
Show the answer
Answer: b · Guiding users through a hierarchical, drill-down sequence of screens.
UINavigationController is designed for hierarchical, 'drill-down' navigation, managing a stack of screens from general to specific. Options A and B describe use cases for UITabBarController and modal presentations, which the card explicitly advises against for this controller.
Read the full bite: UINavigationController: Stack-Based Screen Management
Question 23 of 30
In a large multi-module Android codebase, which pattern correctly implements inversion of control for cross-feature navigation without violating the dependency rule?
Show the answer
Answer: b · Use a shared navigation contract module for route definitions, with each feature contributing handlers to a DI multibinding map resolved by the app module.
B correctly applies inversion of control by isolating features behind a contract module and delegating wiring to the app module via dependency injection. C is tempting but wrong because a monolithic common module still implicitly couples features and becomes an unmaintainable dumping ground.
Read the full bite: How do you navigate between feature modules without direct dependencies?
Question 24 of 30
In a modular app, how can `:feature_A` navigate to a screen in `:feature_B` without creating a direct dependency on `:feature_B`?
Show the answer
Answer: c · Define a navigation interface in a shared `:api` module. `:feature_A` calls the interface, and the `:app` module provides the implementation.
This approach uses dependency inversion. By defining a contract in a shared module, `:feature_A` depends only on the contract, not the concrete implementation, maintaining decoupling. Adding a direct dependency (Option A) is an anti-pattern that negates the benefits of modularization.
Read the full bite: Navigate between feature modules without direct dependencies?
Question 25 of 30
Which approach best describes how NavigationStack programmatically manages its view hierarchy?
Show the answer
Answer: a · It binds to an array of hashable data, where changes to the array reflect the navigation path.
NavigationStack is data-driven, using a binding to an array (the 'path') to represent the navigation stack. Modifying this array directly controls the views on screen, unlike imperative global managers or direct view tree manipulation.
Read the full bite: NavigationStack: Programmatic Navigation in SwiftUI
Question 26 of 30
Which navigation scenario is the primary intended use case for SwiftUI's NavigationLink?
Show the answer
Answer: d · Navigating from a list item to its corresponding detailed information view.
NavigationLink is designed for hierarchical 'push' navigation, such as a master-detail flow where tapping a list item reveals its details. It is explicitly stated not to be used for tab-based navigation (like option C) or modal presentations like full-screen covers (option A) or popovers (option B).
Read the full bite: NavigationLink: Pushing Views in SwiftUI
Question 27 of 30
When should you prefer NavigationSplitView over NavigationStack for an application's primary interface?
Show the answer
Answer: c · For applications that require a multi-column layout to display hierarchical data adaptively across different screen sizes.
NavigationSplitView is designed for adaptive multi-column layouts that present hierarchical data, automatically adjusting to screen size. In contrast, NavigationStack is suitable for simple, linear flows or single-column hierarchies, making option D incorrect.
Read the full bite: NavigationSplitView: Adaptive Layouts for All Screen Sizes
Question 28 of 30
An app needs a single NavigationStack where users can navigate from a Category screen, to a Product screen, to a Review screen, three unrelated model types, and wants to build and restore that exact path programmatically from a push notification. Why is NavigationPath the right tool over a plain array based path?
Show the answer
Answer: b · NavigationPath can hold a single ordered stack of mixed, unrelated Hashable types and reconstruct them, while a typed array path is limited to one concrete type for the whole stack
NavigationPath's core feature is type erasure across a single stack, which is exactly what mixing Category, Product and Review in one path requires. Option B is wrong since NavigationStack does support a plain typed array as its path for simpler, single type flows, and option C is wrong because the back button comes from NavigationStack itself, not from which path type backs it.
Question 29 of 30
What is the fundamental concept guiding screen transitions in Navigation in Compose?
Show the answer
Answer: d · Screens are represented as state, and navigation occurs by changing the current route.
The card explicitly states, "Treat your app's screens like a state machine. Each screen is a composable function identified by a unique string called a 'route'. Navigation is simply the act of changing the current route state." Option C is incorrect because Compose Navigation replaces the fragment-based system.
Question 30 of 30
A shared element transition refuses to animate between two screens. Which cause is most consistent with the views simply jumping with no morph?
Show the answer
Answer: a · The two Animated.Views use different sharedTransitionTag values, so no match is found
Reanimated pairs views only when their sharedTransitionTag strings match exactly; mismatched tags mean no interpolation, so the element just jumps. Native-stack is in fact required, and useNativeDriver is unrelated to Reanimated shared transitions.
Read the full bite: Shared element transitions with Reanimated
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.