/android-interview-questions

Your Cheat Sheet For Android Interview - Android Interview Questions

Primary LanguageJavaApache License 2.0Apache-2.0

AndroidInterviewQuestions

Android Interview Questions

Mindorks Mindorks Community

Android Interview Questions - Your Cheat Sheet For Android Interview

We will be adding answers to the more questions on our Mindorks website.

Prepared and maintained by Amit Shekhar who is having experience of taking interviews of many Android developers and cracking interviews of top companies.

Contents

Data Structures And Algorithms

The level of questions asked on Data Structures And Algorithms totally depends on the company for which you are applying.

  • Array
  • LinkedList
    • A LinkedList, just like a tree and unlike an array, consists of a group of nodes which together represent a sequence. Each node contains data and a pointer. The data in a node can be anything, but the pointer is a reference to the next item in the LinkedList. A LinkedList contains both a head and a tail. The Head is the first item in the LinkedList, and the Tail is the last item. A LinkedList is not a circular data structure, so the tail does not have its pointer pointing at the Head, the pointer is just null. The run time complexity for each of the base methods are as follows:

      Algorithm Average Worst Case
      Space O(n) O(n)
      Search O(n) O(n)
      Insert O(1) O(1)
      Delete O(1) O(1)
  • DoublyLinkedList
  • Stack
  • Queue
  • PriorityQueue
  • Dynamic Programming
  • String Manipulation
  • Binary Tree
  • Binary Search Tree
  • Sorting Algorithms
  • Hash Table or Hash Map
  • Breadth First Search
  • Depth First Search
  • Greedy Algorithm

Core Java

  • Explain OOP Concept.
  • Differences between abstract classes and interfaces? link
    • An abstract class, is a class that contains both concrete and abstract methods (methods without implementations). An abstract method must be implemented by the abstract class sub-classes. Abstract classes are extended.
    • An interface is like a blueprint/contract of a class. It contains empty methods that represent what all of its subclasses should have in common. The subclasses provide the implementation for each of these methods. Interfaces are implemented.
  • What is serialization? How do you implement it?
    • Serialization is the process of converting an object into a stream of bytes in order to store an object into memory so that it can be recreated at a later time while still keeping the objects original state and data. In Java there are two methods of doing this, one is by implementing Serializable or Parcelable. In Android, however, Serializable should never be used in Android. Parcelable was created to be more efficient then Serializable, and performs about 10x faster then Serializable because Serializable uses reflection which is a slow process and tends to create a lot of temporary objects which may cause garbage collection to occur more often.
  • What is Singleton class?
  • What are anonymous classes?
  • What is the difference between using == and .equals on a string?
  • What is the hashCode() and equals() used for?
  • What are these final, finally and finalize?
  • What is memory leak and how does Java handle it?
  • What is garbage collector? How it works? -All objects are allocated on the heap area managed by the JVM. As long as an object is being referenced, the JVM considers it alive. Once an object is no longer referenced and therefore is not reachable by the application code, the garbage collector removes it and reclaims the unused memory.
  • Arrays vs ArrayLists.
  • HashSet vs TreeSet.
  • Typecast in Java.
  • Difference between method overloading and overriding.

Overloading and Overriding

Overloading happens at compile-time while Overriding happens at runtime: The binding of overloaded method call to its definition has happens at compile-time however binding of overridden method call to its definition happens at runtime.

Static methods can be overloaded which means a class can have more than one static method of same name. Static methods cannot be overridden, even if you declare a same static method in child class it has nothing to do with the same method of parent class.

The most basic difference is that overloading is being done in the same class while for overriding base and child classes are required. Overriding is all about giving a specific implementation to the inherited method of parent class.

Static binding is being used for overloaded methods and dynamic binding is being used for overridden/overriding methods. Performance: Overloading gives better performance compared to overriding. The reason is that the binding of overridden methods is being done at runtime.

Private and final methods can be overloaded but they cannot be overridden. It means a class can have more than one private/final methods of same name but a child class cannot override the private/final methods of their base class.

Return type of method does not matter in case of method overloading, it can be same or different. However in case of method overriding the overriding method can have more specific return type (refer this).

Argument list should be different while doing method overloading. Argument list should be same in method Overriding.

  • What are the access modifiers you know? What does each one do?
  • Can an Interface extend another Interface?
  • What does the static word mean in Java?
  • Can a static method be overridden in Java?
  • What is Polymorphism? What about Inheritance?
  • What is the difference between an Integer and int?
  • Do objects get passed by reference or value in Java? Elaborate on that.
  • What is a ThreadPoolExecutor? Link
  • What the difference between local, instance and class variables?
  • What is reflection? Link
  • What are strong, soft and weak references in Java?
  • What is dependency injection? Can you name few libraries? Have you used any?
  • What does the keyword synchronized mean?
  • What does it means to say that a String is immutable?
  • What are transient and volatile modifiers?
  • What is the finalize() method?
  • How does the try{}finally{} works?
  • What is the difference between instantiation and initialization of an object?
  • When is a static block run?
  • Explain Generics in Java?
  • Difference between StringBuffer and StringBuilder?
  • How is a StringBuilder implemented to avoid the immutable string allocation problem?
  • What is Autoboxing and Unboxing?
  • What’s the difference between an Enumeration and an Iterator?
  • What is the difference between fail-fast and fail safe in Java?
  • What is Java priority queue?
  • What are the design patterns? Link

Core Android

  • Explain activity lifecycle.
  • Tell all the Android application components.
  • Service vs IntentService. Link
  • What is the structure of an Android Application?
  • How to persist data in an Android app?
  • How would you perform a long-running operation in an application?
  • How would you communicate between two Fragments?
  • Explain Android notification system?
  • How can two distinct Android apps interact?
  • What is Fragment?
  • Why is it recommended to use only the default constructor to create a fragment? Link
  • Why Bundle class is used for data passing and why cannot we use simple Map data structure
  • Explain the lifecycle of a Fragment. Link
  • What is Dialog in Android?
  • What is View in Android?
  • Can you create custom views? How?
  • What are ViewGroups and how they are different from the views?
  • What is the difference between a fragment and an activity? Explain the relationship between the two.
  • What is the difference between Serializable and Parcelable? Which is the best approach in Android?
  • What are "launch modes"? Link
  • What are Intents? Link
  • What is an Implicit Intent?
  • What is an Explicit Intent?
  • What is an AsyncTask?
  • What is a BroadcastReceiver? Link
  • What is a LocalBroadcastManager? Link
  • What is a JobScheduler? Link
  • What is DDMS and what can you do with it?
  • What is the support library? Why was it introduced?Link
  • What is a ContentProvider and what is it typically used for?
  • What is Android Data Binding? Link
  • What are Android Architecture Components? Link
  • What is ADB?
  • What is ANR? How can the ANR be prevented?
  • What is AndroidManifest.xml?
  • Describe how broadcasts and intents work to be able to pass messages around your app?
  • How do you handle Bitmaps in Android as it takes too much memory?
  • What are different ways to store data in your Android app?
  • What is the Dalvik Virtual Machine?
  • What is the relationship between the life cycle of an AsyncTask and an Activity? What problems can this result in? How can these problems be avoided?
  • What is the function of an intent filter?
  • What is a Sticky Intent? Link
  • What is AIDL? Enumerate the steps in creating a bounded service through AIDL.
  • What are the different protection levels in permission?
  • How would you preserve Activity state during a screen rotation? Link
  • Relative Layout vs Linear Layout.
  • How to implement XML namespaces?
  • Difference between View.GONE and View.INVISIBLE?
  • What is the difference between a regular bitmap and a nine-patch image?
  • Tell about the bitmap pool. Link
  • How to avoid memory leaks in Android?
  • What are widgets on Home-Screen in Android?
  • What is AAPT?
  • How do you find memory leaks in Android applications?
  • How do you troubleshoot a crashing application?
  • Why should you avoid to run non-ui code on the main thread?
  • How did you support different types of resolutions?
  • What is Doze? What about App Standby?
  • What can you use for background processing in Android?
  • What is ORM? How does it work?
  • What is a Loader?
  • What is the NDK and why is it useful?
  • What is the StrictMode? Link
  • What is Lint? What is it used for?
  • What is a SurfaceView?
  • What is the difference between ListView and RecyclerView?
  • What is the ViewHolder pattern? Why should we use it?
  • What is a PendingIntent?
  • Can you manually call the Garbage collector?
  • What is the best way to update the screen periodically?
  • What are the different types of Broadcasts?
  • Have you developed widgets? Describe. Link
  • What is Context? How is it used? Link
  • Do you know what is the view tree? How can you optimize its depth?
  • What is the onTrimMemory method?
  • Is it possible to run an Android app in multiple processes? How?
  • How does the OutOfMemory happens?
  • What is a spannable?
  • What is overdraw? Link
  • What is renderscript? Link
  • What are the differences between Dalvik and ART?
  • FlatBuffers vs JSON. Link
  • What are Annotations? Link, Link
  • Tell about Constraint Layout Link
  • HashMap, ArrayMap and SparseArray Link
  • Explain Looper, Handler and HandlerThread. Link
  • How to reduce battery usage in an android application? Link
  • What is SnapHelper? Link
  • How to handle multi-touch in android link

Architecture

  • Describe the architecture of your last app.
  • Describe MVP. Link
  • What is presenter?
  • What is model?
  • Describe MVC.
  • What is controller?
  • Describe MVVM. Link
  • Tell something about clean code Link

Design Problem

  • Design Uber App.
  • Design Facebook App.
  • Design Facebook Near-By Friends App.
  • Design WhatsApp.
  • Design SnapChat.
  • Design problems based on location based app.

Tools And Technologies

Android Test Driven Development

  • What is Espresso? Link
  • What is Robolectric? Link
  • What is UI-Automator? Link
  • Explain unit test.
  • Explain instrumented test.
  • Have you done unit testing or automatic testing?
  • Why Mockito is used? Link
  • Describe JUnit test.

Others

  • Describe how REST APIs work.
  • Describe SQLite.
  • Describe database.
  • Project Management tool - trello, basecamp, kanban, jira, asana.
  • About build System - gradle, ant, buck.
  • Reverse Engineering an APK.
  • What is proguard used for?
  • What is obfuscation? What is it used for? What about minification?
  • How do you build your apps for release?
  • How do you control the application version update to specific number of users?
  • Can we identify users who have uninstalled our application?
  • APK Size Reduction. Link
  • Android Development Best Practices. Link
  • Android Code Style And Guidelines. Link
  • Have you tried Kotlin? Link
  • What are the metrics that you should measure continuously while android application development? Link

Found this project useful ❤️

  • Support by clicking the ⭐ button on the upper right of this page. ✌️

Check out Mindorks awesome open source projects here

License

   Copyright (C) 2017 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!