40 Distributed Systems Interview Questions You Must Know

Ive broken this guide into bite-sized chunks by topic and so I recommend you bookmark it. Ive found spaced learning and repetition to be incredibly valuable tools to learn and retain information. And Ive designed this guide to be chunked down into pieces that are easy to do spaced repetition with.

Distributed computing Interview Questions and Answers 2019 Part-1 | Distributed computing

TCP – Transmission Control Protocol

TCP is a utility built on top of IP. As you may know from reading my posts, I firmly believe you need to understand why something was invented in order to truly understand what it does.

TCP was created to solve a problem with IP. Data over IP is typically sent in multiple packets because each packet is fairly small (2^16 bytes). Multiple packets can result in (A) lost or dropped packets and (B) disordered packets, thus corrupting the transmitted data. TCP solves both of these by guaranteeing transmission of packets in an ordered way.

Being built on top of IP, the packet has a header called the TCP header in addition to the IP header. This TCP header contains information about the ordering of packets, and the number of packets and so on. This ensures that the data is reliably received at the other end. It is generally referred to as TCP/IP because it is built on top of IP.

TCP needs to establish a connection between source and destination before it transmits the packets, and it does this via a “handshake”. This connection itself is established using packets where the source informs the destination that it wants to open a connection, and the destination says OK, and then a connection is opened.

This, in effect, is what happens when a server “listens” at a port – just before it starts to listen there is a handshake, and then the connection is opened (listening starts). Similarly, one sends the other a message that it is about to close the connection, and that ends the connection.

A popular solution – consistent hashing

Unfortunately this is the part where I feel word descriptions will not be enough. Consistent hashing is best understood visually. But the purpose of this post so far is to give you an intuition around the problem, what it is, why it arises, and what the shortcomings in a basic solution might be. Keep that firmly in mind.

The key problem with naive hashing, as we discussed, is that when (A) a server fails, traffic still gets routed to it, and (B) you add a new server, the allocations can get substantially changed, thus losing the benefits of previous caches.

There are two very important things to keep in mind when digging into consistent hashing:

  • Consistent hashing does not eliminate the problems, especially B. But it does reduce the problems a lot. At first you might wonder what the big deal is in consistent hashing, as the underlying downside still exists – yes, but to a much smaller extent, and that itself is a valuable improvement in very large scale systems.
  • Consistent hashing applies a hash function to incoming requests and the servers. The resulting outputs therefore fall in a set range (continuum) of values. This detail is very important.
  • Please keep these in mind as you watch the below recommended video that explains consistent hashing, as otherwise its benefits may not be obvious.

    I strongly recommend this video as it embeds these principles without burdening you with too much detail.A brief intro to consistent hashing by Hannah Barton

    If youre having a little trouble really understanding why this strategy is important in load balancing, I suggest you take a break, then return to the load balancing section and then re-read this again. Its not uncommon for all this to feel very abstract unless youve directly encountered the problem in your work!

    10. What is mobile and ubiquitous computing in distributed systems?

  • Mobile computing” is the new trend in technology. Mobile devices are becoming more and more powerful, allowing them to do what desktop computers could only dream of doing just a few years ago. The ability to use your mobile device anywhere at any time means that we can now accomplish things like work remotely while travelling abroad.
  • The term ‘ubiquitous Computing’ is an interesting way to think about the world around us. Small computing devices will eventually become so prevalent in everyday objects that they are hard-to-notice, even when you’re looking for them!
  • Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *