1.Given a string, write a function that return if it is Palindrome. This wasn't asked directly but from interviewer example i was need to understand that this function must ignore all spaces and special symbols. 2. Given an array, write a function that return true if any 3 elements of this array can sum to 0. My first solution was the simplest and far from best which result in O(n^3). Then interviewer asked me to improve to improve it to O(n^2). This give me a hint that i can use Hash to reduce complexity.
Lead Android Developer Interview Questions
2,232 lead android developer interview questions shared by candidates
Puzzle: There are 4 persons (A, B, C, and D) who want to cross a bridge in night. A takes 1 minute to cross the bridge. B takes 2 minutes to cross the bridge. C takes 5 minutes to cross the bridge. D takes 10 minutes to cross the bridge. There is only one torch with them and the bridge cannot be crossed without the torch. There cannot be more than two persons on the bridge at any time, and when two people cross the bridge together, they must move at the slower person. What is the minimum time required to cross the bridge
I looked up the question after and it was in the hard section of leetcode.
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.
THE SUN RISE IN EAST Print the above sentence with out duplicating chars ?
The following function is stripping (removing) all the characters in string stripChars from the end of the string str? The function is incomplete. What code should be there in place of the comment? public static String stripEnd(final String str, final String stripChars) { if (str == null) return str; int end = str.length(); int INDEX_NOT_FOUND = -1; if(end == 0) return str; else if (stripChars.isEmpty()) { return str; } else { // ********************* // What's the code here? // ********************* } return str.substring(0, end); } while (end != 0 && str.indexOf(stripChars.charAt(end - 1)) == INDEX_NOT_FOUND) { end++; } while (end != 0 && str.indexOf(stripChars.charAt(end - 1)) != INDEX_NOT_FOUND) { end--; } while (end != 0 && stripChars.indexOf(str.charAt(end - 1)) != INDEX_NOT_FOUND) { end--; } while (end != 0 && stripChars.indexOf(str.charAt(end - 1)) == INDEX_NOT_FOUND) { end++; }
Name the different stages of an android activity.
what is MVP
String reverse. Tree(data structure) related question.
Viewing 1 - 10 interview questions