diff --git a/_posts/2019-09-12-day-9947.md b/_posts/2019-09-12-day-9947.md new file mode 100644 index 0000000..6f0820f --- /dev/null +++ b/_posts/2019-09-12-day-9947.md @@ -0,0 +1,137 @@ +--- +layout: post +title: "Day 9947" +date: "2019-09-12 23:28:01 +0530" +tags: + - GoScale + - air_asia_interview + - amazon_preparation +--- + +## Morning + +I woke up around 9:00 AM. I thought to solve a few questions from Cracking the +coding interview, but then I reached to co-working space. + + +## First half + +I decided to appear for Air Asia coding test. I was slept around 1:00 AM +Yesterday. I was feeling drowsy. I don't know why, but I decided to took small 1 +hour nap so that I can appear in my test with a fresh mind. Around 11:40 AM I +woke up and arranged myself in a quite room for the test with a cup of +Americano. + + +### Air Asia test + +It was 1 hour long test having two questions in it. + + +### First question + +I don't remember the exact words, but it was similar to this. Given sequence of +integers of prices and target value, return value in below form. Try to purchase +items. If you raise value of target, then stop and return (sum of purchased +parts - target). If you purchase all parts and still you have not reached value +of target then return the (target - sum of all parts). + +First question I solved in some 5 minutes. After that I moved for solving second +questions. + +The second question was to find a sub sequence having maximum sum from given +array. I spent rest of my 55 minutes solving this question. Yes, I believed that +solving this question is more appropriate with backtracking, I felt that it is +to find sub sets. And finding a sub set of any element can be done better by +using Backtracking approach. I forgot how can one use backtracking in this +approach. So I started finding my notes for it. I didn't found any, I started +copying existing code and then tried to run it. Still at the end I was able to +achieve 3 out of 15 test cases. + +After observing things, I realized that I did two mistakes here. First is +finding subsequence is different than finding sub sets. Finding subsequence of +any string or anything is more appropriately achieved using two loops approach. +I don't need backtracking for finding subsequence of strings. I mean I can use +various other ways, but this is required at present. + + +## Second half + +As a lesson, I spent my day thinking about construction of subsets. What is a +minimum logic required to construct a subsets? How someone manually should +construct subsets? + +There are 2^n - 1 possible subsets of given elements of length "n". Each element +will have two states. And this we have to do for each elements. Thinking it +recursively, we have to find subsets of sub elements and then multiply that +result with current element. Thing to observer here is that this don't have +relation of addition, but it has a relation of multiplication with each other. + +### GoScale interview + +GoScale did blooper again. HR called me and fixed an appointment at 7:00 AM. No +one called me during mentioned time. I tried calling here, but her phone was +switched off after one right. + +I posted my review over Glassdoor and complained about her by calling to GoScale +office. Fortunately my called was received by one of the founders of GoScale. I +said my experience with GoScale. I think he was aware with this incident or he +was aware that his interviewing team is over burden by identifying candidates. +He told me that if I am interested then he can arrange someone to took my +interview. I told him that I am interested. + +Then I received one email having a link of Hackerrank peer code. When I joined, +no-one was there. I tried messaging, no one replied. I dropped a mail that when +we should start. No one replied so I decided to solve given problems. + +First problem was of dynamic programming. The question was given a string, I +have to find a substring which is minimum in length having all unique characters +of large string. I started with manual brute force approach, in which I was able +to solve 3 test cases, but then it failed by time limit error. I spent some +time, but didn't found any pattern in which I can apply memoization technique. + +Second question was Graph traversal with weights. I have to find a path with +sorest cost from source to destination. I skipped because I haven't revised +Dijekstra's shortest path finding algorithm. + +Third question was given a pre-order traversal of graphs, you have to check that +given sequence is of valid BST or not. This was looking simple, but I was not +able to solve it. + +There wasn't any time limits, but I didn't found I am able to solve this +questions. So I decided to quite it. This questions were looking like a +difficult questions to me. + +### Amazon interview + +Competition is tough. Rogers and his team will reach India next week. From next +week to 2 consecutive weeks they will interview four candidates in half day. +They have prepared a day in two slots. A clear calculation tells that 8 +candidates in day. They will do this for two weeks. Doing this will make 8 * 5 * +2 = 80 candidates. + +They are going to interview 80 candidates. Now he was mentioning that they are +hiring for a team. In a team there will be 10 people. I don't think large +organizations require more than 10 people in a team. So now, 10:80 is roughly +their selection ratio. I have to stand on that 12% of people. If I will tough +that bar, only than and then I will be selected for doing service at Amazon. + +When I observed Leetcode discussion of people sharing their Amazon interview +experience, they mentioned that there are four questions and one is bar riser +amongst them. This question is generally asked by manager or any senior +developer. Those questions were tougher for me. That clearly indicated that I +can't be lazy from now. There will be tons of difficult questions in-front of +me. + +Even I am thinking to skip Pycon Taiwan for not loosing a concentration of +preparation. From Tomorrow, I will skip all noises. I will only focus on +preparing for Amazon interview. + +## Tomorrow + +* Give Booking.com Hackerrank test in morning +* Give Rakuten test in evening +* Aural discussion with DataWire.io HR +* Go throw dynamic programming chapter from the book Introduction to Algorithms +book. +* Solve all three question of GoScale.