Mobile engineer interview questions shared by candidates
given a matrix where the numbers ascend both in rows & columns, e.g. 1 3 5 7 9 11 13 15 18 20 22 24 26 28 30 31 33 36 38 39 42 44 47 49 50 If you're asked to write a function that provides a boolean (YES or NO) answer to "does this number exist in this matrix", explain how you would design an algorithm to be most optimal.
I'm not 100% certain if that is the exact same style of matrix that was on the white board (I didn't scribble down my notes fast enough), so it may have been that some ascending numbers might be on the row above. E.G. 1 3 5 7 9 11 13 15 18 25 22 24 26 29 30 where 25 is on row 2 and 22 is on row 3. After some hand wringing and a bit of stress, the questioner dropped a hint that I could look at the beginning and end of a row and rule it out immediately if the beginning and end didn't have the desired number in range. I'm guessing they wanted a much more specific answer than this though, along with big / little O complexity time.
Start from the right-top. Keep going left till our number is greater than the number at [row,col]. Once this col is found, increment the row and move down, Repeat until found.
Here's the one "bigger" question I was asked by the hiring manager on-site: Given an array of strings, e.g.: NSArray * files = @"[@"file2", @"folder22", @"folder10", @"file1", @"folder100", … … …, nil]; Describe how you would write some kind of method or function that would sort the strings in a predictable manner (e.g. "file1", "file2", "folder2", "folder10", "folder100" instead of "folder10", "folder100", "folder2")
Implement a LinkedList in your language of choice. For me, it was Objective C. So the hiring manager typed this into a shared whiteboard/document browser window: LList * list = [[LList alloc] init]; [list insert:10]; [list insert:20]; [list insert:5]; [list insert:30]; [list insert:12];
See Interview Questions for Similar Jobs
- Software Engineer
- Senior Software Engineer
- Software Developer
- Software Development Engineer
- IOS Developer
- Android Developer
- Ios Software Engineer
- Software Engineer Intern
- Web Developer
- Mobile Developer
- Mobile Engineer
- Android Engineer
- Associate Software Engineer
- Java Developer
- Applications Developer
- Senior Software Developer