I interviewed with facebook for Android Software Engineer at New York.
- Follow-up : How will you update your code so that it works for numbers of any base given as string.
I was able to solve the question and went for onsite.
Round 1: [System Design]
- Design an application, let’s call it “My Photo App”(MPA) which would allow you to view your pictures across all devices. (Very similar to Google Pictures)
For example, you have 2 smartphones, both of them have MPA installed on them. You clicked some pictures on one device and then opened MPA on another device, you should be able to see pictures from both the devices.
I think I screwed up badly in this round. There were a lot of concerns to take care of, how will you sync pictures to your server, how quickly will you sync, what will happen if synching fails, etc. I explored client server architecture, how to send pictures from one device. Should I send only one picture and wait for acknowledgement or should I do combined ack. How do you access pictures? SQLite Databse. How do you send pictures? Something similar to TCP/IP (Stop and wait vs Go back N vs Selective Repeat). Android side, I explored concepts like services, compression and how to update UI using handlers.
Round 2: [Coding]
Told my interviewer that this was the same question that I was asked during the telephonic interview. Was hoping for brownie points. Sigh.
- Interviewer changed the question. Given some salary and tax brackets, calculate tax. - Solved it.
- Behavioral - Questions like, who is your favorite kind of person to work with. Who is your least favorite person at work.
- https://leetcode.com/problems/merge-sorted-array/ (Solved)
- Follow-up : How will you merge n sorted arrays ( Solved)
- Subarray sum with k (solved)
- Given M sorted lists, of combined size of N, find the kth smallest element.
The lists are individually sorted but not guranteed to be sorted amongst themselves.
[0,6,8,9]//m lists. Combined lenght of all the lists is n
find the kth smallest element.
- k = 5, answer = 4
I solved it using min heap which works but isn’t an optimal appraoch. Should have used max heap of size k. The interviewer hinted that I was not using the fact that the lists were sorted. She mentioned that the heap solution would work regardless of the fact that the lists are sorted or not. I couldn’t think of a solution that would exploit the fact that the lists were sorted
- k = 5, answer = 4
And then one week later, got the dreadful mail which read “Thank you for your time. Unfortunately…”
Feedback received - Work on your system design.
Overall, it has been a great experience! Hope this helps