Microsoft Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: Phone Interview
each add need to have a set of keyword ,geographic location and priority.This priority can be defined based on the money provided by each advertisement. When we have a search two arguments will be shared geographic location and keyword.
First search the geographic location and then the keyword match. If we get multiple entries the ad need to be ordered in the priority which is paying more money
each add need to have a set of keyword ,geographic location and priority.This priority can be defined based on the money provided by each advertisement. When we have a search two arguments will be shared geographic location and keyword.
First search the geographic location and then the keyword match. If we get multiple entries the ad need to be ordered in the priority which is paying more money
We can use inverted index. The data structure looks like this
- Shashank January 13, 2012key1 -> p1, p2, p3, p4
key2 -> p5, p6, p7, p8
key3 -> p9, p10, p11, p12
key = the keywords that match the list of adds
"p" stands for posting. For every key there is a list of postings. Each posting looks like this
posting = {index, value}
index = reference to the add
value = condition like where the advertisement is shown and where it is blocked, etc