Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
JawnV6
Jul 4, 2004

So hot ...
Wait, rather than let you handwave for your entire time, you were expected to write code and talk about it? Oh how dreadful.

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...
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.
Those are what I would call "indexes," not "pointers," which is really obvious once you write some code but in your handwaving explanation sounds like you'd do this with memory indirection in some overwrought manner. It would actually help my opinion of a candidate to see this written out instead of verbally expressed in this manner. Are you aware of what the word "pointer" generally means? Does overloading it here help you significantly?

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."
And a lot of startups get to funding rounds based racing to market/mvp/$milestone on piles of technical debt. It's fine if you don't want to work for a place like that, but treating it like it's some objectively wrong position?

JawnV6
Jul 4, 2004

So hot ...

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?
From least to most cynical, there are systems jobs where I was just there to check if an EE could do basic coding when it wouldn't have been the main thrust of their job. I've interviewed folks for web positions where they weren't expected to know C. And there are phone screens that are mostly HR focused without much technical grilling.

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.
But that's precisely the situation where code on the board is unambiguously correct where your handwaving wasn't sufficient. I wouldn't begrudge the folks rushing you to that point, I got halfway through a code exercise including a =/== error when I vaguely asked how it was looking so far and got a hopeful "Let's see where the code ends up..". There's a variety of reasons why someone would focus on code, it's awful to watch someone trying to implement some facet of a hashmap because it shaves a lg(n) when they could've nailed a simpler O(n2) solution. It puts the interviewer in a weird spot where they're probably qualified, but there's no whiteboard evidence of it.

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.

  • Locked thread