Step 2: Abstract design

Once you've scoped the system you're about to design, you should continue by outlining a high-level abstract design. The goal of this is to outline all the important components that your architecture will need.

You can tell the interviewer that you would like to do that and draw a simple diagram of your ideas. Sketch your main components and the connections between them. If you do this, very quickly you will be able to get feedback if you are moving in the right direction. Of course, you must be able to justify the high-level design that you just drew.

Don’t get lured to dive deep into some particular aspect of the abstract design. Not yet. Rather, make sure you sketch the important components and the connections between them. Justify your ideas in front of the interviewer and try to address every constraint and use case.

Usually, this sort of high-level design is a combination of well-known techniques, which people have developed. You have to make sure you are familiar with what's out there and feel comfortable using this knowledge. In this chapter we will assume that you have enough experience to design such a high-level system. Our goal is to focus more on the next steps, where we will talk mainly about scalability and about removing bottlenecks.

Here's an example of a simple abstract architecture for the URL shortening service

  • Application service layer (serves the requests)
    • Shortening service (generating a new hash, keep mapping relations) - custom url
    • Redirection service
  • Data storage layer (keeps track of the hash => url mappings)
    • Database need to handle requests
    • Acts like a big hash table: stores new mappings, and retrieves a value given a key
  • Hashed_url = convert_to_base64(md5(original_url + random_salt))

results matching ""

    No results matching ""