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

These questions are part of the practice quiz. Start practicing

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

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy