NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content

Quiz: Android

Android questions from real interviews as a quiz, with an explanation for every option.

44 questionsAll topicsAndroid

Try it: 5 questions

Loading…

Sample questions

  1. In which situations is it justified to optimize data parsing? Select all that apply.

    • When parsing runs in real time or affects the responsiveness of the UI.
    • Before measuring anything, simply because the parser code looks complicated.
    • When processing a large volume of data and parsing has become a performance bottleneck.
    • When parsing a small static file once at application startup.
    • On a resource-constrained device where memory or processing time matters.
    Full answer
  2. What is the usual way to upload an image file to a server with Retrofit?

    • Put the image in a request header using @Header.
    • Serialize the file as JSON and send it with @Body without multipart encoding.
    • Pass the file as a regular @Query parameter in the request URL.
    • Send it as a multipart/form-data part using @Multipart and MultipartBody.Part.
    Full answer
  3. In MVI, if State is represented by an immutable object, how is one of its properties usually updated?

    • Change the value only in the UI without updating state
    • Create a new ViewModel for every property change
    • Change the property on the existing state object
    • Create a new state object with the changed value and publish it
    Full answer
  4. Which three practices can improve scrolling performance for long lists in Jetpack Compose?

    • Use LazyColumn or LazyRow to create items as needed.
    • Prefer Column for long lists because it creates only the visible items.
    • Use remember for every value so it is recalculated on every scroll.
    • Provide a unique, stable key for each list item.
    • Move expensive work out of composable functions and cache values that can be reused.
    Full answer
  5. How does a memory cache in Android typically handle a data request?

    • It first looks up the key in the cache; on a miss, it fetches the data from the source and may store it for later requests.
    • It refreshes every entry on each request so that all data stays up to date.
    • It always loads data from the original source and uses the cache only to delete data.
    • It stores all data permanently on disk and returns it even after the app restarts.
    Full answer
  6. Which statements about Kotlin sealed class are correct? Select three.

    • Adding a subclass automatically serializes it for network requests.
    • A restricted hierarchy makes it possible to handle every case without requiring an else branch in an exhaustive when.
    • Direct subclasses can be declared in any package and module without restrictions.
    • The hierarchy is useful for modeling a finite set of states, events, or API results.
    • The compiler knows the permitted direct subclasses and can check whether a when is exhaustive.
    Full answer
  7. What problems can arise when using non-string objects as keys in a Java HashMap? Select all that apply.

    • Incorrect equals() or hashCode() implementations can break key lookup and comparison.
    • An expensive hashCode() implementation can slow down map operations.
    • Every key must implement Serializable.
    • HashMap compares non-string keys by reference only and ignores equals().
    • Changing a key after inserting it can make its entry impossible to find.
    Full answer
  8. Which mechanism lets AtomicInteger.incrementAndGet() update its value atomically when threads compete?

    • Compare-and-set (CAS), retrying if a conflict is detected
    • Copying the value into a new object before each update
    • An automatic lock on the whole object for every access
    • Ordinary volatile, which makes any update atomic
    Full answer
  9. Which main phases does UI go through in Jetpack Compose when a frame is produced?

    • View creation → measurement → event handling
    • Composition → measurement and placement → drawing
    • State reading → model update → drawing
    • Composition → recomposition → state remembering
    Full answer
  10. In Java, a Thread object has been created. How do you run its code on a separate thread?

    • Call execute() on the Thread object.
    • Call start() on the Thread object.
    • Create a Runnable object and call start() on it.
    • Call run() on the Thread object.
    Full answer