Android Software Engineer Interview Questions

8,344 android software engineer interview questions shared by candidates

(this is a little easier to explain if it's drawn out, but I'll try my best to do it here) Given some integer N = 2^k which represents an NxN matrix, write a function that fills the matrix with 'L' shapes, such that the entire matrix is filled except for 1 empty space. For example, a 2x2 matrix would have 3 spaces filled with one of the corners empty. And a 4x4 matrix would have the entire outer row of spaces filled, with the center 4 filled the same way the 2x2 matrix is filled.
avatar

Android Developer

Interviewed at Vine

3.9
Apr 19, 2016

(this is a little easier to explain if it's drawn out, but I'll try my best to do it here) Given some integer N = 2^k which represents an NxN matrix, write a function that fills the matrix with 'L' shapes, such that the entire matrix is filled except for 1 empty space. For example, a 2x2 matrix would have 3 spaces filled with one of the corners empty. And a 4x4 matrix would have the entire outer row of spaces filled, with the center 4 filled the same way the 2x2 matrix is filled.

1. Find coordinates of intersection A rectangle is called rectilinear if its edges are all parallel to coordinated axes. Such a rectangle can be described by specifying the coordinated of its lower-left and upper-right corners. Write a function: function solution($K,$L,$M,$N,$P,$Q,$R,$S); that given eight integers representing two rectilinear rectangles (one with lower-left corner (K,L) and upper right corner (M,N), and another with lower-left corner (P,Q) and upper-right corner (R,S)), returns the area of the sum of the rectangles. If the rectangles intersect the area of the intersection should be counted only once. The function should return -1 if the area of the sum exceeds 2,147,483,647. For example Given Integers: K= -4 L = 1 M = 2 N = 6 P = 0 Q = -1 R = 4 S = 3 **the function should return 42** * The area of the First rectangle is 30 and the area of the second rectangle is 16 and the area of their intersection is 4. Assume that * K,L,M,N,P,Q,R and S are integers within the range [-2147483648...2147483647]. * K<M * L<N * P<R * Q<S
avatar

Android Developer

Interviewed at Rakuten

3.6
Nov 20, 2015

1. Find coordinates of intersection A rectangle is called rectilinear if its edges are all parallel to coordinated axes. Such a rectangle can be described by specifying the coordinated of its lower-left and upper-right corners. Write a function: function solution($K,$L,$M,$N,$P,$Q,$R,$S); that given eight integers representing two rectilinear rectangles (one with lower-left corner (K,L) and upper right corner (M,N), and another with lower-left corner (P,Q) and upper-right corner (R,S)), returns the area of the sum of the rectangles. If the rectangles intersect the area of the intersection should be counted only once. The function should return -1 if the area of the sum exceeds 2,147,483,647. For example Given Integers: K= -4 L = 1 M = 2 N = 6 P = 0 Q = -1 R = 4 S = 3 **the function should return 42** * The area of the First rectangle is 30 and the area of the second rectangle is 16 and the area of their intersection is 4. Assume that * K,L,M,N,P,Q,R and S are integers within the range [-2147483648...2147483647]. * K<M * L<N * P<R * Q<S

Q1: If there is a new Android engineer, how will you suggest the best practice of async jobs in Android? (And the detail about AsyncTask, Executor, Thread interrupt, memory leak...and so on) Q2: Give an unsorted array, find the kth smallest item (Can you do it more quickly?)
avatar

Android Developer

Interviewed at Meta

3.6
Dec 18, 2016

Q1: If there is a new Android engineer, how will you suggest the best practice of async jobs in Android? (And the detail about AsyncTask, Executor, Thread interrupt, memory leak...and so on) Q2: Give an unsorted array, find the kth smallest item (Can you do it more quickly?)

You’re writing a monitoring app that periodically checks if a website is up. Of those listed below, what is the BEST way to schedule these periodic checks? A. Register a WakeLock with PowerManager. B. Call setInexactRepeating on AlarmManager. C. Post to a Handler with postDelayed. D. Call setPeriodicTimer on TimerService.
avatar

Android Developer

Interviewed at Meta

3.6
May 1, 2015

You’re writing a monitoring app that periodically checks if a website is up. Of those listed below, what is the BEST way to schedule these periodic checks? A. Register a WakeLock with PowerManager. B. Call setInexactRepeating on AlarmManager. C. Post to a Handler with postDelayed. D. Call setPeriodicTimer on TimerService.

What is the output of the following program? class Poly { static int length; int width; public Poly(int l, int w) { length = l; width = w; } int area() { return 2*length*width; } } class Rect extends Poly { public Rect(int l, int w) { super(l,w); } int area() { return length*width; } } class Solution { public static void main(String args[]) { Poly rect1 = new Poly(5,5); Poly rect2 = new Rect(6,4); int area1 = rect1.area(); int area2 = rect2.area(); System.out.println(area1 + " " + area2); } } 30 24 60 48 60 24 25 24 50 48 48 24 50 24
avatar

Android Developer

Interviewed at Smartprix

3.4
Aug 3, 2016

What is the output of the following program? class Poly { static int length; int width; public Poly(int l, int w) { length = l; width = w; } int area() { return 2*length*width; } } class Rect extends Poly { public Rect(int l, int w) { super(l,w); } int area() { return length*width; } } class Solution { public static void main(String args[]) { Poly rect1 = new Poly(5,5); Poly rect2 = new Rect(6,4); int area1 = rect1.area(); int area2 = rect2.area(); System.out.println(area1 + " " + area2); } } 30 24 60 48 60 24 25 24 50 48 48 24 50 24

Which of the following program is a correct implementation of fizzbuzz program? FizzBuzz is a program that prints the integers from 0 to 99. But for multiples of three print “Fizz” instead of the number, and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. for(i = 0; i < 100; i++) { if(i % 3 == 0) printf("Fizz\n"); if(i % 5 == 0) printf("Buzz\n"); if(i % 15 == 0) printf("FizzBuzz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 3 == 0) printf("Fizz\n"); else if(i % 5 == 0) printf("Buzz\n"); else if(i % 15 == 0) printf("FizzBuzz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 15 == 0) printf("FizzBuzz\n"); else if(i % 5 == 0) printf("Buzz\n"); else if(i % 3 == 0) printf("Fizz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 15 == 0) printf("FizzBuzz\n"); if(i % 5 == 0) printf("Buzz\n"); if(i % 3 == 0) printf("Fizz\n") else printf("%d\n", i); }
avatar

Android Developer

Interviewed at Smartprix

3.4
Aug 3, 2016

Which of the following program is a correct implementation of fizzbuzz program? FizzBuzz is a program that prints the integers from 0 to 99. But for multiples of three print “Fizz” instead of the number, and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. for(i = 0; i < 100; i++) { if(i % 3 == 0) printf("Fizz\n"); if(i % 5 == 0) printf("Buzz\n"); if(i % 15 == 0) printf("FizzBuzz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 3 == 0) printf("Fizz\n"); else if(i % 5 == 0) printf("Buzz\n"); else if(i % 15 == 0) printf("FizzBuzz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 15 == 0) printf("FizzBuzz\n"); else if(i % 5 == 0) printf("Buzz\n"); else if(i % 3 == 0) printf("Fizz\n"); else printf("%d\n", i); } for(i = 0; i < 100; i++) { if(i % 15 == 0) printf("FizzBuzz\n"); if(i % 5 == 0) printf("Buzz\n"); if(i % 3 == 0) printf("Fizz\n") else printf("%d\n", i); }

Viewing 11 - 20 interview questions

Glassdoor has 8,344 interview questions and reports from Android software engineer interviews. Prepare for your interview. Get hired. Love your job.