Given an array of ints = [6, 4, 0, 5, 0, 0, 0, 1, 0] move all non zero numbers to the left and zeros to the right. How can you now improve your answer to O(n)?
Lead Android Developer Interview Questions
4,321 lead android developer interview questions shared by candidates
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.
Your photo-sharing app displays a system notification when the user receives a photo. Your app should display the photo when the user taps the notification. Which of the following do you need to attach to the Notification object that you pass to NotificationManager? A. An Activity reference B. A PendingIntent C. A BroadcastReceiver D. A Fragment transaction
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.
Develop an android app in 3 hours
Why do you want to work for our company?
Implement method oneEditApart that return boolean: true, if using one operations (insert or remove or replace) we can modify one string to get another. False otherwise. // Signature: boolean oneEditApart(String s1, String s2) // Allowing operations insert remove replace Example: oea("cat", "cut") => true // replace "u" -> "a" oea("cat", "cuts") => false // no operations oea("ca", "ca") => false // no operations oea("cats", "cat") => true // remove "s" oea("cat", "at") => true // insert "c" oea("cat", "cbat") => true // remove "b"
Viewing 1 - 10 interview questions