Friday, March 30, 2018

My preparation for Google, Amazon interviews

Problem solving:

First book - Cracking the coding interview (CCI) is invaluable for the tips it provides for the preparations. The best being - stop coding in an editor. Code on paper. I did that diligently for about 50 problems. Write once, scratch it, write again, scratch again and write again, work through the tests, make sure things are good before calling it done.

What did I really write on the paper?
HiredInTech algorithms course is a beautiful course which provides the right structure to approach a problem - Algorithm canvas. Diligently followed this. Really really invaluable.

What problems did I select?
I picked problems from CCI, searched for similar problems on Leetcode and coded them on paper and then submitted them online. Sometimes, I wouldn't see the code on paper and later figure out that I had omitted a single line which was causing WA :-) My code on paper was pretty close to being AC (Accepted.)
I bought a book from Leetcode containing 50 problems from different areas and coded them on paper first, then submitted them online. The best part of the book is that it gives you the list of questions that you can ask before starting to solve a problem.

Why Leetcode?
The problems seem to be picked from multiple tech companies that people usually target.
In case you get a wrong answer, the failed test case shows up.
After you get a problem right, you can compare your solution with other solutions and look for the ones that got the best time.
Really good discussion forum with top answers.
You can see your percentage of accuracy and aim to improve it.
In case you opt for the premium subscription, you have options to filter questions based on company, you can start a timed mock interview based on a random problem, there is an exclusive Google interview track and probably more things being added.

Other resources:
Book - Elements of programming interviews

System design:
Courses:
HiredInTech's system design course again gives a very good structure
Paid course on educative is really good to provide the basic building blocks and then moves on to provide solutions to many commonly asked questions. 
Recently, I found a beautiful place to learn system design: The architecture of Open Source applications. It has 4 books filled with knowledge.

Extra resources
I came across this video that shows 2 Google employees showing you how an interview works. One of them becomes the interviewer and the other becomes the interviewee. Many invaluable lessons embedded in it. I made copious notes from each minute.

Did I get a job?
Google - NO
My first phone screen interview was with Google and I performed really badly there. I bungled it up and lost that opportunity. 
Amazon - YES
After 2 phone screens and 5 onsite interviews, I got an offer from Amazon, Canada.
Target - YES
I landed a job at Target and met some really cool people there. Had lots of fun.

Interview experiences:
Google:
This happened via Google hangout and you get the see the interviewer. Coding was on Google docs (simple as a notepad without any formatting.)
Questions started with basic C++, then moved to class design and coding the methods.
I made some really basic errors that I don't want to write here. 
On second thoughts, the basic mistakes I made was to not think of problems in a very fundamental manner. Like one question wanted me to see how I can manage to work on strings and ints. I said templates in C++ and bungled it up. All it needed was overloading.
Then, I wrote a swap method which created a new vector which had the issue of picking an element multiple times from a vector due to the probability of a random number occurring multiple times. After the interviewer showed me that bug, I removed the element from the source vector and placed it into the target vector. Need I talk about the issues here? You now know why I failed. 
Beautiful learning.

Target:
Phone screen followed by 2 onsite interviews. The first onsite interview lasted 2 hours - the first hour was spent in coding, the next was spent in discussing the approach I took and other options. The second onsite interview was partly technical and partly managerial (because I had applied for an engineering manager's role.)

Amazon:
Phone screens:
Callers were from Seattle with one principal engineer and an SDE3. The first one lasted 60 min and the second one lasted 90 min (many thanks to the interviewer to give me the opportunity to finish the discussion and the code.)
Great discussions in all.
What I liked is that they were more like discussions and not like someone grilling you for answers. They were looking to see how I approached the problems and how I tackled all the bottlenecks. In fact, I identified many bottlenecks and figured how to get over them too.

Onsite:
Again, all the interviews felt like discussions rather than grilling me. All of them focussed on my approach to problem-solving and provided helpful tips when things were not going well.
Major problem came in the system design round as the problem took me by surprise completely. I was NOT driving the conversation. This was a huge problem. I needed to drive the conversation but never did that.

Other crazy things I did:
I took a paid ($180) mock interview with Gainlo where the interviewer (ex Amazon) gave me a OOD (Object Oriented Design) problem. Somehow, I thought he was busy doing other stuff during the interview (I may be wrong here.) I was hoping he'd help me with prep tips, but he pointed me to Cracking coding interview and told me about his $180/hr classes where he helps people 1x1 to solve problems in a better way. Overall, not a great experience personally.

So, that's my story. I will try to add more details as time goes. Looks like a good start so far.
v2.0. Updated: April 5th 2018.


Friday, June 12, 2015

My subscription on Safari Books Online...

Never did i think seriously of subscribing to Safari books online, but somehow after a really long time, i signed up for the free trial and liked it so much that i could not stop myself subscribing to it. There are thousands of books and videos out there that i stopped googling for many topics and instead started searching on safari. The results were pretty good and i have always believed in the technical depth that books offer. Never once was i disappointed.

Right now, i am inspired by:
* Inventors at work
* Making it big in Software. Get the Job. Work the Org. Become great.
* Liquid Thinking: Inspirational lessons from the world's greatest achievers
* How Google tests Software

Also, I got a new Android phone (Moto G2) and it is really good to read books in the "Safari Queue" app although it is in the beta state and requires an invite from the Safri people working on the app. This app needs many changes to get close to its Apple store counterpart, but so far, I really love the app.

One video that is awesome is the talk at OSCON 2014: Hacking the KernelHacking Myself - Kelley Nielsen

On Dynamic programming...struggles...

I understand the term 'Dynamic Programming' comes from the initial days when Richard Bellman coined it to mean a tabular method (Programming) with the spice of Dynamic added to it to make it sound interesting. The source of this being the section title 'Dynamic Programming' course from Udacity called "Computability, Complexity & Algorithms'. This Udacity course gives a nice introduction and refers 2 interesting books: 
1. Algorithms by Dasgupta, Papadimitriou, and Vazirani
2. Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein

I started reading those books coupled with the tutorial on topcoder. Am struggling to get ahead and solve problems, especially the coin change problem on Hackerrank. Right now, it looks like recursive thinking is a huge problem for me :-)

Nevertheless, i will not give up and will try to make a video once i am able to solve it.

Sunday, January 25, 2015

My subscription at Lynda.com

One learning site that impressed me a lot is Lynda.com. Initially, I took the $25 basic plan (without download of the exercises/ project files.) and after 2 months (and $50 spent :-) ), I got this email which said that at $256, I could get a full year premium access and I signed up :-). This is one service that I think is pretty useful and worth the money spent on it. Some of my friends also have subscribed by paying about $75 for 3 months of basic access. What are the courses that interested me:
* Foundations of Programming series
* Series on Networking
* Code clinics in C++, Java, Python
* Many courses on Leadership (one thing to mention - Intelligent disobedience), Management
* CentOS, SSH
* Web services
* Databases - Postgres, MySQL, CouchDB
* iOS (getting started, gaming)

and many more...just pure awesomeness. Thank you lynda.com.

Thursday, October 30, 2014

Tribute to a top coder who called himself humblefool...Harsha Suryanarayana

Some leave a lasting impression after just one meeting
Some don't even after many meetings
There are some who leave a lasting impression even when you don't meet them
They inspire by their deeds and philosophy towards life
One such person that i heard of recently went by the handle 'humblefool' on topcoder. His name - Harsha Suryanarayana.
He was a Red coder in topcoder, one of the firsts from India.
Sadly, he was recalled by God on June 15th 2014. He was just 32.
Here's a tribute published on him.
Look for his answers on Quora here.
His friend Animesh writes about him here.
Here's the youtube channel that he and his friends started. Just watched a few videos and I am guessing that this video on maximum sum sub array could have been his. Beautiful videos - thank you humblefool, Animesh and gang!
He was fondly called 'The Lord' and may 'The Lord' live in the great code that everyone writes.

Wednesday, August 13, 2014

Thursday, July 24, 2014

CodeChef JULY long and cookoff problems

My performance was bad in July. Could solve 2 problems in the long contest:CSUB, RETPO and 2 in the Cookoff: RRCOPY, RRSUM.

Got stuck with FROGV in the long contest and FRNDS in the Cookoff. Need to do better.

Read Anudeep's blog to get more inspiration: 
http://blog.anudeep2011.com/ioi-and-acm-learning-community/
http://blog.anudeep2011.com/when-2-guys-talk-its-not-always-about-girlssports/

Wednesday, July 23, 2014

Neat introduction to Combinatorial games

I was looking to solve Hackerrank w7 challenges and one problem was about the game of Nim. After that, I started to look up good introductions to Nim. I found this one interesting: comb.pdf
I found it very useful to understand the game.

This one talks about Backward induction, P-positions and N-positions. Just what is required.

Wednesday, May 7, 2014

Udacity.com : CS101: Introduction to Computer Science done :-)

Got my CS101 completion certificate. Awesome learning and Prof.David Evans rocked the students for sure. 

Next will be start off my project (more later). 

Also, started the CS212: Design of Computer Programs by Dr.Peter Norvig.

Sad part is that Udacity is discontinuing the issue of certificates for the free courses :-(

CodeChef May 2014 Long challenge problems...

I have always regarded CodeChef very highly for the kind of problems they come up with and the tutorials after the contests. May 2014 has quite a few interesting problems of which I have solved 3: OJUMPS, RRSTONE and COMPILER. Attempting the Strange Matrix now (CHEFBM)

The name in CAPS are the problem codes.
Feels blissful to solve problems :-)