Dec 13, 2020Should you never be the smartest person in the room?Growing up, I knew pretty early in my life that I wanted to pursue Computer Science as a career. Naturally, I wanted to go to the best schools in India that offered this course — but I couldn’t make it through their entrance exams. That was a huge bummer for…Career Advice3 min read

Jul 5, 2020Luck ✨Lockdown made me get into working on my side-projects. I obviously wanted to be successful, so I started reading a bunch of business books side by side. A common theme I came across all these successful stories was the “luck” factor. “I was there at the right place right time”. …2 min read

Jan 28, 2019Paranoid state machineIn one of our ruby project, we are using AASM gem. This gem lets you build a finite state machine for Ruby objects. We usually use it with ActiveRecord to persist the “state” of an object. This gem also provides simple API methods to switch the states of the object…Ruby On Rails1 min read

Feb 19, 2018Ruby Object ModelI was super new to Ruby and the Rails magic scared the shit out of me. Understanding how objects work in Ruby was crucial to writing good software. Weird thing about ruby is that the object can adopt behaviors that are not defined by their classes, which is the central…Ruby3 min read

Published in Yask123·Jan 9, 2017Recursion via Mathematical InductionHow to think about recursion questions: The best way to think about recursion questions is to think in terms of Mathematical Induction. From Wiki: Mathematical induction is a mathematical proof technique used to prove a given statement about any well-ordered set. …Programming2 min read

Aug 24, 2016My Flipkart internship experienceMy 2 month internship at Flipkart is almost over. It was such a wonderful experience. I got to work on a very impactful project with a super awesome web team (People who built Flipkart Lite). A tiny glimpse of the impact of my work: Flipkart’s mobile product pages will…Flipkart6 min read

May 22, 2016Check LinkedList for PalindromeO(n) solution would be to reverse half of the linkedlist and then keep two pointers (starting from the beginning and starting from the mid), keep checking if values in the nodes are same. You’ll have to be extra carefull with the odd/even length of the linkedlist class Node(object)…Programming1 min read

May 20, 2016Implementing Square root functionI got this question in my Assembly lab. I had to code this up for 8086 processor. But I’ll be writing about the approach here. If `r` is the square root of `X`, then r*r == X. We can use the binary search aproach to search for this number `r`, since it would lie between [1,X]. Thus, if r*r< X, then we can search for the number in upper right of the function? If r*r > X, then we should expect the square root to be on the left side of the function?Mathematics1 min read

May 20, 2016Finding range in O(log n) in sorted arraySo, the question is to find the range of the number in a sorted array. Eg: in a list [1,2,3,4,4,4,4,4,4,5] , the range of 4 is 3 to 9. To get O(log n) we’ll use Binary search. We’ll actually use it twice to find upper and lower range. To get…Programming2 min read

May 20, 2016Finding the missing value in the given range in constant space and O(n) time complexitySo, I came across this question recently which got me thinking for a while. It’s easy to track frequency in a hash-table and spit out the number whose frequency is zero in O(n). But, we can’t use additional space. But, as its mentioned in the question, the array’s length is…Programming2 min read