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.
- Implement binary search on a sorted array.
- Rotate an array by integer N.
- Find smallest common number in three sorted arrays.
- Remove duplicate characters from a string.
- Reverse order of words in a sentence.
- Reverse a singly linked list.
- Merge two sorted linked lists.
- Implement iterative in-order traversal of a binary tree.
- Validate if two binary trees are identical.
- Print perimeter of a binary tree.
- Implement stack using queues.Find square root of a real number.
Programming Interview Preparation – Week 2
Practice more problems during Week 2.
- Implement integer division without using division or multiplication operators.
- Find all palindromic substrings in a given string.
- Find an element in a rotated array that was originally sorted.
- Find sub-array with largest sum in an integer array.
- Reverse even nodes in a linked list i.e. a->b->c->d->e becomes a->d->c->b->e.
- 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).
- Find nth highest number in a binary search tree.
- Implement level order traversal of a binary tree.
- Implement clone(deep copy) of a graph.
Programming Interview Preparation – Week 3
Practice even more problems during Wee 3.
- Find all permutations of a given string.
- Find all possible combinations of a given string.
- Find number of ways to make change of given amount using coins of given denominations (coin changing problem).
- Find number of ways to make a given score in a game (like baseball) where a player can score 1, 2, or 4 runs).
- 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.
- Implement serialization and de-serialization of a binary tree.
- Determine if a string can be segmented into valid dictionary words.
- Implement regular expression matching.
- Implement boggle game.
- 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.
- Brush up your knowledge of Distributed Systems if you are a backend developer.
- More discussion about Design interview questions for senior engineers.
- You can find a comprehensive list of interview preparation resources at https://github.com/andreis/interview
- Some tips for writing code on white-board at Effective Whiteboard Programming During Interviews.
- Practice programming problems using an online judge like https://oj.leetcode.com/