News for hackers. Stuff that matters.
Re:Most common mistakes during interviews by wolco on Sunday August 30, 2020 @12:37PM (#24323928)
"Who comes to an interview for a tech company not having done tons of leetcode problems, studying algorithms and data structures to the limit?"

Most normal developers. Spending you time on leetcode means you want to get in a faang. Most people are going for other roles.

Re:Most common mistakes during interviews by UncleOxidant on Sunday August 30, 2020 @02:12PM (#24324678)
I'm just tired of the whole tech interview process. I've prepped for days for interviews only to have them fall apart because they asked something I hadn't prepped for or some kind of gotchya riddle was asked. What I've found works best is to just convince myself I really don't care either way if I get the job or not - that's when I do my best. When I really want the job, that's when I do my worst.

While I'm currently not working (for money, anyway) I'm fortunate to be in a position to not have to look for work. That could change, of course (for example, if the SCOTUS strikes down the ACA I'll need to find a job with insurance). Just thinking about interviewing in this current environment makes my stomach tie up in knots. But for now, I'll be over here working on my own interesting problems.

Re:Most common mistakes during interviews by coin on Sunday August 30, 2020 @03:36PM (#24325304)
A lot of the interview process is luck - the questions they ask, the person interviewing, and their mood/interest.
Re:Most common mistakes during interviews by MattGaiser on Sunday August 30, 2020 @01:34PM (#24324359)
Especially when many people will never use them in prod. My organization asks questions about DS and algos in the interviews now.

Has complexity or efficiency ever come up in a team discussion? Nope. Do we have use for high efficiency solutions at scale? Not particularly. But we judge candidates on it.

Re:Most common mistakes during interviews by gnusty_gnurc on Sunday August 30, 2020 @01:43PM (#24324444)
> Has complexity or efficiency ever come up in a team discussion? Nope. Do we have use for high efficiency solutions at scale? Not particularly.

Not only that - I often see atrocious code. Stuff like comparing boolean expressions against true/false. Stuff that makes me question basic competence of the person writing it.

Re:Most common mistakes during interviews by cguess on Sunday August 30, 2020 @01:50PM (#24324510)
> Stuff like comparing boolean expressions against true/false

I do this sometimes if it makes the code clearer. Sometimes it's not 100% clear if you're just coming in that a function returns a boolean. Sometimes you just want to remind yourself and it sneaks past a code review. I've been coding for 20 years across a dozen plus languages, and some just handle truthiness differently and it's easier to just make sure (looking at you, Javascript). Sometimes null is false, sometimes it's not, sometimes an empty string is false, sometimes it's not.

Any compiler, JIT, optimizer etc. will completely ignore the comparison anyways so there's 0 runtime issue with it.

Re:Most common mistakes during interviews by RandoHolmes on Sunday August 30, 2020 @02:19PM (#24324732)
> do this sometimes if it makes the code clearer.

As do I, the above poster is just super judgemental and probably not a lot of fun to work with.

An observation I've had over the years is that often times developers will come to conclusions that they ought not to. The idea that typing out "== false" indicates you don't understand bools is a non-sequitur.

Re:Most common mistakes during interviews by xorcist on Monday August 31, 2020 @03:41PM (#24335202)
When could an extra "== true" or "== false" possibly make anything clearer?

  if not (x > 5)
looks normal,

  if (x > 5) == false { .. ]
is just confusing.

Why would it matter if a function returned a boolean? It's either compared for truthiness, or the comparison for truthiness or compared for truthiness, even in the most dynamic languages.

Re:Most common mistakes during interviews by alpha_squared on Sunday August 30, 2020 @02:03PM (#24324604)
> Sometimes it's not 100% clear if you're just coming in that a function returns a boolean

I'd argue the function isn't named appropriately, then.

> Sometimes you just want to remind yourself and it sneaks past a code review

Remind yourself what, exactly?

> dozen plus languages, and some just handle truthiness differently and it's easier to just make sure (looking at you, Javascript)

I'd argue that it's on the developer to know and work with the language's semantics (and I say this as someone who's not a fan of JS). Trying to write code that is nearly language agnostic in semantics will leave out a whole lot of language-specific value.

Re:Most common mistakes during interviews by RandoHolmes on Sunday August 30, 2020 @02:16PM (#24324712)
> I'd argue the function isn't named appropriately, then.

Maybe yes, maybe no. The point is that adding "== true" makes it more clear and should therefore be done.

Re:Most common mistakes during interviews by coin on Sunday August 30, 2020 @03:25PM (#24325214)
For strongly type languages (like Java), how can ==true make it more clear?
Re:Most common mistakes during interviews by MattGaiser on Sunday August 30, 2020 @02:04PM (#24324619)
Why is that so horrible? I prefer it because I am prone to missing the ! when tired (which is a problem as my project has complex conditionals).

Functions are not always consistent about returning a Boolean either. Bad design/naming, but you work with what you have got.

Re:Most common mistakes during interviews by hinkley on Sunday August 30, 2020 @03:11PM (#24325117)
Well, for one case, I’ve seen people work really hard to test a == b, or alternatively a != b when a and b are Booleans.

I think some classes were not mandatory in school, or people hated that class.

Re:Most common mistakes during interviews by RandoHolmes on Sunday August 30, 2020 @02:14PM (#24324692)
this attitude is elitism and needs to stop.

I will sometimes compare against true/false, it doesn't mean I don't understand boolean logic, it means I feel like it's more clear.

It could also be that I'm in a language with truthy values and I specifically only want to compare to real boolean values.

You really need to stop and ask yourself why you're so judgemental about code. Because that's a you problem, not a them problem.

If I ever had a co-worker try and tell me I don't understand boolean logic because I felt like typing it out was more clear I'd laugh in their face.

Re:Most common mistakes during interviews by gnusty_gnurc on Sunday August 30, 2020 @02:31PM (#24324820)
No it’s not saying someone doesn’t understand Boolean logic.

It’s visual noise. This isn’t an issue with truthiness either. I’m talking normal java code. Where if I see an if-statement, clearly the thing inside doesn’t need comparison against true or false unless you want to add another comparison just for fun and mental gymnastics.

Re:Most common mistakes during interviews by fingerlocks on Sunday August 30, 2020 @03:00PM (#24325034)
It’s the opposite of noise by making the logic more precise. Suppose you have unwrapped optionals or result types, or need to specifically handle a null type differently from a false. It’s also helpful when refactoring changes a function signature.

Are you young or early in your career? I think the extra verbosity is something you come to appreciate the “the hard way” over the years.

Re:Most common mistakes during interviews by gnusty_gnurc on Sunday August 30, 2020 @03:14PM (#24325134)
> It’s the opposite of noise by making the logic more precise

There's cases where this might make sense (when things like truthiness are unclear). But in any of the cases I've seen, it's where things are pretty obvious and even when things are explicitly boolean types.

Write the boolean expression and if it doesn't fit or has lots of parts, define them separately above the conditional with clear names.

People seem upset by this, but idk it seems like common sense.

I'm not sure I understand how `if (someCondition == true) {...}` is preferable to `if (someCondition) {...}`

Re:Most common mistakes during interviews by RandoHolmes on Sunday August 30, 2020 @03:46PM (#24325394)
> People seem upset by this

No one is upset, they simply disagree with you...

Maybe avoid trying to dismiss people and look at what they're actually saying? There are things you put in code that others are unfairly judging you for.

something something glass houses.

Re:Most common mistakes during interviews by ubercow13 on Sunday August 30, 2020 @03:25PM (#24325216)
It's such an irrelevant surface-level thing to judge someone's intelligence and coding ability on. Just because they wrote that doesn't mean they don't understand that it could be simplified or that they aren't capable of handling much more complex boolean logic. Sometimes I write things like that just because I am typing my thoughts into code as they come to me, and that's just how I happened to vocalise it in my head.
Re:Most common mistakes during interviews by gnusty_gnurc on Sunday August 30, 2020 @03:41PM (#24325348)
This is usually in context of massive classes and functions that are regularly 100+ lines. It’s not organized or thoughtful and an absolute pain to work with.

Idk this is just my experience with disorganized code and unclear.

Re:Most common mistakes during interviews by thdc on Sunday August 30, 2020 @02:44PM (#24324922)
If a case like this pops up, how about asking them why they did it like that and then making your judgement based on response instead of questioning their competence right away?

Response 1: I thought it would be clearer with the explicit comparison. (fine, then you can bring in your own opinion and maybe have a nice discussion)

Response 2: You don't need == true? I never knew. (bad)

Another common scenario that is complained about: using `this` with instance variables when it's technically unnecessary.

Re:Most common mistakes during interviews by coin on Sunday August 30, 2020 @03:35PM (#24325290)
The point is that "if" branches based on a boolean value. A comparison is just one way to produce a boolean value. There's nothing explicit by adding "==true". It just show a lack of understanding of "if".
Re:Most common mistakes during interviews by xorcist on Monday August 31, 2020 @03:47PM (#24335250)
If an extra "== true" can be considered more precise, would

  if ((conditional == true) == true)
be even more precise?
Re:Most common mistakes during interviews by gnusty_gnurc on Sunday August 30, 2020 @03:44PM (#24325369)
Precisely. Thank you.
Re:Most common mistakes during interviews by pmontra on Sunday August 30, 2020 @02:19PM (#24324731)
Why do you have this disconnect between the development team and the hiring staff?
Re:Most common mistakes during interviews by MattGaiser on Sunday August 30, 2020 @02:21PM (#24324749)
They are the same people :)

A lot of it is just them not really interviewing much so they Google how to interview developers and think about questions they were asked.

Re:Most common mistakes during interviews by pmontra on Sunday August 30, 2020 @02:27PM (#24324792)
Well, at least it should be easy to fix the process :-)

Start with your observation.

Re:Most common mistakes during interviews by azemetre on Sunday August 30, 2020 @01:32PM (#24324331)
Eh IDK. Leetcode type questions are starting to slip into many industries and types of companies. I recently interviewed at large finance (not trading firms, retail banking/investment) and insurance companies. They both asked LC medium/hard.

I was honestly taken a back. These companies aren’t known for “high” standards and make up for the lack of interesting work with WLB (or at least it comes across like that.

Just like how everyone copied google Qs a decade ago (how many toothpicks can a tree yield...). I’m fully expecting everyone to copy FAANG like interviews because someone in HR thinks it might signal better hires, and why wouldn’t you want better hires right?

Re:Most common mistakes during interviews by csboyer on Sunday August 30, 2020 @02:07PM (#24324630)
Not at a FAANG company but I will ask stuff that might show up as “easy” on leet code.

Examples: run length encoding problem or a bit extracting/setting question. I want to see if the candidate can formulate a simple state machine and they understand bit manipulation. I target the bit manipulation questions for firmware/embedded software roles, which very much involves reading and setting bits from hardware registers all day long.

Re:Most common mistakes during interviews by kamaal on Monday August 31, 2020 @12:46AM (#24328571)
So if they ask the same questions at Google and same at BigInsuranceCo, why work for a lower salary at BigInsuranceCo.

If the interview is the same, you are better off working at some one who pays better. As a side effect eventually there could across the board better pay.

Re:Most common mistakes during interviews by azemetre on Monday August 31, 2020 @09:50AM (#24331411)
That's what I'm wondering myself. I've been taking more time to adequately prepare for faang, because as you said why not work for the company that pays more if the interview is nearly the same?
Re:Most common mistakes during interviews by decafninja on Sunday August 30, 2020 @01:40PM (#24324409)
Yup, this. While I'm sure there is some corner of the US tech industry that doesn't leetcode you during interviews, it's getting smaller and smaller.

Companies that wouldn't have leetcoded you 5, 10, years ago are now doing so. The difficulty of leetcode questions is going up too.

Also, takehome problems are becoming more common - not instead of leetcode interviews, but in addition to.

Re:Most common mistakes during interviews by MattGaiser on Sunday August 30, 2020 @01:39PM (#24324401)
I work for a government and have interviewed for other governments. They have Hacker Rank stuff too.
Re:Most common mistakes during interviews by zenlot on Sunday August 30, 2020 @01:41PM (#24324421)
Agreed 100%.