DataDog Interview Question
Anonymous User
12716

Hi, I need some help to ace an interview question. I found this question was asked during an DataDog coding interview.

There is a stream that has coming tags and also has a list of keywords, design a high performance filter to output these keywords remaining tags.
For example: given stream ['apple, facebook, google', 'banana, facebook', 'facebook, google, tesla', 'intuit, google, facebook'], if the keyword is ['apple'] the output should ['facebook', 'google'] because only 'apple, facebook, google' has apple. Similarly if the keyword is ['facebook', 'google'], the output should ['apple', 'tesla', 'intuit']. The output can be in any order and can be put into a single list/array.

I was not sure how to handle these:

  1. High performance filter.
  2. The tags are coming as in a stream.

Thanks for the help!

Comments (11)