Wednesday, June 27, 2018

Something About Professional Growth

I have done job search very recently and a few years back to extend the career horizons. This post is not to provide tips, but to share one realisation that I have gone through during the process.

What happened a lot of times with me is that, it seemed to me that I would be a perfect fit for a role. My interview would go well and I would be certain that the people at the other end of discussion loved me. But, then I would get a regret mail. Whereas, I would get green signal response for roles which would not match my exact past experience. I used to be flabbergasted.

But not anymore. What I realised is that when a potential employer look at your past experience, they are trying to assess you based your past achievements and determine how you take challenging situations. Most of the time they are not looking for exact matches. Of course, for very specific roles, this is not true. But, this holds good for most of the situations.

What they want most of the time is that you have a room to grow. If you are an exact fit, you would become bored quite soon, well unless you have home loans.

I believe this is a good thing. Variety and diversity always help. Maintaining diversity in anything is helpful when things start going south, and you would not realise about problematic nature of mono-culture when things are good. I personally believe even a very technical role needs certain room to grow.

Something to think about when you do not hear positively from a potential employer for a role that exactly matches your past experiences.

Saturday, June 23, 2018

Preliminary Monte-Carlo to Find Value of Pi

This may be called Monte Carlo, but, I do not think it is a good example. Nevertheless, let us try to see. This is a product of a situation when you do not have much left to watch on Netflix.

The idea is to use the pseudo random number generator in C to get random points inside a square of sides with length 2 units. We shall try to determine if a point is lying inside the circle that is inscribed inside it. If random numbers are well spread, then ratio of number of points inside the circle to the number of points inside the square should be equal to that their respective areas.

Apart from the usual stuffs, one thing to note is that the pseudo random number generator in C is not thread-safe. The seed gets locked and its state gets changed in usual rand() call. GCC kindly provides this thread-safe version of it (rand_r()). Otherwise, with multi-threading, run-time actually increases.

Another minor thing is that since the pseudo-random numbers generation is mostly similar time consuming, default OpenMP for option (static) is best fit.

This is a plot of percentage error vs number of iteration. Probably due to pseudo part of the random numbers, we might not ever reach very close to the real value as we increase number of iteration most of the time.

You can find the code here. Please let me know your comments.