Skip to main content

Posts

Showing posts with the label Computer Science

DNS - Domain Name Subsytem (A very High Level Dive)

Many of us would already know what a DNS is but for starters, it is the thing that converts the URL to IP address when we to hit a URL. The part I want to focus is how underrated and much unknown is this system to people apart from the fact I mentioned above.  In fact, I am lucky enough to get an in-depth look at how crucial DNS system and how it forms the backbone of highly scalable distributed system where you agree to an SLA for some milliseconds or might less at InMobi. So this post is more focused towards starters and not so fancy because that's how it should be understood. Why is DNS important ? Imagine you have to deploy a service on the internet and you agree to your consumers for 100 or 200 ms latency  but an improper DNS setup or DNS query can add 200ms or up of latency and added to that your geolocation.Hence it becomes important to tune your DNS server to your need.Let's get into details. This is a very high-level view of things and people sh...

How HTTPS works- SSL/TLS

Graphs - DFS

Its been a while I posted because I had been busy with other stuff.From now on i would be posting basically what I learn and how I implement it in my journey of preparing for the best interviews. Now I am going to implement GRAPH DFS algorithm. Graphs as we all know many people tend to fear as we implement but once you start  realising  the underlying beauty and power of the data-structure, you can not hold yourself implementing it. Graphs can be represented as 2 ways: Adjacency lists or Adjacency matrices. Here I use adjacency list because as i am using java it pretty easy to implement it using Collections framework. DFS is pretty simple : Start with a node timestamp it and go deep and deep until u cannot go anywhere and then timestamp it. Finally you would end up creating a forest of multiple trees(Starting nodes). Code below is self explanatory and if any one has any queries please let me know. And the algorithm is direct implementation of book by Corm...

Linked List using PYTHON

This is a gentle intro into data structures using python.This is my personal learning experience and to take a note of what i am learning.Please feel free to comment In this post I have tried to implement a simple Linked List using Python. First I have created a file named LList.py which will contain the following code.Then i would be using this as a module in my main file to create a implementation using these #Single node creation class class Element:     def __init__(self, x):         self.data = x         self.next = None #Linked List implementation class class LinkedList:     def __init__(self):         self.head = None         self.tail = None     def append(self, x):         e = Element(x)         if self.head is None :             self.head = e ...