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 course image
More practice questions

These questions are part of the practice quiz. Start practicing

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

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy