亚麻Vancouver实习VO挂经

OA1 and OA2
All straight forward. Questions all from Sithis list, study those and you’ll be fine. Got all test cases passing

OA3
Hard to study for this one, since it’s a work simulation. Logic part i was running short on time, but OA3 is more heavily weighted towards the work simulation.

Virtual Onsite

Never seen the question before on leetcode, but the first part was really straight forward. Given a file, and using space as a delmiter, count the number of occurances of each word. The question was really really vague, and that’s all it said. I had to ask the interviewer multiple times what different edge cases I should cover.

Essentially, what I ended up doing was, read the file, put the output into a string, and used the split function to store the string into a string array (using space as delimiter) Then I looped through each word, removing any puncuations, and using a HashMap to count the occurances of each word.

Follow Up:
Sort each word by the number of times it occurs. I froze here, and suggested to itterate through the HashMap and store the occurance of word in an array, then just sort that array. He said we were running short on time, and if I had heard of Red/black. Told him I had never, and he said I was supposed to use a TreeMap (i did not study this).

Follow Up 2:
What would you do if the file was extremely Large, like 10TB and you only had 20gb of ram. I suggested to read the file until you reach maximum memory, storing the location where you left off (i.e store line 70000 because this is where you have reached max memory). Then, run the Function that counts the number of occurances (from the last part), and once you have added the values to your Map, delete your string, and start where you left off.

He mentioned that I should of used Hadoop and Amazon EMR, which would run on parallel machines, and then reduce the HashMaps.

Asked me If i had any questions afterwads. Got the rejection the following day.