250+ Android Development (Kotlin) Interview Questions

1. Android Basics and Fundamentals (25 Questions)

Q1. What is Android and what are its key features?

Android is an open-source, Linux-based operating system designed primarily for touchscreen mobile devices like smartphones and tablets. Key features include an adaptable UI, SQLite for data storage, multi-language support and a powerful notification system.

Q2. Explain the Android Architecture layers.

The Android stack consists of five main layers:

  1. Linux Kernel: Handles hardware drivers and memory management.
  2. Hardware Abstraction Layer (HAL): Connects hardware to higher-level frameworks.
  3. Android Runtime (ART): Uses Ahead-of-Time (AOT) compilation to run apps efficiently.
  4. Java API Framework: Provides the building blocks (Activities, View System, etc.).
  5. System Apps: Pre-installed apps like Email, SMS, and Calendar.

 

Q3. What is the role of the Android Manifest file (AndroidManifest.xml)?

Every Android app must have this file in its root directory. It presents essential information about your app to the Android system, such as:

  • The app’s package name.
  • Components like Activities, Services, and Broadcast Receivers.
  • Permissions required (e.g., Camera, Internet).
  • Hardware and software features required.
Q4. What is an APK and what does it contain?

APK stands for Android Package Kit. It is the file format used to distribute and install apps. It contains:

  • classes.dex (Compiled Java/Kotlin code).
  • AndroidManifest.xml.
  • Resources (images, layouts).
  • Compiled resources (resources.arsc).
Q5. What is the difference between an APK and an AAB (Android App Bundle)?

An APK is a ready-to-install file for a device. An AAB is a publishing format that Google Play uses to generate “split APKs” tailored to a user’s specific device configuration (screen size, CPU architecture), resulting in a smaller download size.

Q6. What is the Dalvik Virtual Machine (DVM) and how is it different from ART?

DVM was used in older Android versions and used Just-in-Time (JIT) compilation. Android Runtime (ART) replaced it, using Ahead-of-Time (AOT) compilation, which compiles the app during installation, making it faster and improving battery life.

Q7. Explain the “Context” in Android.

Context is a handle to the system; it provides access to resources (strings, images), databases and preferences. There are two types:

  • Application Context: Tied to the lifecycle of the entire app.
  • Activity Context: Tied to the lifecycle of a specific activity.
Q8. What are the four main components of an Android App?
  1. Activities: The UI screens.
  2. Services: Background tasks.
  3. Broadcast Receivers: Handling system-wide announcements.
  4. Content Providers: Managing shared app data.
Q9. What is an Intent in Android?

An Intent is a messaging object used to request an action from another app component.

  • Explicit Intent: Starts a specific component (e.g., StartActivity(this, SecondActivity::class.java)).
  • Implicit Intent: Declares a general action (e.g., opening a URL in a browser).
Q10. What is a “Resource” in Android?

Resources are the non-code assets like XML layouts, UI strings, images (drawables), and colors stored in the res/ folder. They allow you to maintain different configurations for different screen sizes and languages.

Q11. Explain the difference between res/ and assets/ folders.
  • res/: Files here are compiled into IDs in the R.java file. You access them via R.layout.name.
  • assets/: Raw files (like custom fonts or large CSVs) that are not compiled and are accessed using a path string.
Q12. What is a Build Variant?

A build variant is a combination of a “build type” (like debug or release) and a “product flavor” (like free or paid). It allows you to create different versions of your app from the same project.

Q13. What is the use of ProGuard/R8?

ProGuard (now replaced by R8) is a tool that shrinks, optimizes, and obfuscates your code. It removes unused code to reduce APK size and makes it harder for others to reverse-engineer your app.

Q14. What is a Toast in Android?

A Toast is a small popup message that appears on the screen for a short duration and disappears automatically.

//Kotlin

Toast.makeText(context, “Hello CodeXRush!”, Toast.LENGTH_SHORT).show()

Q15. What is a Snackbar?

Similar to a Toast, but it appears at the bottom of the screen and can include an action button (like “Undo”).

Q16. What is the purpose of Gradle in Android?

Gradle is an advanced build toolkit that manages dependencies (libraries), compiles the code, and packages the app into an APK/AAB.

Q17. What are the different types of permissions in Android?
  1. Normal Permissions: Low risk (e.g., Internet). Granted automatically.
  2. Dangerous Permissions: High risk (e.g., Camera, Location). Must be requested at runtime.
Q18. What is “ANR” (Application Not Responding)?

ANR occurs when the main UI thread is blocked for too long (usually 5 seconds), preventing the user from interacting with the app.

Q19. How can you prevent ANR?

Always perform heavy tasks (network calls, database operations) on a background thread using Coroutines or WorkManager, keeping the Main Thread free for UI updates.

Q20. What is the difference between View and ViewGroup?
  • View: A UI component like a Button or TextView.
  • ViewGroup: A container that holds Views (e.g., LinearLayout, ConstraintLayout).
Q21. What is the “View System” in Android?

It is a hierarchy of views that defines the UI. The system handles measuring, laying out, and drawing the components on the screen.

Q22. What is the use of id in Android XML?

The id provides a unique name for a View, allowing you to reference and manipulate it in your Kotlin code using findViewById or View Binding.

Q23. What is the dp and sp unit?
  • dp (Density-independent Pixels): Used for layout dimensions to ensure UI looks the same on different screen densities.
  • sp (Scale-independent Pixels): Used for text sizes; it scales based on the user’s font size preferences.
Q24. What is the difference between match_parent and wrap_content?
  • match_parent: The view expands to be as big as its parent.
  • wrap_content: The view expands only as much as needed to fit its content.
Q25. What is an Emulator?

An emulator is a virtual device that runs on your computer, allowing you to test your Android apps without needing a physical phone.

Read the complete eBook on our Android app.

This is just a demo preview. Download our app to unlock all chapters with full access and learn anytime, anywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *

Read the complete eBook on our Android app.

This is just a demo preview.
Download our app to unlock all chapters with full access and learn anytime, anywhere.

Related ebooks

Continue reading