Show Menu
Cheatography

Android - Interview Cheat Sheet (DRAFT) by

This is a cheat sheet for Android Interviews

This is a draft cheat sheet. It is a work in progress and is not finished yet.

General Questions

This interview will have different sections. In this first part, I would like to talk about your experience and backgr­ound.
------­---­---­---­---­---­---­---­---­---­---­---­---­-----
Would you like to go ahead and tell me about it?
Which is the most challe­nging project that you have faced so far?
Did you run into any obstacles with this project and how did you handle the issue?
About the teams you have been involved in - Were they distri­buted in other countries?
About the Method­ology - Was it agile?
Did you usually follow all the ceremo­nies?
Have you ever lead a team?
 

Android Core

Tell all the Android applic­ation compon­ents.
Activi­ties, Services, Broadcast Receiver, and Content Provider.
What is Context? How is it used?
- Interface to global inform­ation about an applic­ation environment.
- It allows access to applic­ati­on-­spe­cific resources and classes, as well as up-calls for applic­ati­on-­level operations such as launching activi­ties, broadc­asting and receiving intents, etc.
How many contexts can you mention?
Applic­ation & Activity
What is the Androi­dMa­nif­est.xml
- All App components are declared in this file.
- User permis­sions that the app requires.
- Declares hardware and software features used or required by the app
- Declares API libraries the app needs to be linked (Maps)
What is Applic­ation class?
- Base class that contains all other components.
- It is instan­tiated before any other class when the process for your applic­ati­on/­package is created.

Activities

What is an Activity?
An activity is the entry point for intera­cting with the user
Can you explain the life cycle of the Activity?
What happens when the device is rotated?
How do you avoid this inform­ation to be lost?
onSave­dIn­sta­nce­State() - This method is used to store data before pausing the activity.
onRest­ore­Ins­tan­ceS­tate() - This method is used to recover the saved state of an activity when the activity is recreated after destru­ction.
What if I want to send info from one activity to another?
Intents (primitive types)
But what if I want to send an Object?
Parcelable or Serial­izable
Can an Activity be opened from another App?
Yes, you need to add an
<in­ten­t-f­ilt­er>
element in your manifest file for the corres­ponding
<ac­tiv­ity>
element.

Services

What is a Service?
Long-r­unning operations in the background
Foreground Service?
Performs some operation that is noticeable to the user
Background Service?
Performs an operation that isn't directly noticed by the user.
Bound Service?
- A bound service offers a client­-server interface that allows components to interact with the service.
- bindService()
- Runs only as long as another applic­ation component is bound to it
Service vs Intent­Service
Service:
Block UI, Main Thread, Short tasks, Need to stop it
Intent­Ser­vice:
Async, Need an intent, Worker thread, Not need to stop it
What is a JobSch­eduler?