Hacker News new | past | comments | ask | show | jobs | submit login

I interviewed and worked at Apple, but it's extremely variable between teams to take this with a grain of salt.

Basically, the things you need to get good at is remembering the runtime complexity of the main data structures, and to be familiar with the core structures that are available in whatever platform you'd be writing code in.

I was working on a Java-heavy team, so the important thing was to remember the various Map types, PriorityQueues, Stacks, arrays, and being familiar on how the references in Java work. The algorithm stuff wasn't too hard once you have a somewhat intuitive understanding of all these structures and when they're useful.

For example, one thing that they seemed to love in interviews was having you implement a least recently used cache, specifically an LRU cache where every operation is constant-time. Easiest way to do that is to build a doubly-linked list and have those point to a wrapper type inside a hashmap, it's not terribly hard but it does require familiarity on which data structures are useful. In this particular case, the rookie mistake it so try doing it with a minheap.




If you ever need to do that in the future in Java for whatever reason, Java actually has it already in the standard library--it's called LinkedHashMap.


Yeah, I think I knew that even at the time, but I suspect if my answer was just "import java.util.LinkedHashMap", they might have been a bit disappointed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: