All questions

Kotlin and Android From Scratch Practice Test

Browse all practice questions for the Kotlin and Android From Scratch Practice Test. Search by topic, open any question and review its full explanation, then test yourself in the practice quiz.

Kotlin and Android From Scratch Practice Test 2026 – Your Complete Guide to Mastering App Development! course image
All questions

These questions are part of the practice quiz. Start practicing

  • What is the name of the thread responsible for updating the screen in an Android app?
  • What does the `lateinit` keyword do in Kotlin?
  • What are the main differences between `ArrayList` and `List` in Kotlin?
  • Which statement is true about abstract classes?
  • What does the MutableLiveData class allow you to do?
  • What happens if an abstract function is not implemented in a subclass?
  • How do you define a variable in Kotlin that can only be assigned once?
  • What is a key difference between a class and an instance?
  • In which method should you handle the actions when a button in the app bar is pressed?
  • What is a key benefit of class inheritance in programming?
  • What is similar to a promise or future in other languages and serves as a placeholder for a return value?
  • Which of the following can be serialized using Moshi?
  • Which of the following is NOT a characteristic of Snackbar?
  • What does `super.onCreate(savedInstanceState)` do in Android development?
  • Which of the following is NOT a way to create a comment in Kotlin?
  • How would you modify the main() function to print a 6-layer cake for a 4th birthday?
  • What happens if you do not call `super.onCreate(savedInstanceState)` in an Activity?
  • In most apps, would you create coroutines using the global scope?
  • Which of the following is an example of a "constraint" in a ConstraintLayout?
  • How can you serialize data in Kotlin?
  • What does API level signify in the Android development environment?
  • Which of the following are characteristics of a RESTful service?
  • What is the purpose of Gradle in Android development?
  • True or False: Retrofit creates the code required to make network requests based on a web service.
  • What is the output type of the `observe` method in LiveData?
  • In the fragment lifecycle, which task is performed in the onViewCreated() method?
  • What is the primary use of the `ViewModel` in Android architecture components?
  • What is the main purpose of a ViewGroup?
  • Which of the following is true about Kotlin?
  • Which of the following statements is false about async() and runBlocking() in Kotlin?
  • Which statement is true about coroutines?
  • Is it recommended to execute time-consuming tasks in your Activity/Fragment?
  • What keyword is used to declare a property that can be initialized later in Kotlin?
  • What type of data can a class property hold?
  • What can you create multiple of from a single class in object-oriented programming?
  • What is the function of the activity_main.xml file in an Android project?
  • Which of the following best describes a Fragment in Android?
  • What are characteristics of app icons for Android apps?
  • Which function is needed to print output in Kotlin?
  • What is a benefit of using fragments in Android development?
  • How can you start a new activity in Kotlin?
  • Which annotation is used to define a custom Binding Adapter?
  • How do you define a data class in Kotlin?
  • What step can be taken to change the color of your app's theme?
  • What scope do coroutines run in by default?
  • Which of the following are considered pitfalls of directly using threads in your code?
  • What is a good reason for adding comments to your code?
  • What is the role of a MoshiConverterFactory in Retrofit?
  • What is the primary purpose of using Retrofit in Android?
  • How do you define a variable in Kotlin?
  • What does the KotlinJsonAdapterFactory() function do in relation to Moshi?
  • Which component in Android provides lightweight feedback messages?
  • Which of the following is NOT a density qualifier for Android icon resources?
  • What is the correct purpose of the LiveData class in MVVM architecture?
  • What is responsible for determining which thread is used behind the scenes by a coroutine?
  • Which option correctly calls the function and passes valid input arguments?
  • How do sealed classes work in Kotlin?
  • How do you create a new Android project in Android Studio?
  • What is a BroadcastReceiver in Android?
  • What can you use to observe LiveData changes in Kotlin?
  • In the context of ViewModels, what does 'survive configuration changes' mean?
  • Which keywords are valid in conditional statements in Kotlin?
  • When is a ViewModel destroyed?
  • What class is typically used to customize the appearance of a Dialog in Android?
  • What would you use to handle permissions in a modern Android application?
  • Which of the following lifecycle methods can be called when the app returns to the foreground?
  • What can lead to a memory leak in Android applications regarding ViewModels?
  • What keyword is used in Kotlin to declare a suspended function?
  • What is the main purpose of the `init` block in Kotlin?
  • How can you restrict a property's access to only within its class?
  • Which of the following statements correctly defines a variable in Kotlin?
  • What is the purpose of the ActivityCompat class in Android?
  • Which tasks can be performed in onCreate()?
  • Which of the following statements about Retrofit is false?
  • In Android, what is a graphic that can be drawn to the screen referred to as?
  • What error may occur in improperly written XML code for a TextView?
  • What is the function of an Intent in Android?
  • Where do you specify dependencies in Android Studio?
  • Which of the following is NOT a benefit of using grid layouts?
  • What is the main purpose of using LiveData in Android applications?
  • Which statement about binding adapters is correct?
  • What is the correct order of activity lifecycle methods called when an app is opened and then exited using the back button?
  • Which ViewType is used for creating a segmented view in Android?
  • What is the Fragment in the context of Android development?
  • Which method in Activity class is called when the activity is no longer visible to the user?
  • How do you implement a RecyclerView Adapter in Kotlin?
  • What does 'println()' do in Kotlin?
  • Which of the following are Kotlin data types?
  • Is it okay for a ViewModel to directly reference a View class?
  • Why is the Material Components for Android library used?
  • What does "Minimum SDK" refer to in an Android Studio project?
  • Which statement is true regarding the navigation graph file in a note-taking app?
  • If a function already calls a suspend function, must it be marked as a suspend function itself?
  • What is the purpose of using a virtual device or emulator in Android Studio?
  • How do you use Retrofit for network calls in Android?
  • Which keyword is used to define a function in Kotlin?
  • What does the await() function do when used with async in Kotlin?
  • What is the role of the `by lazy` delegation in Kotlin?
  • How does the apply function in Kotlin help in configuring an object?
  • Which of the following are required to load and display an image with Coil?
  • What does the 'fun' keyword represent in Kotlin?
  • What do attributes such as textSize and textColor refer to in Android?
  • What is the primary benefit of using LiveData in an Android app?
  • What concept does a class represent in programming?
  • What is the purpose of the AndroidManifest.xml file?
  • What does IDE stand for in a development context?
  • How can you handle errors in a coroutine?
  • Which of the following are considered Attributes in Android? (Select all that apply)
  • Is it true that onCreateView() is only called once for a fragment's entire lifecycle?
  • Why is it beneficial to use string resources instead of hard-coded strings?
  • What is the primary function of the `@BindingAdapter` annotation?
  • What feature does Kotlin provide for handling nullable types?
  • What is a program in computing?
  • What does the 'override' keyword indicate when used in a subclass?
  • What is the primary use of Shared Preferences in Android?
  • How can you define custom attributes for a View in XML in Android?
  • Which of the following accurately describes the purpose of a ViewModel in Android architecture?
  • Which of the following describes how to create a new project in Android Studio?
  • How can you initiate a long-running task in Kotlin?
  • What type of ViewGroup helps arrange the views in a flexible way?
  • What is an Android Service?
  • What is the purpose of the `object` keyword in Kotlin?
  • How can you create a custom Dialog in Android?
  • In what scenario would you use Local Storage instead of Shared Preferences?
  • What is the correct way to access the shared view model using the Kotlin property delegate approach?
  • In Kotlin, how do you denote a comment in your code?
  • What is primarily stored in the res/layout folder of an Android project?
  • What format is typically used for defining resources in an Android application?
  • Which statement about methods in relation to classes is true?
  • Which statement accurately describes a conditional statement?
  • Why should LiveData be initialized and stored in a ViewModel?
  • In the URL https://google.com/search?q=android, what is '/search' classified as?
  • Which method is typically used to inflate the UI for a fragment?
  • What defines the specifics about a property in an object-oriented context?
  • Which component helps to manage UI-related data lifecycle-consciously in Android?
  • What does the lifecycle method onPause() signify in an activity?
  • How do you handle lifecycle events in Android?
  • What method should be overridden to manage back navigation in an Android Activity?
  • What task should you perform in the onCreateView() method?
  • How do you parse JSON in Kotlin using Kotlinx.serialization?
  • True or False: Every MainActivity class in Android must have a main() function.
  • What is the purpose of a constructor in a class?
  • Which of the following elements is considered a View in an Android app?
  • Which statement about XML layouts in Android is correct?
  • What does the `override` keyword indicate in Kotlin?
  • Which of the following is required for the Moshi library to successfully process JSON in Kotlin?
  • Which task should NOT be done in the onCreateView() method?
  • What does a class describe in object-oriented programming?
  • What does observe allow you to monitor changes in?
  • What is one key advantage of using binding adapters in Android development?
  • In which scenario would the onStop() method be executed for an activity?
  • Which of the following is another benefit of using string resources?
  • Why is DataProviderManager declared with the object keyword?
  • How is LiveData observed in an Activity?
  • In Kotlin, what is the purpose of using data classes in relation to JSON processing?
  • What is the primary purpose of Kotlin in Android development?
  • Which activity lifecycle method is triggered when a dialog obscures an activity?
  • What are Kotlin coroutines used for in Android?
  • What is the purpose of a ViewModel in an Android application?
  • Which of the following cannot be defined in an interface?
  • How do you typically end a block comment in Kotlin?
  • In what way does Kotlin handle nullability?
  • What is the significance of null safety in Kotlin?
  • How do you implement the ViewHolder pattern in RecyclerView?
  • Which of the following can be classified as suspend functions?
  • A Job in Kotlin is defined as what type of unit?
  • What is an Activity in Android?
  • What is a common use for the 'when' keyword in Kotlin?
  • What does the method onDestroy() indicate about an activity?
  • What does Retrofit primarily simplify in Android development?
  • Which Kotlin feature allows extending existing classes without modifying them?
  • What happens when the following code is executed if the intent property is null? val message = intent.extras?.getString("message").toString()
  • Which of the following statements about Gradle is true?
  • In Android, what does `adb` stand for?
  • What is needed to make a network request with Retrofit?
  • How do you create a custom View in Android?
  • Which component is primarily responsible for managing UI in Kotlin Android applications?
  • Which of the following statements about grid layouts is true?
  • What are Kotlin extension functions?
  • Match the HTTP request elements to their corresponding responses: Status Messages, Status Code, HTTP Verb, Content-Type
  • Is it possible to use the same ViewModel for multiple Activities or Fragments to share data?
  • Which of the following statements is false regarding intents?
  • Which of the following is an example of a class?
  • How can you declare a constant in Kotlin?
  • What type of LiveData is used to return a different LiveData instance based on the value of another instance?
  • Which of the following statements is true about the lifecycle of a single activity?
  • How do you achieve dependency injection in Android with Dagger?
  • How does the Android system handle configuration changes like screen rotations?
  • What is the main purpose of a CoroutineScope in Kotlin?
  • What is the difference between `MutableLiveData` and `LiveData`?
  • What is the purpose of the `with` keyword in Kotlin?
  • In Android, what is the primary function of an Adapter?
  • What is the function of the `onCreate` method in an Activity?
  • What is a primary benefit of using a project template in Android Studio?
  • What is a Content Provider in the Android framework?
  • What are reasons to use a ViewModel?
  • In the context of data binding layout expression, what is the correct syntax for adding a click listener attribute to a button?
  • What is the expected output of the given Kotlin code?
  • Which method must be overridden in the host activity for fragment-based navigation?
  • What does `apply` do in Kotlin?
  • In Kotlin coroutines, what represents a lightweight thread?
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy