My takes from System Design Interview by Alex Xu

System Design Interview by Alex Xu

Since 2015, I am attending interviews as an interviewer for recruiting new talents, for the selection of new partner companies etc. And since 2019 I am conducting interviews for my current company. The topics I interview for are usually General Tech and Culture Fit. I enjoy also system design and thought I can also help our company by taking over a few System Design Interviews hence I started to prepare myself for the next step. I saw “System Desing Interview: An Insider’s Guide” by Alex Xu is suggested for interviewees to prepare for upcoming challenges so I thought I should give it a shot to sharpen my skills and understanding of the system design domain.

The book starts with the basics like designing for scaling, back of the envelope calculations then suggests a framework for system design and provides 12 different system design examples. I took some notes and also recorded some resources to read further.

Let’s look into the suggested framework for system design. It’s a four-step framework and actually, I found it quite useful to have such a structure.

  1. Understand the problem and establish design scope
  2. Propose a high-level design and get buy-in
  3. Design deep dive
  4. Wrap-up

Time allocation suggested by the author per step is

  1. 3 – 10 minutes
  2. 10 – 15 minutes
  3. 10 – 25 minutes
  4. 3 – 5 minutes

This time allocation would allow a candidate to complete a design in around 50 minutes and would provide some additional time for Q&A in a 60 minutes interview. From my perspective suggested framework and time allocations would work in an interview setup.

Let me summarize each step with one paragraph, then I can provide my thoughts, notes and feedback about the book.

Understand the problem and establish design scope

Nobody would expect you to design the new Facebook or Netflix in the short time of an interview. So asking clarifying questions, setting up the boundaries of design and noting down the assumptions are the way to start the design. All those steps should be discussed with the interviewer, get their ideas about the important parts of the system to design and get their approval on the assumptions.

Propose a high-level design and get buy-in

This is the step where the interviewee should lay the foundations of the system and provide a blueprint with the collaboration of the interviewer. Doing some back of the envelope calculations and depending on those calculations system size and components should appear on the design. This step should not include details like data format yet but should have a storage layer for example.

Design deep dive

This is the time to think about handling the load, choosing the correct data store, scaling the API servers etc. Depending on the discussion with the interviewer, you should focus on a few key areas and deliver a detailed design and even a few implementation details if required.

Wrap up

In this last step, you should go the extra mile and tell about the flaws in your design and how it may be improved, what can be expected to change in the business in the future and how the design can evolve to cope with those changes.

My notes and thoughts about the book

  • There are some mistakes or not so best-practices in the book e.g.
    • Author claims NoSQL should be chosen to store massive amount of data, this is open for discussion. A technology selection should not be justified only by data size but also use cases and requirements.
    • In one of the API design sections, author does not follow the REST best practices and uses verb in the URL
    • Author claims a scale-up would not help with the load, in my experience it helps.
  • Back of the envelope numbers are great shortcuts during the design time.
  • There is an unfortunate use of magic number in the book while calculating peak system load. There is no explanation of why we use this factor to multiply our assumption.
  • 12 different system design examples backed by real life resources are really handy and informative.
  • There are some missing information, for example author says “token bucket is memory efficient” but does not explain why and how. Or while discussing quorum of a distributed system author overlooks possibility of a Byzantine Fault.
  • Reference materials are useful, almost every section I noted down some of the reference materials to read further.
  • In some designs there are security flaws which may cause data leak, which have been overseen. Though this can be defended as security is not in the scope and time is short. Still I believe security should start in the design phase.
  • Also in some designs sections, author does not follow the framework they suggested.

All in all, I got some fresh ideas and a good framework for system design interviews from the book. I would consider recommending this book to mid-level engineers who are looking for different aspects of system design and would use a few real-life examples. For me, a 10+ year engineer, the advantages of reading this book was limited.

Thanks to Alex Xu for putting all the effort and collecting those examples in a well-structured format. And thank you for reading this blog post, feel free to comment or share this post if you find it useful.

Monthly Challenges : June ’15 Weight Loss and Standing Desk

Hello all,

I had two challenges for June and luckily I completed both of them.

1. Lose 3 kg.s in a month.

This one was easy, I will not get into details. I was 87.6 kg.s, I cut off eating junk food, I began to count my steps and put a target of 10.000 steps daily. And at the end I was 83.8 kg.s. I’ve reached and passed my target.

2. Work on Standing Desk

This was the real challenge. Actually,  when I am working at home, I am already using my DIY standing desk,  but I am working at most two hours at home. So it is not challenging.

Standing desk in the office has at least two challenges. Which are a) convincing manager and colleagues, b) really standing for 8 hours straight.

For the first part, luckily we were moving to a new office, I had the most isolated part for myself. So I will not get too much attention 🙂 And my manager is an open-minded man, he is also very friendly (once we were colleagues). Convincing manager was not that hard. It took more time for my colleagues to get used to me 🙂

Second part was hard sometimes. When you google ‘standing desk’ and read some blog posts about them. You will see some tips, which come true when I experience it. First of all just standing and working like that is not possible. I often transfer my weight from one leg to another, take some small walks in office, have some small sitting pauses when I am taking notes or a friend ask for some help.

Shoes are really important when you stand all day long. Hard soled shoes will make your day a nightmare, some people use yoga mats to soften the floor. I choose more soft soled shoes. This way my feet don’t cry for help.

I also built my standing desk in office, so it is a DIY standing desk like the one at home. This have some pros, like I have two spare shelves to put my notebooks, pens etc.

My DIY Standing Desk
My DIY Standing Desk

Now, I am happy with the result.

Have a look at also my post on LinkedIn about standing desk : https://www.linkedin.com/today/author/130746977
Leave comments, keep in touch.

Android : MAKEIT Rehber Project

Hello,

Last night I developed a new Android application for inhouse use of my company. Since we are a small company which aims to get bigger, our population keeps growing. This brings some problems with it. For example, some older employees don’t know about newcomers and their contact information.

One day I needed to call a new employee and I realised I don’t have her contact information. And before that point I was not aware of situation. Then I decided to make a phonebook that reads information from a shared file on internet, which our HR will update when somebody joins or leaves the company. So every employee would have every other’s contact information.

This is how MAKEIT Rehber was born. – Rehber means phonebook in Turkish. – Yesterday night I developed the first version of application, where the contact info was hardcoded, then added reading a remote file, then I added sending SMS or Whatsapp messages directly and lastly I added my own open source library : tellal to send notifications through MAKEIT Rehber. This notifications can be just new version notifications or something about company.

There is still some development to do. But it has more than enough abilities now.

Below you can find a screenshot.

MAKEIT Rehber
MAKEIT Rehber

 

Thanks for reading, please do not hesitate to ask your questions or comment on my posts in the comment area you can find below.

Have a nice day.

Project Management

Maia

There is a good project management article on the internet. Which takes delivering baby as a Software project and share which role thinks what about the project exactly. I believe it is really close to daily life projects, we have in enterprise companies, where we have an obivous line and knowledge difference between project roles. Here is that article.

Have fun!

  • Project Manager is a person who thinks nine women can deliver a baby in one month.
  • Developer is a person who thinks it will eighteen months to deliver a baby.
  • The Onsite Coordinator is one who thinks single woman can deliver nine babies in one month.
  • The Client is the one who doesn’t know why he wants a baby.
  • Marketing Manager is a person who thinks he can deliver a baby even if no man and woman are available.
  • The Resource Optimization Team thinks they don’t need a man or woman; they’ll produce a child with zero resources.
  • The Documentation Team doesn’t care whether the child is delivered, they’ll just document 9 months.
  • The User Interface Team will design a baby with three arms and one leg and ask if it can be done.
  • The Quality Auditor is the person who is never happy with the process to produce a baby.
  • Tester is a person who always tells his wife that this is not the right baby.

Test your SQLs online

Nowadays I am trying to answer questions about SQL, PL/SQL and Oracle on StackOverflow . You can see my profile card below :

 profile for Canburak Tümer at Stack Overflow, Q&A for professional and enthusiast programmers

Recently I am seeing a new web site link in answers, while I am navigating through as much questions as possible. That site called SQLFiddle where you can create an online database and try your codes.

Screenshot from web site
Screenshot from web site

As you can see above it is pretty simple, and it is really easy to use. There is different products and different versions for some products you can choose between. While I am writing this post, exact list was like below:

  • MySQL 5.5.30
  • MySQL 5.6.6 m9
  • MySQL 5.1.61
  • Oracle 11gR2
  • PostgreSQL 9.1.8
  • PostgreSQL 9.2.1
  • PostgreSQL 8.4.12
  • PostgreSQL 8.3.20
  • SQLite (WebSQL)
  • SQLite (SQL.js)
  • MS SQL Server 2008
  • MS SQL Server 2012

Jake Feasel, creator of SQLFiddle, explains why he built the site as :

I found JS Fiddle to be a great tool for answering javascript / jQuery questions, but I also found that there was nothing available that offered similar functionality for the SQL questions. So, that was my inspiration to build this site. Basically, I built this site as a tool for developers like me to be more effective in assisting other developers.

How to use

So let’s talk about how to use SQLFiddle,

First of all, you select the product you want to use from combo box on top-left corner, next to site logo. Then you should create your schema, in left editor you can create tables and insert data to your tables. When you are done with coding click Build Schema button to run your code. Now you have your tables and data. You can write your queries in the right editor and run them. Results will appear below editors.

Limitation 

There is a limitation with MySQL, that Jake Feasel explains in About page. On the right editor you can only use select if you are using MySQL, with other products feel free to use all DML operations.

Login

There are around 12 different log-in options like G+ and OpenID. When you login to site, you can see your Fiddle history, and your favorite fiddles. There is no other advantages of logging in yet.

That’s all for today. Do not hesitate to comment.

P.S. I am preparing new ODI post but I am really busy with my work these days. So follow my blog for updates.

Online Tools for Productivity

Hello all,

Today I am going to write a non-technical post. The online tools I use for productivity in my college and work life, which make my life simpler and easier. All the tools I will mention below have free plans or demo versions as well as they have premium, or paid services.

Mailing

      For mailing, my first choice was GMail, which has been developed and  served by Google. It was a huge thing to have 2GB inbox space when GMail first published. I remember around eight years ago when I first heard of it. There was only one way tou subscribe to GMail, which is getting an invitation. Since these days, it became an public service, Inbox space enlargened to 10GBs and still growing.

GMail then had more abilities, and integrated to new services like calendar, docs and etc.

 

 

 

 

 

Outlook.com is the new e-mail service of Microsoft. And I am pretty happy with this account and web mail interface. It is easy to use, has a clear interface, and nice features. Microsoft is going to turnover all hotmail        accounts to outlook until the end of June 2013, says rumors on the web. Also it is nice that nowadays there are lots of options for e-mail addresses you can take. For example your_name.surname@gmail.com may be taken in gmail but it is quite possible to find your_name.surname@outlook.com address available. Also as Microsoft Office Outlook is a well known software, this e-mail addresses seems more professional.

 

Meetings And Collaboration

 

For meeting appointments I use Doodle.com. You create a survey including times, send invitation to attendees, then they check their available time. So you can find a suitable time for all to make an appointment for your meeting or other event.

 

Scriblink is an online whiteboard, where all the attendees can add/drop something to the white board. Attendees can also chat in the chat pane.

 

 

 

 

Google Docs is like an online Office tool with Spreadsheets, Presentations, Word Processor. You can view, edit and share documents via Google Docs. It recognizes and opens all common file extensions we use in daily life.

 

 

 

 

Skype is the software I use most for video-calls. It has chat, voice call and video call abilities, with conference support. It is easy to use and has ability to call phones also.

 

 

 

 

 

 

 

Dropbox is a well-known file sharing tool. I also use it for sharing files between our project group and also publishing files through internet for public download.

 

Facebook groups,  we use Facebook Groups for really small project groups for innovative discussions, sharing videos and photos and ideas between our group. As everybody uses facebook on a daily basis nowadays, it is an easy and secure way to update whole group via Facebook. Also you can share documents and files, which is a great plus. And the most useful ability is to make your group hidden and closed.

 

Other Utilities

Evernote.com  It is the most used utility for me, I use it on my Android phone and my iPod to write notes on the way. And use its web interface to check and edit my notes. I have all kinds of information on my evernote like new blog posts, project topics, my home’s utilization bills, etc.

Creately.com  This is the website I use to draw. Drawing ER diagrams, workflows, GANTT charts etc. is very easy with using creately. So it is useful and light-weight.

TeamViewer Remote control is a need in IT environment, using my computer at home form work or from my mobile device is easy with TeamViewer. Some times you need something from your personal computer, or you need a connection without proxy servers, then TeamViewer works for me.

Google Calendar  I am an android user. So I have an integrated phone with my Google account, which leads me to use Google Calendar for my appointments, it is nice to have a synchronized agenda in my pocket all the time.

Hootsuite.com This is a social media center for you. In free plan you can add up to five accounts, and control all accounts through online dashboard. It is nice to have all social media in one screen, control all your virtual presence, develop your personal brand and image.

That’s all, I am using these tools to get my productivity and collaboration boosted. Try them and comment me, or comment the online tools you like most.