(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.
Android Software Developer Interview Questions
8,366 android software developer interview questions shared by candidates
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
Move zeros to end of given array.
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.
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
Given a project, was required to refactor it using the MVP pattern an solving hard bugs presents.
Remove duplicate from contact list.
The MCQ had 30 questions which in no way tests your real Android skills. It is more like one of those gotcha interviews. Don't waste your time, these guys are not serious about hiring
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