Programmer
1 questions · 1 experiences · Other (2)
Programmer with 10 years experience, wrote a set intersection that was O(nlogn) in an interview, told I have weak CS fundamentals?
Question Details
Recently I had an interview with a company where I was asked to write a integer set intersection algorithm in a pair programming setting. I wrote it by first sorting the given arrays, and then moving through them both to determine whether they contained the same data. This is a O(nlogn) solution because of the initial sorting. There is of course another way to do it, by using a hash to keep a count of each item in one list. My feedback, based on this one sample done in an interview setting, was that I have poor or mediocre CS fundamentals, and that I should brush up on those. Is this sane? Do I really have poor CS fundamentals for not remembering the optimal way of writing a set intersection function? Is this something I should be worried about? I was told to brush up on my data structures and algorithms before my next interview. I really want this job. Does anyone have any resources to recommend?