I'm currently in a process of preparing for a tech interview. Each interview, even two interviews in one company, can be different, but most of the time it's a structured meeting.

In most big companies like Google, Amazon, Facebook; the interview is divided into three parts. First part is Coding Interview where you are expected to implement simple algorithm. Most of the time it will be without using IDE just to see how well you know the language you picked. The second part is Behavioral Interview where the recruiters will try to get what person you are. They will try to figure out what are your drivers, what motivates you, how you react to specific situations etc. The third part is System Design Interview where you will be asked to design specific platform like, for example Twitter. The interviewers will ask you specific questions about your design and will challenge your decisions.

Today I'll focus on System Design Interview. In order to prepare for that, I bought a subscription on educative.io and started this course. It has good reviews and people are recommending it.

The first lesson was an introduction to how structure the interview. Those are the steps and example questions (assuming we are designing Twitter):

  1. Clarify requirements:
  • How many people will use this service?
  • Do we allow using images in tweets?
  • Can people follow each other?
  • Do we want to have a timeline?
  • Do we care about front-end or should I focus on the back-end only?
  1. Back of the envelope estimates:
  • How many users are we expecting?
  • What's the expected traffic?
  • Is there a data limit for a tweet?
  • Based on that:
    • traffic estimates (how many operations per second — what type of operations — read or write?)
    • bandwidth estimates (how many KB/s)
    • storage estimates
    • memory estimates (operational memory — RAM)
  1. System Interface definition:
  • postTweet(tweet_id, tweet_data, user_id, ...)
  • generateTimeline(user_id, current_time, user_id, ...)
  • followUser(user_id, second_user_id, ...)
  1. Defining Data Model:
  • User: User ID, Name, Email, Date of Birth, Creation Date, ...
  • Tweet: Tweet ID, Content, Tweet Location, ...
  • UserFollow: User 1 ID, User 2 ID
  1. High-Level Design:
  • Draw most important 5-6 boxes which will allow to solve the problem
  1. Detailed Design:
  • Deep dive into three major components
  • Recruiter will ask specific questions and challenge your ideas
  • How should we partition the data?
  • Should we store all user data in one database? What can be the consequences?
  • What components need more load balancing?
  1. Identifying and resolving the bottlenecks:
  • Is there a single point of failure?
  • Do we have enough replicas?
  • How are we monitoring the performance?

The next parts of the course are actual design of various systems. I can't wait to go through all the challenges.