Basic Android Interview Questions for Application Developers

android_pictures

If you are thinking to hire an application android developer you might need to ask some questions during the phonescreen interview. This post brings some essential questions:

  1. How do you prevent the UI from locking up when performing long operations?
  • You can use async operations, threads or bond to background services like AIDL

 

  1. What Android layout property value should you use to have the container resize to it’s content?
  • Content wrap.

 

  1. Can you override a protected method from a derived class?
  • Yes, except if they have “final” statement.

 

  1. What are the 3 main sections of an Async task
  • onPreExecute  (or just pre execute)
  • doInBackground
  • onPostExecute (or just post execute)

 

  1. Give an example where an Async task would be beneficial
  • Imagine that you have software that communicates over serial port and you need to save the log file in the sdcard partition for the protocol frames received. If you make direct call to the file system (fs) the device might have the performance impacted because writing to the fs is very costy. Using the doInBackground from assync task will improve the system performance.

 

  1. What are the main parts of the Activity Lifecycle
  • onCreate – first call.. not UI component visible
  • onStart – after onCreate and the UI component is starting to get visible.
  • onResume – when we resume the activity from a sleep or activity context change (if the dalvik did not remove the object using the garbage collector). Usually we register the broadcast receivers here.
  • onPause – when the device sleeps or the activity context is changed without action of garbage colletor. Usually we unregister the broadcast receivers here.
  • onStop – we are stopping the activity and still have UI components visible
  • onDestroy – no UI component visible and activity being destroyed by garbage collector or simply after finish() call.

 

  1. What class do I use to respond to events by listening for messages broadcasted by the Android System?

 

  • BroadcastReceiver

 

  1. What is a canvas?
  • Canvas is a graphic component view used to have a “free” drawing like rectangles, circles, etc.

 

  1. What is Material Design?
  • It is a king of design guidance that google provides.

 

  1. List a few pros and cons of Fragments

 

  • Pros:

-> The screen might be more flexible when you are using devices with large displays like tablets or small displays like phones. Does not mean that the fragments will have the same UI looking but they will be more flexible according to the UI.

-> The fragments are more flexible and might encapsulate the logic being re-usable on different activities.

 

  • Cons:

-> More complex to implement and you need to know how to add them to the activity life cycle like onAttch(), onCreateView(), onActivityCreated(), etc.

 

2 thoughts on “Basic Android Interview Questions for Application Developers

Leave a Reply