Facebook | Phone | Add Strings & Dot Product of Sparse Vectors

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-05-07Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: e3
Interview Stage: Phone Screen
Location: Seattle
Year: unknown

Original Post Content:

Location: Seattle
Mode: Video Conference

Android Questions:

1.Differentiate onPause() and onStop() method, what will call when? onPause() - When partially hide the screen, onStop()- When activity put into the stack (Complete hide)
2.At what thread Android service (extend by Service class) run by default? Main Thread
3.What are the different way to communicate main thread from service? LocalBroadcasting, Handler

Coding:

  • https://leetcode.com/problems/add-strings/ - Solved within 5 minutes
  • https://leetcode.com/discuss/interview-question/124823/dot-product-of-sparse-vector

My bad, I wasn't aware of dot products and I asked interviewer to give me the sample input and output. But, seems like he wasn't prepared for that. I got screwed up by understanding the problem till the end. I'm able to find the right way to store the value, but I'm not able to provide the correct solution due to unavailability of sample output.

But, I've asked to give the interview again. Looks like one more chance :-)

Comments