The toughest interview question

Posted on Tue 29 July 2014 in Programming • Tagged with programming, interviewsLeave a comment

What is the output of the following C code snippet?

int n = 1;
printf("%d %d %d\n", n++, ++n, n++ + ++n);

This is a tricky question. Any attempt to answer this question requires either a deep understanding of your compiler’s parser or a complete ignorance of C. Even ...

Continue reading

In search of the perfect blogging platform

Posted on Wed 23 July 2014 in Random • Tagged with musings, miscLeave a comment

What makes a good blogging platform?

Leaving the tech details, feature lists and other bells and whistles aside, a good blogging platform’s primary aim is twofold:

  1. Make blogging enjoyable. Entice the blogger into writing more articles.
  2. Make reading enjoyable. The output of the blogging platform should be easy to ...
Continue reading

Abstract Classes and Factory Design Pattern in Python

Posted on Thu 19 December 2013 in Programming • Tagged with python, programmingLeave a comment

Abstract Classes are one of the most useful and important concepts in Object Oriented Programming. I’ll attempt to illustrate their usefulness, and their usage in Python 2.7 with the following (seemingly contrived) example:

Let us say, you want/have to implement posting updates on Facebook using Python. Your ...

Continue reading

New Year Resolutions and Nostalgia

Posted on Tue 01 January 2013 in Random • Tagged with new year resolutions, nostalgiaLeave a comment

I was going through this link today when I could not help but feel an overwhelming sense of sadness and incompleteness.

I will be graduating in May, 2013 from the Indian Institute of Technology, Varanasi. The best 4 years of my life already behind me. As I was going through ...

Continue reading