## lyra_vega

BAN USER
Questions (5)

Reputation 350

- 0of 0 votes

AnswersAssume we have a sorted list of document_id-s for every keyword. Given a search string, how to find the documents that have all keywords in the search string? Basically how to find the intersection in a set of sorted arrays? What is the complexity? How to improve if there are only two arrays and one is much smaller compared to the other? How to distribute this on a set of different machines?

- lyra_vega in -| Report Duplicate | Flag | PURGE

Google Software Engineer / Developer Algorithm - 1of 1 vote

AnswersGiven a positive integer N, arrange the integers 1 to N such the position of the average of two numbers (if present) falls outside the two numbers. For example, for a[i] and a[j], if b = (a[i] + a[j])/2, then if a[k] = b, k < i or k > j.

- lyra_vega in -

Hint :- If the average of two numbers is not an integer then we can assume that they do not have an average.| Report Duplicate | Flag | PURGE

Google Software Engineer / Developer Algorithm

Page:

1

Page:

1

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window