๐ŸŒ Android Development ยท flashcards

Android Development Kotlin Programming Flashcards

51 question-and-answer cards covering Kotlin Programming as it is examined in Android Development. 24 of them are printed below, taken from across the deck โ€” no signup, no paywall on the preview.

51Cards in deck
24Free preview
22Syllabus topics
~224Chars per answer
FreePrice

24 sample cards from the Kotlin Programming deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. What is the trailing lambda convention in Kotlin?

    If the last parameter of a function is a lambda, it can be placed outside the parentheses: list.filter { it > 0 }. If the lambda is the only argument, the parentheses can be omitted entirely.

  2. What is a coroutine in Kotlin?

    A coroutine is a lightweight, suspendable computation for asynchronous, non-blocking programming. Many coroutines can run on few threads because suspension frees the thread rather than blocking it. Provided by the kotlinx.coroutines library.

  3. What does the suspend keyword do in Kotlin?

    suspend marks a function that can pause (suspend) execution without blocking the underlying thread and resume later. Suspend functions can only be called from another suspend function or a coroutine builder like launch or async.

  4. Compare the launch and async coroutine builders.

    launch starts a coroutine that does not return a result and returns a Job (fire-and-forget). async starts a coroutine that computes a value and returns a Deferred<T>, whose result is retrieved by calling await().

  5. What is a CoroutineScope and why does structured concurrency matter?

    A CoroutineScope defines the lifecycle and context in which coroutines run. Structured concurrency ties child coroutines to their scope, so cancelling or completing the scope cancels/awaits all children, preventing leaks. Examples: viewModelScope, lifecycleScope.

  6. What is a Dispatcher in Kotlin coroutines and name the main ones.

    A CoroutineDispatcher determines which thread(s) a coroutine runs on. Dispatchers.Main (UI thread), Dispatchers.IO (blocking I/O like network/disk), Dispatchers.Default (CPU-intensive work), and Dispatchers.Unconfined.

  7. What is the difference between a List and a MutableList in Kotlin collections?

    List is a read-only interface (only accessors like get, size); it cannot be modified through that reference. MutableList adds mutating operations (add, remove, set). listOf() creates a read-only list; mutableListOf() creates a mutable one.

  8. Name Kotlin's three main collection types and their factory functions.

    List (ordered, allows duplicates) via listOf/mutableListOf; Set (unordered, unique elements) via setOf/mutableSetOf; Map (key-value pairs) via mapOf/mutableMapOf. Each has read-only and mutable variants.

  9. What do the map, filter, and reduce collection functions do?

    map transforms each element and returns a new collection. filter keeps elements matching a predicate. reduce/fold accumulates elements into a single value (fold takes an initial value). All are higher-order functions that take lambdas.

  10. What is the difference between a Sequence and a List for chained operations?

    A List processes each operation eagerly, creating an intermediate collection at each step. A Sequence processes elements lazily, one element through the whole chain at a time, avoiding intermediates โ€” more efficient for large data or long chains.

  11. List Kotlin's five scope functions.

    let, run, with, apply, and also. They execute a block of code in the context of an object, differing in how the object is referenced (this vs it) and what they return (the lambda result vs the object itself).

  12. Compare apply and also scope functions.

    Both return the context object itself (useful for chaining/configuration). apply references the object as this (implicit receiver, good for setting properties). also references it as it (good for side effects like logging or validation).

  13. Compare let and run scope functions.

    Both return the lambda result. let references the object as it and is common for null-checks (obj?.let { }) and scoping locals. run references the object as this and is handy for object configuration that computes a result.

  14. How do you use string templates in Kotlin?

    String templates embed expressions in a string with $. A simple variable: "Hello $name". An arbitrary expression uses braces: "Sum is ${a + b}". This avoids manual concatenation.

  15. What is a raw (triple-quoted) string in Kotlin?

    A raw string is delimited by triple quotes ("""...""") and contains no escaping โ€” it preserves newlines and special characters literally. trimIndent() or trimMargin() is used to remove leading indentation.

  16. Name three common Kotlin String functions for manipulation.

    length (character count), substring(start, end), uppercase()/lowercase(), trim(), split(delimiter) (returns a List), replace(old, new), and contains/startsWith/endsWith. Strings are immutable, so these return new strings.

  17. In Android, what does the 'Getting Started' step of enabling Kotlin involve for a new project?

    In Android Studio, select Kotlin as the project language; the wizard applies the Kotlin Gradle plugin, adds the kotlin-stdlib dependency, and generates Activities in Kotlin. Existing Java projects can add Kotlin via 'Configure Kotlin in Project'.

  18. What were Kotlin Android Extensions (kotlin-android-extensions) used for?

    They provided synthetic view binding โ€” importing kotlinx.android.synthetic.* let you access views directly by their XML id without findViewById. The plugin is now deprecated in favor of View Binding / Jetpack Compose.

  19. Why were Kotlin synthetics (Kotlin Android Extensions) deprecated, and what replaced them?

    Synthetics polluted the global namespace, exposed views from other layouts, and weren't null-safe or type-safe across modules. They were deprecated in 2020 and replaced by Jetpack View Binding (and Jetpack Compose).

  20. In Android, how do coroutines help avoid blocking the main thread?

    Long-running work (network, database) runs in a coroutine on a background dispatcher (Dispatchers.IO) using withContext, while UI updates happen on Dispatchers.Main. This keeps the UI responsive without callbacks, replacing AsyncTask.

  21. What lifecycle-aware coroutine scopes does Android Jetpack provide?

    viewModelScope (tied to a ViewModel, cancelled when it clears), lifecycleScope (tied to a Lifecycle owner like an Activity/Fragment), and repeatOnLifecycle for collecting flows only in a given state. They enforce structured concurrency and prevent leaks.

  22. What frameworks are commonly used for unit testing Kotlin code?

    JUnit (4 or 5) as the test runner with kotlin.test assertions, MockK for Kotlin-friendly mocking, and for coroutines kotlinx-coroutines-test (runTest, TestDispatcher). AssertJ or Truth are common assertion libraries.

  23. How do you write and run a basic unit test in Kotlin with JUnit?

    Annotate a function with @Test inside a test class and assert an expected outcome: @Test fun addsNumbers() { assertEquals(4, add(2, 2)) } Test files live in src/test/kotlin and are run via ./gradlew test.

  24. How do you test suspend functions and coroutines in unit tests?

    Use runTest from kotlinx-coroutines-test, which provides a controlled TestScope with virtual time so delays are skipped instantly: @Test fun example() = runTest { val result = fetchData() assertEquals(expected, result) }

What this deck covers

The Kotlin Programming deck follows the Android Development Kotlin Programming syllabus โ€” 8 chapters and 22 topics โ€” so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 6.4 cards per chapter.

Answers are written to be recallable, not just readable โ€” averaging about 224 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Kotlin Programming flashcards FAQ

How many Kotlin Programming flashcards are in this Android Development deck?

51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these Android Development flashcards free?

Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.

What do the Kotlin Programming cards cover?

They follow the Android Development Kotlin Programming syllabus โ€” 8 chapters and 22 topics โ€” so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.