Got an email , since i applied online on Careers Website. Got my first phone interview scheduled. Followed by an Onsite invitation.
Phone Interview:
1) How to write Remote service?
2) How do you pass data between threads?
3) What is deadlock ?
4) Why do you need synchronization?
5) What is virtual ?
6) Questions on my resume about Design Patterns i have used
7) How do clients bind to service ?
8) How do clients know when they got disconnected from service?
9) Activity Lifecycle
10) What triggers an Onpause() and onDestroy(). Give examples
11) Service lifecycle
12) Short code to explain how JNI works
A couple more interview Questions, but i do not remember precisely.
OnSite Interview:
First Round:
1) Write an atoi function (I coded, but i messed up by multiplying character by 10 before doing *input-'0', i am not c++ programmer, but thats no excuse to mess it up)
2) Reverse a linked List (Better to use two pointers than 3, i used 3)
3) There an encrypted image file, and there are libs in c++ to decrypt the image file. Write code to return the path of decrypted file back in JAVA layer from c++ (Its pretty easy to do , since i did JNI)
4) Write code to Demonstrate Remote Service
5) How to pass complex user data in IPC from one process to another ? (AIDL, Messenger)
6) Difference between Set and List (I said list elements has "some" link to each other, whereas its not the case with set, which is true, but i should have used right keywords - List is ordered, set is NOT, and LIST allows dups)
7) How is arraylist implemented in Java? (I said, its by allocation array and resizing as needed, arraylist is not implemented by linkedlist in java, since array list allows fast indexed access to data)
8) What is weak reference ? (I messed up, i said it' a ref to ref, It appeared interviewer wanted to know why is it used)
9) Interfaces in collection framework - ( I said List, Set, Map, i left out dequeue, Interviewer kept asking whats more, i couldnt tell. JAVA docs suggested i was indeed right it's only LIST SET, MAP and DEQUEUE, i only missed dequeue)
10) How to pass User Object using messenger in IPC.
Second Round:
1) Reverse a string (I did it using recursion -
if(inputString==null)
return null;
if(inputString.length==1)
return inputString;
return (reverse(inputString.substring(n/2,n-1)+ reverse(inputString.substring(0,n/2)));
2) Reverse - "I am a boy" ==> "boy a am i" (Was easy, i used by already coded reverse routine to explain my algorithm for this one and interviewer was pleased)
3) Encode routine for string of types shown below: (Was easy one)
one example - aaabbccd =>a3b2c2d1
second example - aabccaaa => a2b1c2a3
4) A tree question - Return all nodes in each level as a list inside a larger list. for example
1
2 3
4 5 6 7
{ {1}, {2,3}, {4,5,6,7}}
You just have to do a BFS traversal and keep a track of level and create subslists, and in end just return final list with all lists of each level.
3rd Round:
1) Explain my JNI project i did. (Easy one)
2) Code a similar JNI routine with changed requirements interviewer gave me. Too big to mention here (Easy one)
3) Make a user dictionary with a) add b) find c) edit
Basically approach and specifics you will perform in each routine.
I coded the problem but mistake i did was i didnt consider when dictionary is empty, what would be my default action. I know its easy to say oh i can accomodate that, but as a developer they probabaly anticipate you to already consider when u code.
4) Difficulties in JNI
4th Round:
Lunch with Director
All range of experience related questions, trying to guage your depth and technical insights in varying range of topics. Discuss difficulties you faced, hardest bug how you solved it, views on Improving JNI, what would i change, Why should he select me and all
5th Round:
Interview with Software Lead.
Again probing on your skill set and what can you bring to team. Difficulties in particular scenario. General Chat