Skip to content

BMukhtar/android-interview-questions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a short version of android interview questions. Initially prepared and maintained by Amit Shekhar who is having experience of taking interviews of many Android developers and cracking interviews of top companies.

Contents

Core Android

Base

  • Tell all the Android application components. - Learn from here

  • What is the project structure of an Android Application? - Learn from here

  • What is Context? How is it used? - Learn from here

  • What is AndroidManifest.xml? - Learn from here

  • What is Application class?

    • The Application class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created.

Activity and Fragment

  • What is Activity and its lifecycle? - Learn from here

  • What is the difference between onCreate() and onStart() - Learn from here

  • When only onDestroy is called for an activity without onPause() and onStop()? - Learn from here

  • Why do we need to call setContentView() in onCreate() of Activity class? - Learn from here

  • What is onSavedInstanceState() and onRestoreInstanceState() in activity?

    • onSavedInstanceState() - This method is used to store data before pausing the activity.
    • onRestoreInstanceState() - This method is used to recover the saved state of an activity when the activity is recreated after destruction. So, the onRestoreInstanceState() receive the bundle that contains the instance state information.
  • What is Fragment and its lifecycle. - Learn from here

  • What are "launch modes"? - Learn from here

  • What is the difference between a Fragment and an Activity? Explain the relationship between the two. - Learn from here

  • When should you use a Fragment rather than an Activity?

    • When you have some UI components to be used across various activities
    • When multiple view can be displayed side by side just like viewPager
  • What is the difference between adding/replacing fragment in backstack? - Learn from here

  • Why is it recommended to use only the default constructor to create a Fragment? - Learn from here

  • How would you communicate between two Fragments? - Learn from here

  • What is retained Fragment?

    • By default, Fragments are destroyed and recreated along with their parent Activity’s when a configuration change occurs. Calling setRetainInstance(true) allows us to bypass this destroy-and-recreate cycle, signaling the system to retain the current instance of the fragment when the activity is recreated.
  • What is the purpose of addToBackStack() while commiting fragment transaction?

    • By calling addToBackStack(), the replace transaction is saved to the back stack so the user can reverse the transaction and bring back the previous fragment by pressing the Back button. For more Learn from here

Views and ViewGroups

  • What is View in Android? - Learn from here

  • Difference between View.GONE and View.INVISIBLE? - Learn from here

  • What are ViewGroups and how they are different from the Views?

    • View: View objects are the basic building blocks of User Interface(UI) elements in Android. View is a simple rectangle box which responds to the user’s actions. Examples are EditText, Button, CheckBox etc. View refers to the android.view.View class, which is the base class of all UI classes.
    • ViewGroup: ViewGroup is the invisible container. It holds View and ViewGroup. For example, LinearLayout is the ViewGroup that contains Button(View), and other Layouts also. ViewGroup is the base class for Layouts.
  • What is a Canvas? - Learn from here

  • Tell about Constraint Layout - Learn from here

  • Do you know what is the view tree? How can you optimize its depth? - Learn from here

Displaying Lists of Content

Dialogs and Toasts

Intents and Broadcasting

  • What is Intent? - Learn from here

  • What is an Implicit Intent? - Learn from here

  • What is an Explicit Intent? - Learn from here

  • What is the function of an IntentFilter? - Learn from here

  • What is a PendingIntent?

    • If you want someone to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent.

Inter-process Communication

Long-running Operations

Data Saving

  • How to persist data in an Android app? - Learn from here

  • How would you preserve Activity state during a screen rotation? - Learn from here

  • What are different ways to store data in your Android app? - Learn from here

  • Explain Scoped Storage in Android. - Learn from here

  • How to encrypt data in Android? - Learn from here

  • What is commit() and apply() in SharedPreferences?

    • commit() returns a boolean value of success or failure immediately by writing data synchronously.
    • apply() is asynchronous and it won't return any boolean response. If you have an apply() outstanding and you are performing commit(), then the commit() will be blocked until the apply() is not completed.

Look and Feel

Supporting Different Screen Sizes

Android Jetpack

Others

Android Libraries

Android Architecture

Android Unit Testing

Android Tools And Technologies

Kotlin

License

   Copyright (C) 2020 MINDORKS NEXTGEN PRIVATE LIMITED

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Contributing to Android Interview Questions

Just make pull request. You are in!

About

Your Cheat Sheet For Android Interview - Android Interview Questions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 55.0%
  • Kotlin 45.0%