How to avoid and outlive layoffs as a programmer?

The motivation for this post came from Microsoft/Nokia layoffs of July 2014. However, suggestions below are applicable to programmers in general.

 The Complacent Programmer

You are a programmer working in a company for several years. Over the years, you have become proficient in your day job. However, you have also become somewhat complacent. Sometimes your job even feels monotonous. You have been thinking of finding a new challenge for a while but the dreaded technical interviews have kept you from applying. When a recruiter contacts you on LinkedIn, you know that you should explore this opportunity but you tell the recruiter that “I’m not looking for a new challenge but I’ll keep your email around in case things change”.

There’s even a rumor of impending changes in your organization and in your heart you know that you might be impacted but you don’t want to think about it. Instead you pretend that it’s not happening or you pacify yourself by counting all the critical components you own and how your team can fall apart without you … and most of the times you’d be right … until you are not.

Do you Match the profile?

First, don’t lie to yourself. If you have been in your current job for more than 4 years, you are probably in a comfort zone (there are always exceptions). A simple litmus test is that if your job has stopped providing new challenges, you know all the scripts by heart and you remember all the APIs, then you are probably in ‘Cruise Mode’.

Why Change Jobs Anyway?
  • It keeps you updated with newest tools and technologies. Ever found yourself wondering what alien technology is AngularJS or heard someone saying that C++ has shared_ptr or vector.emplace_back().
  • Your peers with same years of experience and similar skill set might be earning more.
  • Layoffs can happen anytime, sometimes even without warning. Switching jobs every few years keeps your experience relevant and keeps you prepared for times when your badge suddenly stops working one day. 
Why programming interviews are different than your day job?

There’s a lot of debate about whether current style of programming interviews is a good proxy for your technical skills or not and you can debate all you want about the merits and demerits of whiteboard interviews. However, the reality is, whether you like it or not, this is the most common way of evaluating programmers and you have to play by the rules.

Programming interviews are mostly focused on ‘toy problems’ designed to explore your raw problem solving skills which require preparation and practice. In contrast, your day job is mostly about designing and developing a complex system where complexity comes from a huge list of (often conflicting) customer requirements and dependencies between sub-components.

Your day job v.s. programming interviews is similar to walking v.s. hiking. You can comfortably walk a couple of miles everyday thinking that you are ready for a hike but once you hit the mountains, you realize it’s a totally different ballgame.

So you are ready to prepare. Where to start? Coderust has devised a 4 week plan (with questions from Coderust and elsewhere) that you can use to jumpstart your preparation.

Programming Interview Preparation – Week 1

Start your Week 1 with going through your favorite Data Structures and Algorithms book. Then move on to practice following questions.

  1. Implement binary search on a sorted array.
  2. Rotate an array by integer N.
  3. Find smallest common number in three sorted arrays.
  4. Remove duplicate characters from a string.
  5. Reverse order of words in a sentence.
  6. Reverse a singly linked list.
  7. Merge two sorted linked lists.
  8. Implement iterative in-order traversal of a binary tree.
  9. Validate if two binary trees are identical.
  10. Print perimeter of a binary tree.
  11. Implement stack using queues.Find square root of a real number.
Programming Interview Preparation – Week 2

Practice more problems during Week 2.

  1. Implement integer division without using division or multiplication operators.
  2. Find all palindromic substrings in a given string.
  3. Find an element in a rotated array that was originally sorted.
  4. Find sub-array with largest sum in an integer array.
  5. Reverse even nodes in a linked list i.e. a->b->c->d->e becomes a->d->c->b->e.
  6. Implement deep copy of a singly linked list where node’s structure has an additional arbitrary pointer(pointing to any node in the linked list).
  7. Find nth highest number in a binary search tree.
  8. Implement level order traversal of a binary tree.
  9. Implement clone(deep copy) of a graph.
Programming Interview Preparation – Week 3

Practice even more problems during Wee 3.

  1. Find all permutations of a given string.
  2. Find all possible combinations of a given string.
  3. Find number of ways to make change of given amount using coins of given denominations (coin changing problem).
  4. Find number of ways to make a given score in a game (like baseball) where a player can score 1, 2, or 4 runs).
  5. Sort two arrays of ‘n’ nuts and ‘n’ bolts. Nuts can be compared with bolts and vice versa. A nut can’t be compared with another nut and a bolt can’t be compared with another bolt.
  6. Implement serialization and de-serialization of a binary tree.
  7. Determine if a string can be segmented into valid dictionary words.
  8. Implement regular expression matching.
  9. Implement boggle game.
  10. Implement LRU cache.
Programming Interview Preparation – Week 4 and beyond

Use week 4 and beyond to focus on non-coding aspects of the interview like design etc.

  1. Brush up your knowledge of Distributed Systems if you are a backend developer.
  2. More discussion about Design interview questions for senior engineers.
  3. If you’re a front end developer, practice common JavaScript Interview Questions and look at the latest technologies like AngularJS/React/Bootstrap.
  4. You can find a comprehensive list of interview preparation resources at
  5. Some tips for writing code on white-board at Effective Whiteboard Programming During Interviews.
  6. Practice programming problems using an online judge like

Coderust is an app (iOS and Android) that helps you prepare for programming interviews. Take a look at for more details. Find us on Facebook at

Effective Whiteboarding during Programming Interviews


Coderust Owl has some tips for using whiteboard effectively in a programming interview.


Notes and figures on the side

Use one corner of the whiteboard to note down the requirements you have heard or an example figure that your interviewer has drawn. As you are thinking and asking clarifying questions to your interviewer take notes there. These can just be one-word bullets to make you remember all the scenarios.

whiteboard2Write Clearly

Try to write as clearly as possible while not slowing down a lot. Yes they are not interested in seeing your calligraphy skills BUT you are still writing this for someone else to read. It has to be legible. The cleaner you write the easier it is for your interviewer to understand. Design diagrams should also be easily understandable.

whiteboard3 Use the Space Efficiently

Several times, candidates start writing XL size code and then have to inevitably write in super small font cramming in many lines in a small area. Then they turn to use arrows to point to other parts of the board where they will write the remaining code. Avoid that. It’s hard to follow code written on different parts of the board.

When you start writing code for problems, remember that most interview problem solutions span at least 15 – 20 lines of code. You need to make enough room for this much content.

Adapt to the size of whiteboard on which you are going to solve the problem. Sizes of the whiteboard vary a lot even within different rooms of the same company. Always leave some room for potential edits e.g. extra parameters, null checks, trivial if conditions etc.

One pro tip to use space efficiently is to structure your code in small functions.

Edits are part of the game

Don’t be afraid to change code. Several times, interviewers would modify requirements to see how you handle a slightly different or challenging variation of the same problem.

You will also have to edit your code if you find a bug during testing. In such cases, instead of overwriting or crossing out code, it’s better to erase and re-write that part of the code.


Make sure you have a whiteboard at your home. It helps a lot. You should practice solving problems on a whiteboard before your interview.

As you begin preparing for your interview, consider practicing on whiteboard an important part of your preparation along with studying for algorithmic and design problems.

Coderust is an app (iOS and Android) that helps you prepare for programming interviews. Take a look at for more details. Find us on Facebook at

I have been in my current job for a while and I want to move. What should I expect in my interviews? by Soban Hameed

Soban Hameed is an active Quora Contributor and helps people with programming interviews preparation. We requested him to do a blog post on the above topic and he gladly agreed.

This is a question I hear a lot. Interview preparation is intimidating and for people with several years of experience it’s even more so because they may not be used to solving such problems in daily routine and will need revising algorithms and concepts and above all the expectations are very high. If you are a senior IC here goes the general theme that’s followed when interviewing someone like you.

Design: There is a heavy focus on Design. For example If you are going for a services team do expect that you will be asked about designing services that can scale, handle spikes etc. I strongly recommend that candidates read a lot of distributed systems material before going for an interview in these teams/companies. Search google/quora for distributed system material you will find some very nice resource like dynamo paper etc.

Capacity Planning” is a new category of design questions that I have seen in a lot of interviews lately. To answer these kind of questions you have to be good at current system numbers (Search for “numbers every programmer should know”) and have a very thorough understanding of bottlenecks in a distributed system. This category is my favorite and really gives very good insight on depth of senior folks we are interviewing.

Problem Solving: You like it or not but I would expect at least 1 DP question in senior loops. Also I strongly recommend that you look at wide variety of problems across different categories in interview prep books(Algorithm Design Manual, CTCI), apps(Coderust) or website (Glassdoor, Careercup are all good resources). That will increase your chance of succeeding many folds. Also you have to come across as someone who asks the right clarifying questions to understand vague problems.

Coding: It is expected as a seasoned developer that your code will be more organized, less buggy and you think through all cases before you go and write code on the whiteboard. You have to show that you are well aware of basic data structures in the language you have chosen to code in. Also some companies go to the extent of picking on syntax mistakes but I am not a big fan of that.

For the above two categories Coderust is a good resource. I love the portability aspect that I can revise problems whenever needed. It needs to add more problems.

Good Luck with your interview preparation.


Interview Problems Dissected


Coderust takes an approach to interview problem solving that mimics a real interview experience.

  • You are given a problem with detailed description and diagrams to understand the problem
  • If you still don’t get it there are hints to get you to the right solution
  • For each solution you will see detailed description & visualizations with memory and runtime complexities
  • Lastly you can check out Syntax Highlighted Code for each solution in the language of your preference ( C++, Java & Python)

Hello World from Coderust Blog


Welcome to Coderust blog. This blog will capture

  • features of the Coderust app
  • notes on upcoming releases
  • reviews from candidates who are using Coderust to prepare for their programming interviews

Owl will soon be inviting guest bloggers to cover all aspects of programming interviews preparation to make Coderust a true interview preparation guide.