Facebook Interview Question Software Engineer / Developers
0of 0 votesDesign a system for showing quotes on the web?
For example, when the user is looking at page A, part of which is reproduced in page B, the system could highlight part of page A present the user with a link to page B.
What constitutes a quote?
How do you find quotes?
How do you make it scale to the web?
How do you handle updates?
How would you arrange the servers?
What data structures would you use?
Country: United States
Interview Type: In-Person

I would chunk each page in blocks of text (I can leverage the DOM of the page... the way you optimize this step deeply affect the final result). Then I would apply an hash function on each chunk and represent the page A as the set of that hash numbers A = [h_0, ... h_n].
- Claudio on October 05, 2012 Edit | Flag ReplyNow, I can build a inverted index of the hashes so that h_i => {A,B} meaning that the h_i is present both in A and in B. At this point whenever I render the page A I will generate a link to the page B associated to the chunk of text having h_i as hash number.
I will keep updated the index by keep crowling the Web and updating internal representation of the pages and the index like a SE does.