|
Wait, rather than let you handwave for your entire time, you were expected to write code and talk about it? Oh how dreadful.
|
# ¿ Jul 24, 2016 17:40 |
|
|
# ¿ May 12, 2024 04:28 |
|
Ok, when giving 2sum as a problem you generally start with the unsorted array being passed in since there's an O(n) solution after sorting, so it's kinda asinine to be given the simpler version to start off. But an interview is very limited time and for a lot of places establishing that someone has actually coded and can do it again is what they need to do. I've interviewed people who could say all the right things and couldn't emit a C function signature. If you've never given one of these interviews, count yourself lucky, but acting like you're above it is precisely what the fakers do. Specifically:UnfurledSails posted:"Can I use less space? Well I've still not used the sortedness of my array to my advantage. So if I use two "pointers", one at the start of the array, and one at the end, I can create a window that shrinks until it points to the numbers I want, or eventually disappears. If left + right == k, we're done. If left + right > k, then right--; if left + right < k, then left++. If left >= right, then we're done. UnfurledSails posted:I actually got rejected from a company because "This is a fast paced startup environment, and we prefer people who answer questions as quickly as possible and move on instead of trying to figure out if there is a better answer."
|
# ¿ Jul 24, 2016 20:21 |
|
UnfurledSails posted:I can't argue with anything you've said here, although I cannot fathom how the kind of people who can't even code up a C function signature got to the on-site stage to begin with. How do they pass the phone screens? UnfurledSails posted:I also remember getting called on mixing indexes (ahem, "indices") and pointers in that interview, and it led to a discussion about instances where actually having pointers would be justified, which was fun. In general I'd trust that the interviewer is being honest with their line of questioning and starting to code at the point they ask won't be held against you.
|
# ¿ Jul 25, 2016 03:58 |