Showing posts with label round daisy: March 30 - April 24. Show all posts
Showing posts with label round daisy: March 30 - April 24. Show all posts

Wednesday, April 25, 2018

Being interviewee: Word count practice

April 25, 2018

Introduction


It is my favorite algorithm but also it is hard to write a complete solution in 30 minutes. The algorithm is to lower the sentence, remove special char \', and then split words by delimiters such as chars in the string " .:;,!", and then save the words to the dictionary, and then sort them by value. From the dictionary, apply the sentence word order, save words in the bucket to apply bucket sort, and then output in descending order of value.

Mock interview


I tried to write the code and pass test cases in 38 minutes, but I could not make it. After the mock interview, I spent over 20 minutes to debug and fix bugs in two places.

Here is C# code written in today's mock interview 8:00 PM. On line 48, I need to remove the statement: if(item.Length == 0), actually the statement: continue is deleted by cleaning process; and on line 106, the word may not be in the dictionary.


And here is C# code written after the mock interview to fix the bugs.

Chatting


It is such a nice experience to practice the algorithm with a software engineer from expedia.com. I was asked if I work for Microsoft since I choose to use C# programming language. I couldn't believe that the peer wrote the optimal solution quick and correctly. I just could not believe that I keep meeting a very talented programmer again, in an ordinary Wednesday. I spent 38 minutes on my algorithm, the peer spent less than 20 minutes on his algorithm meeting planner.

Action items


I need to design some drills for me to work on those algorithms similar to those mock inerview algorithm, play with the error message, so I can think about how to identify issues quickly once I read some error message.

Train myself to read the error message, and also get used to pinpoint the place by interpreting the error message correctly, specially for those error message without line of code information.

My ideal practice is to fix bugs in one minute. I should be able to quickly identify the code's issue.

Tuesday, April 24, 2018

Being interviewee: Busiest time in metro town

April 24, 2018

Introduction


It is the algorithm I like so much called linear scan algorithm, by checking next row to make sure that current time stamp is the last row to finalize count of people left in the mall.

Mock interview


I had good time to write and test the code. I tried to write down some notes before I wrote the code in the mock interview.

Here is my C# code. Here is my feedback.



Being interviewer: Sudoku solver

April 24, 2018

Introduction


It is so interesting to meet the peer second time in less than a week. I had good time to learn Go language through the peer's performance. One major advice I had after the peer ran the web compiler test cases is to add back tracking on line 35, so the code could pass all test cases. I explained to the peer that parent node will ask child node to back track the element to its original dot value since parent node will try its next option.

Mock interview


This mock interview is so much fun, since last time I was complained not to give out any hint, leave first 30 minutes for the peer to reach his full potential. The peer gave the time complexity analysis and mentioned that he learned the recursive tree through cracking code interview book.

Here is Go code I reviewed, which also passes all test cases.


Sunday, April 22, 2018

Being an interviewee: Array quadruplet

April 22, 2018

Introduction


It is my favorite algorithm called array quadruplet. I did talk about the analysis of the algorithm and then wrote down the algorithm without any bug and pass all test cases first time. Only thing I did is to include library using ..., I explained to the peer that I have worked on the algorithm multiple times, but one time a young lady who was preparing facebook onsite, she told me that I should simplify the code to check if dictionary contains key or not. So I only need to write three lines of code from line 57 to line 62, before I need to write if/ else and then update list in both cases.

Mock interview


Here is my C# code.

I still remembered that the first time I worked on the algorithm on mock interview platform. I had such difficult time. After I worked with over ten people on this algorithm, I followed every peer and understood how they think and analyze. So it is also very good experience to help the peer to work on the algorithm the first time. Here is the blog I wrote to give the feedback to the peer. 





Being an interviewer: BST inorder successor

April 22, 2018

Introduction


It was my 6:00 pm mock interview. I had chance to help the peer to come out the solution in 40 minutes. I enjoyed to be an interviewer and then helped the peer to come out the optimal solution.

Sometimes it is so relaxing to watch how the peer worked hard, and then took hint quickly and reached the optimal solution.

Feedback


Here is the feedback I wrote on mock interview platform. I like to encourage the peer to work hard.

Things you did well

The peer took the time to think about the solution, started from inorder traversal and then moved to optimal solution by going up or down through height of tree to search. The peer wrote the code with bugs, and then worked on cleaning and removed all bugs and redundant code. 

Good thing the peer did is to stay calm, and also very good communication with the interviewer. The peer took hint quickly and then worked on the detail. It is very good to be able to come out the correct solution first time. 

The peer tested code with four test cases and make sure that the code works perfect. 

Things you should work on

Recommend the peer to work on more mock interviews. There are a lot of talent people out there, you will meet a lot of peers and then find ways to improve and go above the average performance. Work hard! 

You as an interviewer

I presented two solutions, and then the peer chose one for me to write. Also the peer asked a few questions and I think that the peer is very curious and like to improve. Good to work with the peer. 

Saturday, April 21, 2018

Being an interviwee: Root of a number

April 21, 2018

Introduction


It is 12:00 PM mock interview. I have experience to work on the algorithm root of a number over 10 ten times, 5 for interviewer, 5 for interviewee. The peer has strong talent with 1st place twitter big data hackathon. The peer worked on decrypt the message algorithm first, I rated him top 5 - 10% in all over 200 peers I worked last 12 months.

Mock interview


I like to write a binary search and also apply some technique I saw recently using integer to count the numbers.

The peer challenged me about the termination base case, 0.001 is the error range, how I assert that two values are equal using 0.001?

Here is my C# code.