SDE 1| Amazon | Seattle
Anonymous User
418

Hi,

I recently gave phone screen interview at aws, seattle. I was asked string question where he gave i/p as hashmap with id as key and sentence as value. I have to check if the phase (words) is present in sentences, if it is present add id(key) value to the output list.

eg: i/p -> 1, "Amazon is expanding cloud computing service"
2, "Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing
services"
3, "Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally"
phase -> " computing service"

o/p should be [1,2]

he asked me to apply preprocessing logic if there are millions of data. I am not sure what is optimal soln.

Can anybody solve this question?

Comments (1)