Android Interview Questions and Answers

In this tutorial, you’ll learn Android-specific interview questions and answers. By Evana Margain Puig.

Leave a rating/review
Save for later
Share

Android is one of the most robust mobile operating systems out there. When you interview for a job as an Android Developer, the number of things you need to know may feel overwhelming. The purpose of this article is to guide you through the most common interview questions and answers. You’ll also find links to resources where you can learn more about each topic.

If you’re a candidate preparing for an interview, this tutorial is for you. By studying these questions, and using the links to dive into topics you’re less familiar with, you can look forward to a brilliant interview! And if you’re a recruiter, you’ll also find these questions helpful as you plan your next candidate interview.

Getting Started

Unlike most of the tutorials on this site, this one doesn’t have a project to download. This tutorial is all about theory, with code snippets to illustrate the concepts. The purpose is to prepare you for a comfortable and successful interview!

Note: you can follow this article in any order you want. You can read it from top to bottom, or you can go to a specific section to fill in the gaps.

Now let’s get started!

Android robot with Ray Wenderlich flag

Android

The first questions are specific to the Android platform.

Android robot reading a book

What Is the Android Manifest?

The Android Manifest is an XML file that must be present in every Android app. It provides information about the app to surrounding systems. These include Android build tools, the Android OS and the Google Play Store.

The Manifest includes many types of information. The main ones are:

  1. Package name
  2. Components of the app, such as activities, fragments and services
  3. Permissions needed from the user

For more details, you can review the App Manifest Overview. This article is in the Android developers website.

What Is the Gradle Build System?

Android Studio uses Gradle for building apps. An Android plugin for Gradle compiles, builds and packages apps or libraries. Gradle files also include dependencies and their versions.

Gradle files, historically, use Groovy as their required language. However, since 2019, you can also use the Kotlin language to code Gradle files in Kotlin apps.

We have two great articles on Gradle. Take a look at both Gradle Tutorial for Android: Getting Started and Gradle Tips and Tricks for Android for a deeper dive.

What Are Activities and Fragments?

An activity is a single thing the user can do within your app. The activity class takes care of creating a window in which you place your UI. A fragment is a small piece of functionality within this activity.

Since 2018, Android recommends creating single-activity apps. An app should consist of fragments within a host activity

What Is the App Lifecycle?

For any Android interview, you should be able to explain the lifecycle of an app. When interviewers ask this question, they’re usually looking for familiarity with the activity’s six callbacks:

  • onCreate()
  • onStart()
  • onResume()
  • onPause()
  • onStop()
  • onDestroy()

You should be able to name each activity and describe what it does and why it’s important. If you’re not sure about these, you can review the article Understand the Activity Lifecycle, in the Android developers website.

What are Configuration Changes and When Do They Happen?

Configuration changes cause Android to restart the activity. They include changes to screen orientation, keyboard availability and multi-window mode. When a configuration change occurs, you must issue a call to onDestroy(). You follow this with a call to onCreate().

This is a key design topic! You’ll want to mention ways to support configuration changes and persist data so you can rebuild your activity. One approach might be to use ViewModels, which you’ll cover later.

Design

As you’re thinking about your new app, you must give careful attention to your UI design. Android provides guidelines on both material design and quality design. These will help you build apps that meets users’ expectations for visual coherence and navigability.

What Is Material Design?

Material design is a design language that Google developed in 2014. It consists of the building blocks for your UI components. This language, and the design principles it embodies, are applicable to Android as well as other applications.

Google provides a detailed guide to material design in its Design guidance and code. You can review this guide while developing your apps.

We also have an introductory tutorial on this subject, An Introduction to Material Design with Kotlin. Check it out!

What Are Quality Guidelines?

Google also provides an extensive list of quality guidelines. You can use this list to ensure that your app adheres to current quality standards. If your app passes these tests, you can be sure it meets your users’ expectations for performance, stability, and security.

You can review the Android Quality Guidelines in the Quality guidelines page of the Android developers website.

How Do You Manage Resources for Different Screen Sizes?

Android devices come in a variety of sizes and resolutions. When you’re building your app, it’s important to decide which of the many models you will support. Once you’ve made this decision, there are three common approaches you can take to make sure your app supports all screen sizes:

  1. Use view dimensions.
  2. Create several layouts, depending on the screen.
  3. Provide your images and resources as bitmaps.

Of course, you may also use a combination of these approaches in your app.

The Android developers website covers this in detail in the article Support different screen sizes.

What Are Layouts in Android?

Layouts define the structure of the UI of an app. They consist of View and ViewGroup objects, arranged hierarchically. There are different types of layout:

  1. Constraint Layout
  2. Linear Layout
  3. Relative Layout

Because this is one of the most complex concepts in Android, we cover layouts in both a video course, Beginning Android Layouts, and a tutorial, ConstraintLayout Tutorial for Android: Getting Started. Please review them if you need a better understanding of this important subject!

What Is a RecyclerView?

Most apps out there contain at least one RecyclerView, so it’s a key topic you should know. A RecyclerView is a widget provided in the Android SDK. It’s used to display a list of elements. RecyclerView is designed to display lists that don’t fit on one screen and require scrolling.

What is RecyclerView Adapter?

The RecyclerView Adapter tells the RecyclerView what to display in each ViewHolder.

What Kind of Layouts Can You Have for RecyclerViews?

When you create a RecyclerView, you have the flexibility to define one of the following layout types.

  1. Linear Layout
  2. Grid Layout

There’s a lot the developer needs to know about RecyclerView. If you need a refresher on this topic, take a look at our course Beginning RecyclerView.

The Android developers website also has a comprehensive article, Create a List with RecyclerView.