Am just not able to focus. What to do?

How many times have we experienced the “aaj mann ni lag raha h” (oh no, am not into it, today) feeling!? Well, I know I have to do it. But, somehow, the mind is not into it. We end up either wasting time forcing ourselves to do it where our productivity falls due to lack of concentration. Or, we just do something else. When I know I must do it, and I think that I am interested, why can’t I still concentrate on what I need to do?

The answer to this interesting question lies in the essence of execution. Your goal is clear. You have a plan. But, you are unable to execute. How to execute well? What do natural executors do?

I maintained an excel sheet where I used to put the topic and number of hours completed. I used to tell myself that my progress depends on the number of hours I see in that xls. If 100 hours is the goal, whenever I touch 25, I used to be very happy. I celebrated by sharing on social media and with my friends. I get to 50, I again share. This does two things: 1) It pushes me to achieve it because I like the feeling when I share it. 2) It brings a fear of shame that if I do not finish, what will my friends think of me. This worked like a charm. I consistently finished the planned hours. I never cheated. But, this may not work for everyone. It depends on your nature.

Another technique that usually works is to convert the goal of “studying DLD” to the task of “writing notes for DLD” task. This task shows progress. At least, you can see the number of filled pages increasing. When there is a sense of progress, our brain is more motivated to do the task. Just reading pages after pages, or solving problem after problem, we get bored. This is because, there is no way to visibly feel the progress, especially when you do not have the big picture.

If these principles based on pride, fear of shame, and sense of progress fail, you may try transcendental approach. This approach makes a commitment to almighty or your mother that, if you do not complete this, let that girl whom I love be married to someone else. Now, at any cost, I want to finish this because, I don’t want to leave that girl to chance. What if, just in case, God really exists and what if the loss of that girl was due to my breach of promise.

At the end, this post will be incomplete if I don’t tell you one important thing. Do not force yourself too much. Sometimes, your mind know what is right for you. If nothing works, just relax, take your time to find something that works for you. As they say it, “Successful people maintain a positive focus in life no matter what is going on around them”. Good luck.


How to write a good resume/CV?

I am back yet again with something which I believe is key to our success. Resume is different from CV. Yet, for this write-up, I am going to use the terms, resume and CV, in an interchangeable manner. If you are a fresher with not much industry experience, prefer to call it a CV.  If you are severely confused, name your document the way your recruiter wants it. I will not discuss the differences here. They are irrelevant and unimportant for CSE students.

In this busy world, the time to make decisions is shrinking. Recruitment decisions are time bound as well. In this context, your resume becomes a very important tool in making your first impression. Your resume is also circulated to your interviewer. Hence, it is important that you put some effort in designing your resume/CV.

Most of us use MS Word to write our resume. MS Word is a great tool. But, an even better tool is LaTeX. Create an account on or Go to templates. Look at some resume templates. Pick the one you like and modify it with your details. This is the simplest and most effective way of writing your resume. Some recruiters may accept only .doc format in which case, you must use MS Word. Nowadays, I do not maintain a .doc file at all. You can check my CV at for a sample created through these sites. For more jazzy templates you may google.

When you use a template such as that in overleaf, you cannot go wrong with formatting. If you are using word, take care of alignment, uniformity of font, placement and length of lines. Some people have the bad habit of writing everything in small-case, and not leaving a space after period. Do not make grammatical errors. Get your resume reviewed by someone.

I do not include personal details such as Date of Birth, Religion, Marital Status, Language Spoken etc. These have become irrelevant to present day jobs. Write your resume keeping your employer in mind. Put only those details that he needs to know. This is not a testimony for your hard work. You don’t have to show off to anyone how many languages you know (for a typical IT job or a PhD admission).

A common confusion among freshers is that they run out of content. The ask, “How do I even fill two pages?”. A fresher is assessed based on his objective, education, certifications, skills, projects, performance in competitive exams, achievements, and any such relevant details. Ensure all these are there in your resume.  If it is still hard to fill, do not bother. One-page resume is just fine. Adding your small-size photo is welcome too. Resume is a live document. You should update it at least once every six months. It is a good way to check if you are doing something meaningful. Anything that goes to your resume is considered meaningful 😊.

When in doubt, just blindly follow a common template. Google for a student with similar background as you from places like MIT, Stanford or Berkeley. Usually, they have their resume reviewed by professional agencies. Just follow their template.

If these pointers helped, please leave a comment. Your long comments make my day. Thanks!

Just Got Married?

As you start your married life, keep these three things in mind.

Secret of long lasting happy married life lies in the tiny rituals you build. Small things like walking up to a small tree round the corner of your street, having a cup of tea while watching your favorite TV serial together, even a letter, or a phone call when done regularly, becomes a ritual. These rituals increase the bonding. Find and build a ritual that suits you.

How much ever you love each other, there will be arguments. There will be misunderstandings. Some may be light; some may be deep. Know that the probability of two people being mature and compromising at the same time is low. So, you be the one to compromise first.

Remember that you are entering a commitment to support and protect each other for life. This does not come with terms and conditions. At any cost, whatever may be the circumstance, do not do anything that hurts or brings shame to the other.

May God bless you with a long joyful life ahead. Wish you a very happy married life.

How to spend your time during MTech studies?

If each one of us asks, “Where should I go such that I make the best use of my time?”, we will start doing things that is most productive for us and for this universe. This is the right question which will transform you into someone great.

Now, that you have decided to go for MTech, let us answer the second best question to ask which is, “How to utilize my time during MTech?”. Before anything, my first advice is not to worry too much about what after MTech. You are in. You will rock. Believe in you. You should have a goal. But, you should not have worries like “Do I have a future”. So, your first job is to make a goal. You need a plan to achieve that goal. Do not have a plan B. That will drag you down. Always have Plan A and only Plan A. You may keep changing your Plan A. That is alright. But, at any moment, you have only one plan. All you have to do is 1) Make a Goal. 2) Plan how to achieve it. 3) Achieve it. I know this does not help. So, let us discuss a bit more in detail.

Some goals are bad. For example, “I want to work for Microsoft Research” is a bad goal. You are putting your happiness in Microsoft’s hands. Do not do that. “I want to do high quality research” is a good goal. If you do it in Microsoft, it is a blessed company. Else, it is it’s bad fate. So, all goals should be inward focused.

Having fixed this goal, the next is “How to be a good researcher?”. MTech is not for preparing yourself towards this goal. PhD is. From research perspective, MTech prepares you for a PhD. The goal of MTech program is to give you the necessary breadth in CS, much advanced than a BTech program so that you can do your PhD well. Some of you are not good at theoretical CS. Some of you are not good at programming. Some of you may not have studied few areas of your liking at depth. MTech is an opportunity to fill these gaps by taking two more years. Having done a BTech, and having prepared for GATE, you should know what your strengths and weaknesses are. Use your MTech time to remove weaknesses and add strengths. This means that you will sign up for courses, select electives, do projects accordingly. So, for someone with theoritical CS weakness or interest, the electives to chase would be Randomized Algorithms, Advanced topics in ToC, Approximation Algorithms, Number Theory and so on. If the goal is different, say, “I want a job with more than X salary”, the plan would be very different. I am not the best to advice for this goal. So, I will stay out of it.

Irrespective of what your goal is, to become a master, you need to perform on a larger stage. You should be a good communicator. You need to be good at all forms of communication – spoken, written, body language and presentation. It should be your constant endaevour to observe, and learn from all possible sources to improve your skills here. The fortunate ones can take courses inside and outside the university. But, if that can’t happen, learn from the better ones. You will always find great orators around you. Observe them. There is no other better way than to try and fail. Don’t be shy. Just do it.

Hope this helps.

Act like a Master!

Many of you have got your MTech admit and are ready to roll. Here’s a piece of mind to you.

Taking the journey of Masters is a rare privilege bestowed on selected minds that sparkle brilliance. You are chosen from a million by those who were chosen by the chosen ones! That is how important you are. Now, it is time that you act like what you really are.

So, what is it like to act like a true master?

The answer lies in the following insight. You are already good. But, you are on a journey to be great. The journey from good to great is characterized by two things: 1) Statistic Marvel, and 2) Aesthetic Delight. Alright, it is time to elaborate.

Sachin is a master! His statistics speaks for himself. Several centuries. Several days on the field. Several match winning innings. There are numbers behind each of his achievement. He was not born a master. He became one. Your story is no different. You have achieved a place in Masters program. That puts you in mind boggling circle of achievers. You beat the 2 Lakh graduates and came about top 1500 in them! You understand the “bits” that make up the computer (Number System). You know how to network them (Computer Networks). You can manage data on it (DBMS). You can design algorithms to make it do meaningful things (DS & Algo). You can model real world problems and automate several tasks (Programming). This list goes on. You have learned so much, so much that you yourself can be amazed. Irrespective of whether it is software, hardware or networking, you have studied key elements. This is what put you in the elite league of candidates who aspire to become Masters. There is statistics behind each of these elements. You scored 70+% in your BTech in most of these subjects, you scored 99+ percentile in GATE, you beat a better one in interview, you spent whopping *8.76 Lakh Minutes* (4 * 365 * 10 * 60) studying computer science. These are impressive statistics. This distinguishes you from the rest of the population. You are already statistically marvelous.

Now here is another opportunity for you to add more statistics to your resume. That is another 4.38 Lakh minutes ahead of you at a place which breathes computer science much more than what you experienced in BTech. These minutes are so much more valuable than the prior. As SRK says in Chak De India, these 4.38 lakh minutes are yours. It does not matter what happens after your MTech. Nobody can take these minutes from you. Just go and rock. Give your best. Learn from the best.

Statistics alone does not make you a true master. In fact, a true master does not care for his own stats. He cares for elegance. That second essential element is aesthetic delight. Coming back to Tendulkar, there is some beauty in the way he plays. You can just keep watching him. This feeling is what we refer to as aesthetic delight. As a master, your work should look like magic. It should inspire millions of others. You are not here to play cricket in your gully anymore. You must play in a field where there are millions of aspirants. Do not shy away from crowd. Show them some skills. Bring beauty and charm in your work. Improve your personality. Find a niche. Work on your strengths. When you are on the field, people should just want to see you, and listen to you. In short, you make your presence felt. You command respect. You are a *Master*.

The day when you exhibit statistic marvel and aesthetic delight, you would feel what it is to be a true master. This is a long journey. There is no time to rest. Unless you enjoy each minute, there is no way you will end up being successful and happy. Wake up with a goal to find a reason to smile. Go back to bed with the satisfaction of having given a true smile. Find that smile in computer science.

Good luck!

What courses should an aspiring software engineer take?

Unlike medical doctors and advocates in court, most of us end up becoming software engineer first and then do several software engineering courses. In this light, someone asking how to qualify as a software engineer makes me feel happy.

Engineering anything requires you to be good at principles, products and practices. Engineering software is no exception. The “Keep It Simple Stupid” (KISS) principle says that you should write code that is as simple as possible. The Parkinson’s Law says that “Work expands to time available”. So, if you tell your team that they have three days to finish a task, they will end up taking all three days to do that task. You need to be able to design software using Object Oriented Programming concepts, or design a DB using ER paradigm. Functional programming (Lambda Expressions) and Logic design (as in Prolog) are not that common as yet in the industry but still very different principles to learn. These principles are very interesting, and a must know for being a good engineer. Next, we need to know existing tools and technologies. I loosely categorized them as products here. There is C, Java, C++, HTML, Javascript, Full-Stack, Android, and so on. Finally, the practices matter too. How do you run the show? Agile methodology which comprises of Scrum, Reflection, etc., and various roles in it are interesting. Many young students think only of a “developer” when they talk about software engineering. In reality, there are several non-development roles such as requirements analyst, product manager, quality analyst and so on. To understand all these, I repeat, you need to know about the principles, practices and products.

Few universities package this information in a variety of courses such as Programming in C, DBMS, OOPS using Java, Algorithms, Data Structures and Software Engineering. There is no single list which is complete and correct. Coursera and such MOOC platforms provide interesting courses such as Agile Methodologies and Android development.

My perspective to programming and related courses changed when I joined a cloud computing group at Yahoo. Suddenly, distributed systems became the most relevant subject. Every algorithm we designed were distributed in nature. I go to Nokia and embedded systems and UI design are now relevant. I come to Microsoft, and find Information Retrieval, Machine Learning, Pattern Recognition, NLP as relevant subjects.

In short, finally, I concluded that, to be a good software engineer, you need to be good at all courses! But good news is, there is no hurry. You need to be a good thinker and need to know one language (say Java) to get a job. You can become good at rest on the job.

These courses alone cannot make you a good software engineer. Developing good software is equally an art as it is an engineering “discipline”. This is an interesting field where we are trying to fit an art form (as painting) into a step by step method (as in an engineering discipline). There will still be scope for creativity. So, just like teaching, you will succeed in software development only if you have the passion.

With India becoming a big exporter of software, the opportunities are plenty. The work is cool. Work environment is amazing with air-conditioned offices, latest gadgets, brilliant minds and amazing innovations. Add travel, money and monthly outings to this. What stops you from becoming a software engineer! Why not be excited!!

Huffman Coding

In a discussion forum, someone recently asked this question:

Assume a training center XYZ has 80,000 students. All students are put into one of the four batches namely, A,B,C and D. XYZ maintains the student records. It needs to compress it. Suppose A appear 40000 times, B appears 15000 times, C appears 20000 times and D appears 5000 times. Using minimum average bits per letter method, find the prefix code for A,B,C and D respectively.

Answer choices:
(a) 0, 10, 111, 001
(b) 1, 000, 01, 001
(c) 1, 001, 000, 00
(d) 0, 111, 10, 001

Here’s my answer.

In 1952, an MIT student named Huffman was working on compressing data. He found that if a document had the number 50 repeating 1000 times, you can simply map 50 to 1 and put 1 1000 times. While decompressing again replace every 1 with 50. Simple, isn’t it? Well you could have done it even better by just writing a simple C program to print 50 1000 times which will be much smaller than printing “50” 1000 times. To decompress, simply execute the C program. Anyways, MIT students are not as brilliant as you people. So, let us continue with Huffman’s logic. His objective is to take every unique item in the document with a binary number so that the document is smaller than the original document at the end of the day. So, in this case, A repeats 40000 times (most frequent). Hence, let us map it to a single bit, say 1. It could be 0 too! Let us assume 1 for now. C appears 20K times (next most frequent). So, we could assign 0 to it. But wait, we have four items. If we assign 0 and 1, there is nothing more left to assign. B comes next and D is last. So, we cannot assign 0 to C.

This is where things get complicated. How to code C, B and D such that we get most compression. The answer seems to be in prefix coding. We assign a unique prefix to each element. So, A=1, C=01, B=001, D=000. Let us say the XYZ record looks like AAAABCAAD. The code will look like 11110010111000. Can you decode it now? Let us start from the left. 1 = A. So, we have AAAA. We have no mapping for 0. So we try 00. We have no mapping for 00 also. So, we check 001. 001 = B. Wow! So, the record is AAAAB so far. Next is 0. No mapping. 01 is C. So, we get AAAABC. Then 1 = A. So, AAAABCAA. Finally, 000 = D. Thus it works! If the prefix were not unique, this would not have worked. Note that the longest item is 000. Its prefix are 0 and 00. None of them are valid codes. Similarly, 001 is a code. But its prefix are again 0 and 00 which are not codes.

Now, if we choose to assign A = 0, we assign C = 10, B=110 and D=111. This should also work. Also, note that switching B and D values will not affect the length of the final document. Clearly, there are many ways to arrive at unique prefixes. In options (a) and (c) prefixes appear as codes. So, they are clearly wrong. In option (a) 001 has prefix as 0 which is a code. In (c) 000 has 00 as prefix which is a code. In (d) 001 has 0 as prefix which is a code. So, the answer must be (b).

If you understood this far, you can now draw a simple huffman tree to get to the codes. This is what @Suvradip Das has done.

This simple trick was a research paper and we now use it so extensively. Some people think best research is cryptic which has so many jargons that nobody understands. That is so untrue. This is an example of good research. Good research is simple like this.

On a side note, if 80,000 students were to rely on XYZ for GATE coaching, it will indeed be a sad state for the country. We want well educated minds not well trained minds. God save us! Thankfully, they perhaps mean all students across branches and across the country which gives some solace.No offence to XYZ. But, the problem is that our educational institutions are not doing their job. That is the sad part.