Weird Facebook product/system design question

New
fTHhy56

New

fTHhy56
Dec 17, 2018 57 Comments

Interviewed with facebook a while ago and had a pretty weird experience.

Was asked to design a type ahead suggestion for google search. It was a product design interview , not system design.

Came up with a trie, computed via map reduce periodically over 1 hour(configurable), frontend implementation, load balancer, app servers, mq, cache and a key value db. Took the assumption that we would only be interested in popular terms for type ahead and there would be a lot of duplicates in 5 billion odd queries that Google would get everyday. Had thought about this question before and seen it on grokking the system design.

Interviewer: But google doesn't only do it for popular terms it does typeahead for all terms
Me: No it doesn't. Only the popular terms are what show up on type ahead, otherwise, it'd defeat the purpose.
Interview: I'm sure google does typeahead for all terms.
Me. So you are saying that if a single random bloke entered the term 'xyzowkdyzxc' on google, and another random bloke entered the term xyz google will show a typeahead suggestion?
Interviewer: Yes it will
Me: *completely in disbelief at this point , points out the daily query volume for google and space requirements for storing the entire trie*
Interviewer: Okay , do it for youtube. Youtube shows typeahead for all of it's videos.
Me: It doesn't, based on my experience. But I'll try to solve it anyway.
Interview: It does, I have tried it.

I just went on to add more fanout nodes to the map reduce output jobs , reduced cassandra's replication factor , added more message queue nodes etc.

Follow up: How will the system scale if map reduce job ran every minute?

I think the interview went even more downhill after that.

People of blind, how do you solve a question like this and what would you do in this sort of a situation?

comments

Want to comment? LOG IN or SIGN UP
TOP 57 Comments
  • New
    Coolio1

    Go to company page New

    Coolio1
    I think the interview went well if you did not sound condescending and were collaborative.
    Dec 17, 2018 6
    • New
      fTHhy56

      New

      fTHhy56
      OP
      Thanks @ceng. I guess this is what caused the interview to go downhill and definitely something that I'll keep in mind for future interviews
      Dec 17, 2018
    • Amazon
      Chachingin

      Go to company page Amazon

      Chachingin
      I guess that was the interview itself, and not the product design
      Dec 17, 2018
  • Why would you argue? Part of the interview process is seeing whether you work well with other people, and you showed your condescending side to your interviewer during that short time. They will definitely mark you down as someone that they don't want to work with. Understand that the interviewers sometimes just want to extend the requirements or have a technical conversation with you. It doesn't matter that Google doesn't behave the way the interviewer say it is. This is an imaginary problem so they can create an imaginary requirement if they want.
    Dec 17, 2018 5
    • Next time, I suggest you don't appear defensive. If they let you go on and on about your initial design and assumptions, to me it seems like you got it correct and were doing well. Otherwise, they would have stopped you midway. In my opinion, their tweak of changing the Google search type ahead behavior is a way to move the conversation along and see how you adapt to it. It wasn't a sign that you're wrong. It was more like the next question. You being defensive makes them defensive. And that may be ok for some interviewers, but it won't for others. So I suggest not trying to risk it and just go with it
      Dec 17, 2018
    • New
      fTHhy56

      New

      fTHhy56
      OP
      Thanks profiles, this is very insightful. Will definitely keep this in mind for future interviews.
      Dec 17, 2018
  • Amazon / Mgmt
    πŸ‚soon

    Go to company page Amazon Mgmt

    πŸ‚soon
    Not sure if you noticed but sometimes interviewers are less knowledgeable than the candidates they are interviewing.
    Dec 17, 2018 0
  • Google / Mgmt
    Riker

    Go to company page Google Mgmt

    Riker
    OP is an idiot, and embellishing the interview experience here to make himself look like a victim. Rephrase the interviewer's remarks as "Humor me and assume it does search all terms. How might we implement this?" And give your damn answer. Don't try to be a smartass.
    Dec 17, 2018 1
    • New
      fTHhy56

      New

      fTHhy56
      OP
      I truly wish that this was the case. I did go on to humor him and I did implement a design assuming that it did search all terms. But given that the interview was product design, my first reaction was to argue if it even made sense for the product. Had the question been phrased as 'humor me' , why would I have a problem implementing it given that I did do it later anyway? If someone tells me that my assumption about typeahead not accounting for all queries is wrong, then isn't it my job to justify my assumption?
      Dec 17, 2018
  • Facebook / Eng
    SteveIrwin

    Go to company page Facebook Eng

    PRE
    Google
    SteveIrwin
    Why would you identify yourself and break your NDA for something as trivial as this?

    What a dumb way to get blacklisted lmfao.
    Dec 17, 2018 8