3 ms·
>> I almost always have a programming question I just made up 30 minutes before the interview. I make sure that I can easily do it in 10 minutes and then ask it
by bialecki 15y ago
>> I almost always have a programming question I just made up 30 minutes before the interview. I make sure that I can easily do it in 10 minutes and then ask it.
This is a lot easier said than done. Do you really do this and, if so, any tips on how? (I'm guessing variations on a core set of questions.)
I usually don't mind asking a questions someone may have already heard because there's not really a right answer, but I just want to discuss a problem to see how you think through it.
- kenjackson 15y agoI actually don't have an explicit set of core questions, but I'm sure there are clear themes that run through the problems. Probably my only real tip I can think of is not to have them code something related to stuff you're currently working on. You'll be far more likely to underestimate how hard the problem is. But the problems aren't that hard to think of. They're not like ACM programming contests. They're more like: You have two lists. One is a list of IP addresses. The other list contains IP addresses or IP addresses with wildcards. E.g., 192.168.$.1 or $.255.255.255. Return the set of IP addresses from list 1 that are matched in list 2. Additionally return the index from list 2 that matched -- I want the index that is most specific (as defined by having the fewest wildcards, or wildcard furthest to the right when there is a tie).
- AdamTReineke 15y agoWould the optimal solution be O(n*log(m)), where n is the number of IP addresses in list one and m is the number of IP addresses in list 2?
- deleted 15y ago[deleted]
- kenjackson 15y agoI think O(n * 2^p) is also a possibility, where p is the number of slots in the address. For standard IP addresses p is 4. So for large m, this might be preferable. I'm basically just hashing values to get this. How do you get the log(m) factor?
- gordonguthrie 15y agoIf it is a long list then the O of the algorithm matters a lot. If its a short list, who cares? If you care about it all the time then you a premature optimiser - basically a hand-grenade with the pin out. (by you I mean 'one' here - not you AdamT)
- eru 15y agoIf you are implementing, than you are right. If you are interested in studying algorithms and how they work, asymptotic considerations can tell you a lot about the algorithm. You have to decide what you want to ask for in your interview.
- jimbobimbo 15y agoMy usual question on the interview is to implement an atoi() function. All I care is that a person doesn't do stupid shit like switch case for characters or a strlen() for iterating through the input. It really is a 10 to 15 minutes task and boy it shows whether a person can write code. Usually then I continue with "how'd you test it?" question, then move on to multithreading and a quick design question. All in all I spend maybe 30 minutes to tell if I'd make a hire.