Facebook | Onsite | Dot product of sparse vectors

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2016-06-17Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: e3, e4
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

Suppose we have very large sparse vectors (most of the elements in vector are zeros)

1. Find a data structure to store them
2. Compute the Dot Product https://leetcode.com/problems/dot-product-of-two-sparse-vectors/ (premium)

Follow-up:
What if one of the vectors is very small?

Comments