Sample questions
Question 1Easy
In Navigation Compose, each destination is identified by a:
- Intent filter
- Route
- Thread
- Port
Answer: B. Route
Explanation
Routes (strings or type-safe objects) identify composable destinations.
Step-by-step solution
- In Navigation Compose, destinations are added with
composable(route) { ... }. - A
route identifies each destination. navController.navigate(route) moves to it.
Why the other options are wrong
- A. Intent filters are for activities in the manifest.
- C. Threads run code; they do not identify screens.
- D. Ports belong to networking.
Tip: Compose navigation: route = screen address.
Question 2Easy
Which object is used to move between destinations, e.g. navigate("details")?
- NavController
- ViewModelStore
- FragmentManager only
- Intent
Answer: A. NavController
Explanation
Obtain it with rememberNavController() in Compose.
Step-by-step solution
NavController manages the back stack.navigate("details") pushes a destination.popBackStack() goes back.
Why the other options are wrong
- B. ViewModelStore stores ViewModels.
- C. FragmentManager is the older approach.
- D. Intents start Activities.
Question 3Easy
What does navController.popBackStack() do?
- Goes back one screen
- Clears all app data
- Opens a new Activity
- Restarts the NavHost
Answer: A. Goes back one screen
Explanation
It pops the current destination off the back stack.
Step-by-step solution
- The back stack holds visited destinations.
- popBackStack() removes the top one.
- The previous screen shows.
Why the other options are wrong
- B. Data is untouched.
- C. No Activity is involved.
- D. The NavHost is not restarted.
Question 4Easy
In Navigation Compose, which composable hosts the navigation graph?
- Scaffold
- NavHost
- NavDrawer
- LazyColumn
Answer: B. NavHost
Explanation
NavHost displays the destination for the current route.
Step-by-step solution
- NavHost is a composable that hosts the navigation graph.
- It takes a NavController and a start destination.
- It swaps screens based on the current route.
Why the other options are wrong
- A. Scaffold provides layout slots.
- C. NavDrawer is not the host.
- D. LazyColumn is a list.
Question 5Easy
The list of screens the user can return to with Back is called the:
- Back stack
- Task queue
- Call stack
- Heap
Answer: A. Back stack
Explanation
Navigation pushes destinations onto the back stack and pops them on Back.
Step-by-step solution
- Each screen the user opens is pushed onto a stack.
- Pressing Back pops the top screen.
- This stack is called the back stack.
Why the other options are wrong
- B. Task queue is not the Android term.
- C. The call stack holds function calls, not screens.
- D. The heap is memory for objects.
Tip: Back stack = LIFO of screens.
Question 6Medium
The "single-activity architecture" recommended for modern apps means:
- Every screen is a separate Activity
- Activities are replaced by Services
- One Activity hosts all screens
- The app can have only one screen
Answer: C. One Activity hosts all screens
Explanation
Screens are composables or fragments managed by the Navigation component.
Step-by-step solution
- One Activity is the app's entry point.
- Screens are composables or fragments inside it.
- Navigation swaps them within that Activity.
Why the other options are wrong
- A. That is the older many-Activity style.
- B. Services do background work, not UI.
- D. The app can have many screens.
Question 7Medium
A deep link in Android navigation lets:
- Two apps share a database
- The app run without a network
- Screens load faster
- A URL open a given screen
Answer: D. A URL open a given screen
Explanation
Deep links map URIs to destinations so links from email or the web open the right screen.
Step-by-step solution
- A deep link maps a URL or URI to a screen inside the app.
- Tapping such a link opens that screen directly.
- Example: a product link opening the product page.
Why the other options are wrong
- A. Sharing databases uses content providers, not deep links.
- B. Offline support has nothing to do with deep links.
- C. Deep links do not make screens load faster.
Tip: Deep link = URL to a specific screen.
Question 8Medium
Passing a large object (like a full list) as a navigation argument is discouraged because:
- It is slower to type
- Compose forbids objects
- Arguments go in saved state
- Navigation only supports Strings of one letter
Answer: C. Arguments go in saved state
Explanation
Pass a minimal identifier and load the data from the repository in the destination's ViewModel.
Step-by-step solution
- Navigation arguments are saved in the saved-state Bundle.
- Bundles have size limits (about 1 MB per transaction).
- Pass an ID and load the object from a repository instead.
Why the other options are wrong
- A. Typing speed is irrelevant.
- B. Compose does not forbid objects.
- D. Navigation supports several argument types.
Tip: Pass IDs, not objects.
Question 9Hard
After a successful login you navigate to Home and don't want Back to return to Login. What do you use?
- Disable the back button globally
popUpTo(login) with inclusivefinish() the composable- navigate twice to Home
Answer: B. popUpTo(login) with inclusive
Explanation
popUpTo removes destinations from the back stack while navigating; inclusive also removes Login itself.
Step-by-step solution
- navigate("home") { popUpTo("login") { inclusive = true } }.
- popUpTo removes destinations up to login.
- inclusive = true removes login as well, so Back leaves the app.
Why the other options are wrong
- A. Disabling Back globally breaks expected behaviour.
- C. Composables cannot be finished.
- D. Navigating twice stacks duplicates.
Practise all 9 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 →