Monday, 6 June 2016

What every programmer should know about Mathematics


Many programmers ask – “Does computer programming have any practical use of math that we learned as students?”

Computer science derives from "compute" and we cannot compute without numbers and mathematics. We, as programmers must realize this.

Programmers wear different hats. Besides writing programs, they have to troubleshoot problems or compare run time complexities of algorithms that they design. They have to make estimates of error rates or make projections. Sometime data collection before making an informed decision is crucial. I have also worn these hats at multiple times and draws from his own experiences of using math to make more informed decisions over the years.

Borrowing simple math concepts from trigonometry, calculus, limits, curve fitting, probability theory, linear algebra, distributions, etc. this paper (link below) highlights how they can be used in almost every aspect that a programmer has to take into account depending upon how experienced they are.

We will size a thread pool, use Fourier transform to help in troubleshooting a tricky issue, assess chances of our request landing on some faulty node behind a load balancer, calculate chances of two concurrent requests, try to optimize our memory utilization, understand rate change in message arrival, understand how our different queues are loaded after state transitions from one to another, etc....

So, let us get read to wear a programmer hat that we always wear with an added feather of mathematical concepts!

The kindle version of the paper: What every programmer should know about Mathematics

Happy learning!

Thursday, 26 February 2015

Decline that job offer.


The "blind" choice

A popular saying goes - "There's none so blind as those who will not see." When it comes to selecting the right offer, that applies to me too.

Over a span of 17 years, I've given interviews at a lot of companies - both big and small, both relevant and irrelevant. Needless to say, when it comes to accepting the right job, I've made some bad mistakes too. There are a few common threads between those "bad" places which I chose not to join or made a mistake to join but corrected it soon afterwards.

A software engineer I worked with a few years back, ran into this dilemma. He wanted some advice on which offer to accept and which ones to let go. I had a small talk with him and saw the same patterns emerge. Here is a set of those antipatterns drawn from my own experiences. 

Interview Process Antipatterns

I am assuming that you are not desperate to get just any offer that comes your way. If that is the case, then read no further.

  1. Time is money: I happened to attend an interview where there was no sign of interviewer even after a delay of an hour. I called up the HR from reception. They asked me to wait more. I walked away. Now, let me explain why I did this. Earlier in my career, I happened to make the same mistake of waiting for more than 30 minutes. The interviewer came finally and gave some lame excuse, did not even bother to apologize. I finally cleared all rounds and joined. To my horror, everything was laid back there. Everyone was in their comfort zones and meetings - well, you guessed it right.  Of course, one interviewer can genuinely be delayed. However, such patterns run deep into the fabric of the company and you will know that when other interviewers are also giving same kind of excuses for being late. Assigning a -5 is not a bad idea.

  2. "Money, it's a crime": Yes, Pink Floyd got it right in their song Money. No, do not get me wrong. Sometime the recruiter/ HR will drop a subtle hint that what you are getting paid is not something they can match. Even then they will make you go through all the process only to tell you at the end that this is the best they can offer and make you want to believe why their work is always better than the others and why you should still accept their offer. Seems to me they are big believers in miracles. If you sense that at any point in time of the process, it is best to not waste your time any more. A -10 is not uncalled for.

  3. Who knows, who cares? Who is John Galt anywez? - When interviewer starts with the same "tell me something about yourself, your work" and upon hearing your reply does not even bother to probe further, then it tells me 3 things -
    • Either the fellow is super smart and does not need any clarification
    • That the work you did is super boring
    • He/ she is mostly disinterested. This will become clearer if they ask you to explain about your work but appear to be drawn into their laptops.
      Assign a -1

  4. No introduction to their roles - These are those category of interviewers who are just in a hurry to be done with the interview process. You must interrupt them and ask them to explain what is the role they play and what is their interest in the project they are hiring you for. Give a -1,  if they give a disconnected answer.

  5. Going around in circles - This is a no-brainer. Once I was called for a full day interview and each one of them (5 of them !!!) kept asking the same question. After 2 rounds, I politely told the third interviewer that the other 2 have already discussed the question in detail. Just like a factory programmed machine, the bloke could not break away from the mould and still went back to the same question.
    This tells me of a fundamental problem with the team I may be getting an offer from. I'd give -2 for the circus, I mean the circles.

  6. Basic Instincts - Once a person interviewing me asked to explain what exactly is a Spring Framework as he went on to munch on his sandwich. Another place, someone asked me the difference between Hadoop and MapReduce and when will I use which one???? Starting with basic questions may be ok, but asking a vague question cannot be. I usually give -2 for these.

  7. Not prepared - It is a responsibility of interviewer to have familiarized themselves with your profile and area of work. I usually do not need a print out myself when I am interviewing others. If they happen to spend time reading your profile when they should be asking you questions, then that shows another fundamental issue with their ability to multitask well. I'd give a -2.

  8. Big shots - Once a recruiter asked me what all technologies I had known well. Upon hearing those, he said 'Oh! You are not working on YYY still?" And without waiting to hear me out, went on to explain why their company is the best ,why they only hire engineers from premier colleges and why they are the next big thing on this planet. Sounds familiar? Give a -2.
    1. Interviewers at such places will usually be those who build ivory towers that never deliver. Without bothering to know if you have ever worked on say XXX, the interviewers will only ask questions such as "How do you scale XXX to 40 billion transactions in a day, etc." The point is that those are not wrong questions, but they should look at your CV and know you never worked on XXX before. A better question would be to ask you how would you scale your existing application to do billions of transactions, if not already done.  Don't hesitate, give a -5.
    2. You may get good work, but soon you will also be all fluff.

  9. Every Science begins with a question - If the interviewer does not bother to ask you if you have any clarifying questions, then it is a sure shot ticket to hell. If they begin or end their interview saying that "You already have the JD so, I assume you are clear about the work involved", then it speaks volumes about disorder their house is in. I'd give a -2.

  10. Go-getters - Let me say that this is one term I have come to dislike the most. It is the most abused term and serves no other purpose but as a means to hide inefficiencies of the hiring team. Every assignment worth its salt will have some intricacies which only seasoned members will be aware of. Sample this - "We only hire go-getters." or "We like people who can figure out things for themselves. We only hire very smart people". This is great but is also a way to say -"Actually, we do not have any plan to impart you any knowledge. You are expected to perform from day one." Give a -5.

  11. Hiring Manager - Usually, your hiring manager will definitely talk to you during the process. Once, I ran into a situation that the hiring manager was on leave and the requirement was urgent. I insisted that I will not accept the offer until I get a face to face audience with him. His/ her basic traits can sometime be gauged based on your talks with them. The most important is that if your hunch tells you that you would not work well with him, then trust your instincts and decline the offer. 
    1. It is important to ask your hiring manager about the complexity of work that they do. Based on their response, you will know whether they are excited about it at all or not. 
    2. Ask them how would they ensure that you are given enough knowledge transfer. 
    3. Ask them why is your role important to their success
If they cannot patiently answer those questions to your satisfaction, give them a -5.

Decline that job offer if your score runs deep into the minus scale. You will thank yourself later. Happy job hunting!