Android Interview Questions and Answers
In this tutorial, you’ll learn Android-specific interview questions and answers. By Evana Margain Puig.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Android Interview Questions and Answers
30 mins
- Getting Started
- Android
- What Is the Android Manifest?
- What Is the Gradle Build System?
- What Are Activities and Fragments?
- What Is the App Lifecycle?
- What are Configuration Changes and When Do They Happen?
- Design
- How Do You Manage Resources for Different Screen Sizes?
- What Are Layouts in Android?
- What Is a RecyclerView?
- What Are Support Libraries?
- What Is an Intent?
- What Is Localization? How Do You Do It in Android?
- What Is Android Jetpack?
- What are Android Architecture Components?
- Other Libraries
- Where Do You Organize Your Tests in Android?
- Kotlin
- What Are Coroutines?
- What Are Companion Objects?
- How and When Do You Use Nullables in Kotlin?
- How Do You Do Type Checking in Kotlin?
- How Do You Declare Switch Statements in Kotlin?
- What Is a Lambda Expression?
- When Is the Keyword it Used in Lambda Expressions?
- What Is a Class Extension?
- What Are Ranges in Kotlin?
- Object-Oriented Programming
- What Is Polymorphism?
- What Is the Difference Between a Class and an Object?
- What Are Data Classes?
- What Is Encapsulation?
- What Are Visibility Modifiers?
- Where to Go From Here?
What Is the Difference Between a Class and an Object?
A class is a blueprint or template for creating objects. An object is an instance of a class.
Classes don't contain actual data. Classes can have sub-classes, but once you create an object, it remains an instance of the class or sub-class you created it from.
What Are Data Classes?
A data class in Kotlin is a special type of class that exists only to contain data. You declare a data class by providing the name of the class and its attributes, as in this example:
data class Cat(val name: String, val age: Int, val furColor: Color)
This special construct in Kotlin provides standard functionality with minimal coding. Behind the scenes, Kotlin generates getters and setters and an initializer for you. Then you can get on with creating and modifying instances of the object!
For a deeper dive into data classes, see the Data Classes article in the Kotlin Language website.
What Is Encapsulation?
Encapsulation is a primary concept of Object-Oriented Programming. It refers to the bundling of an object with its attributes, state and operations. This simplifies code and protects data integrity.
What Are Visibility Modifiers?
Data encapsulation allows you to control how objects and their behaviors are exposed outside the object. This is called visibility. In Kotlin, there are four levels of visibility, called visibility modifiers: public
, internal
, protected
, and private
. The default is public
.
For more information about Kotlin's visibility modifiers, review the Visibility modifiers article in the Kotlin website.
Where to Go From Here?
In this Android Interviewing tutorial, you reviewed the most important topics you'll encounter in an interview, regardless of your level. There are many other topics you may want to review. See the suggestions below for some other resources.
Design patterns are a very broad topic on Android. Most interviewers will ask you which ones you have used, and they'll ask you to describe a couple of them. Visit our Common Design Patterns for Android with Kotlin tutorial to learn about them.
It is common in interviews to have whiteboard questions related to data structures and algorithms. This is a huge topic by itself. We cover all the associated topics in our book Data Structures and Algorithms in Kotlin. If you have a coding interview, make sure you review these topics!
And if you are interviewing for a more advanced role, you may get architecture questions. For acing those interviews, take a look at our Advanced Android App Architecture Book.
If you have any suggestions, questions, or if you want to show off the new job you just got, join the discussion below.