Code Screen:
Describe a time where you had to influence others to make a decision.
Describe the lowest level of detail you've worked at.
Question:
Followers and communities from here. BFS, easy.
Onsite:
Hiring Manager:
What am I looking for in a team and at my next job?
Think about your past work experience, what is something you liked most about the processes in place and something you did not like?
Talk broadly about a project you worked on.
What is something you learned from the project?
Talk about a time where you couldn't meet a deadline.
Talk about a case where you helped a coworker.
Why are you looking for a new job?
Then you get 15 minutes to ask questions to the hiring manager.
System Design 1:
Talk about a difficult technical problem you've encountered in system design.
The recruiter mentioned one of the questions is to design the Reddit home page (ie design the feed for users).
The system design question I got was:
Imagine you are a gaming company. People can download games and play them on their computers. Whenever a user cracks the top 100 high scores for a game or the user sets a new record for their own score on the game, we should store that information. .Design the system.
Key ideas:
The write-traffic will reduce dramatically over time. Once there are 100 high scores for a game, users don't even need to submit their scores unless they break the top 100. Each user can store the top 100 scores and their personal best score locally and only submit a new score when they beat a record.
Availability over consistency.
There could be a traffic spike each time a new game is released.
Read from a cache instead of the DB. Use a queue to manage the write traffic. Users can also hold their scores if your system goes down and submit them when the system is back online.
System Design 2:
No behavioral question.
Imagine that you are designing a web crawler. This web crawler accepts links from users and then crawls the domain for the link and notifies the users when the crawl is done. The crawler should save the web pages and find other links on the web pages as it crawls.
This question is pretty easy. Just make sure to cover what happens in the failure scenarios for the messaging queue, and talk about how to make sure the crawls for a website are done.
Coding:
No behavioral question.
Write a hit counter that fits the following interface:
public interface HitCounter {
// Registers a hit at the timestamp.
public void hit(int timestamp);
// Returns the number of hits within 5 minutes of the timestamp.
public int getHits(int timestamp);
}
getHits is always going to be called with a timestamp at least as large as the largest
timestamp you've seen so far. For this reason, a queue would be extremely inefficient.
The hits might come out of order. For example:
HitCounter hitCouner = new HitCounter();
hitCounter.hit(10);
hitCounter.hit(9);
hitCounter. getHits(100); // returns 2
hitCounter.hit(201);
hitCounter.hit(1);
hitCounter. getHits(400); // returns 2 (100 and 201)
Test it.
Follow up: Make it threadsafe.