4 ms·
Man. I interviewed somewhere last week for a Scala position, advertising myself as a functional programmer. In the interview, they asked me, "What's the differ
by roflc0ptic 6y ago
Man. I interviewed somewhere last week for a Scala position, advertising myself as a functional programmer.
In the interview, they asked me, "What's the difference between fold left and fold right?" I said "Um, one of them starts on the left side of the data structure, one of them starts on the right. I never remember which is which." They said essentially: "okay. The answer I was looking for was that fold right is not stack safe." I protested weakly, and they dug in, so I graciously let it go.
But it's patently not true. A naive implementation of fold right in Scala isn't stack safe, but the actual implementation is stack safe. It's been stack safe since like 2010. So rather than interrogating my knowledge of functional programming, they're just asking me bullshit language trivia, and dinging me when I don't come up with their arbitrary wrong answer.
I wanted to work there before that, but the interview made me a little ambivalent, and then they just ghosted me. So I guess I dodged a bullet. But man, that was frustrating.
- pmiller2 6y agoHuh. Other than taking the opportunity to talk about tail call elimination, I'm not sure what you could have done to salvage that interview. Bullet dodged, indeed.
- x87678r 6y agoI hate that post interview ghosting too. Is super inconsiderate.
- roflc0ptic 6y agoI’ve never experienced it before now - how common is this? Is it a west coast thing? This was my first interview with a west coast shop. I don’t need an essay on why they thought it wasn’t a good fit, but radio silence seems eminently unprofessional.
- nefitty 6y agoNot sure how common but this has happened to me as well. Coding challenge complete, follow-up interview scheduled... then cancelled. Rescheduled... then ghosted. It was a cheap way of figuring out I shouldn’t even consider working there.
- bradlys 6y ago> It was a cheap way of figuring out I shouldn’t even consider working there. I mean - all you're experiencing is the HR/recruitment side of the pipeline at that point. You can't really say that an entire company is shit just because some subset of its HR/recruiters do shitty things. How many CTO's actually give a shit about IC interviewing experience and dig into the entire methodology that recruiters use when interacting with candidates? (And actually keep track of what their recruiters do) I'm gonna give a wild guess and put 0 out there.
- roflc0ptic 6y agoIn my case, it was a small shop and entirely through direct communication with the manager making the hiring decision. He seemed like a genuine, nice guy, so I'm leaning toward it being evidence that the dude does destructive, avoidant behavior, which is an unsettling tendency in a manager.
- pmiller2 6y agoRegardless of how many CTOs do care, 100% of them should care. The reason they don't is there's no real incentive for them to care. Outing companies who do things like ghost candidates or have shitty, arbitrary interview processes probably isn't going to be enough to get most of them to care. But, some might, which is why I think it should be a regular practice.
- roflc0ptic 6y agoYeah, you don't need 100% enforcement to enact behavior change. You just need occasional, disproportionate punishment.
- deleted 6y ago[deleted]
- nogabebop23 6y agoyou can often give a company a pass for a shitty interview, but you should name & out them for ghosting you as that is a far more systemic problem indicator. When I'm interviewing I want the poeple we don't hire to go away and have good things to say about us because they will tell many people about their experience. Companies that are disrespectful and inconsiderate to the point of just cutting off contact should pay the price.
- roflc0ptic 6y agoYeah, I'm ambivalent about that. From a purely theoretical standpoint, sure, bad actors should be punished. There's also slim but non-zero chance that they'll reciprocate and attempt to harm my reputation, and we'd end up in some dumb internecine conflict. It's good for bad actors to be punished, but usually irrational to be the one doing the punishing.
- wolco 6y agoCan you come back in a year and share?
- pmiller2 6y agoI don't think I've ever told anyone about a good interview experience, but I certainly have talked about a few bad ones.
- ashtonbaker 6y agoI appreciate whenever I see people in your position get angry about ghosting, but in my experience, for positions that I’ve interviewed for and didn’t get, I think only one ever let me know. I’ve come to rationalize this as a risk-avoidance tactic, and I think the negative effects of reputations damage to the company are mostly unaccounted for.
- leafboi 6y agoAssuming the data structure is a singly linked list than yes it's not stack safe. At a high level foldLeft and foldRight represent abstraction leakage. The Domain and Codomain for both functions are exactly the same. If there is no performance difference or side effects to consider then there is almost no point in having two fold functions as a plain fold has the exact same inputs and outputs as foldLeft or foldRight. Typically for side effects you don't want to put it in a fold as you're integrating way too much IO with your functional computations. Rather functional languages tend to have something along the lines of "foreach" for using side effects on the content in a functor. That being said it's strange that scala has a foldLeft and a foldRight with identical performance characteristics. Maybe it's a legacy thing. I dunno, not a scala guy. Just bringing that up. I still agree with you that the interview question sucked and that the interviewer was wrong. Personally I wouldn't have ever figured out that was what the interviewer was looking for even when I do possess the requisite knowledge.
- cottonseed 6y ago> The Domain and Codomain for both functions are exactly the same. This is not true. > def List[A].foldLeft[B](z: B)(op: (B, A) => B): B > def List[A].foldRight[B](z: B)(op: (A, B) => B): B Notice the signature of the fold op: the arguments types are swapped. This is because fold left and right on a list [a, b], say, is the difference between: (z op a) op b and a op (b op z) (If this isn't compelling enough, consider [a, b, c].) Not all functions are associative. For example, consider a cryptographic hash function.
- leafboi 6y agoElements in sets are not ordinal. In principle they are the same as the set (B, A) is the same set as (A, B). If you're saying that foldRight in scala exists aesthetic reasons... well can't argue with that. I figured it was more for legacy reasons as the original poster said that there use to be a performance difference. As for the associative thing I mentioned side effects. Function composition is always associative. Unless you have side effects. See: https://www.wikiwand.com/en/Function_composition https://www.wikiwand.com/en/Function_composition (search for associative) I don't know much about crypto but I'm assuming you're referring to things that aren't side effect free. In general though a hash function should be associative under function composition as it is just a surjective mapping from domain to codomain. Also can't exactly read that syntax nor the stuff below it. Not a scala dude. Maybe a more traditional map implementation in like python or JS pseudo code would make more sense to me, but that may be too much to ask. edit: I think you actually may be right. We're both a little wrong with our reasoning though. Function composition is not commutative. And FoldRight and FoldLeft reverses the order of composition which has an effect on operations that are not commutative.
- blain_the_train 6y agoWhat's happening here is more subtle. The interviewers question didn't carry enough information to get the answer they wanted. They created a puzzle where you needed to ask for more information. Intentionally or not, they were discovering if they could communicate with you. That the communication failed doesn't mean your somehow less then them. It means you just have a different background. Now to the problem, the problem people don't set good goals. It probably doesn't make sense to hire a carbon copy of yourself.