5 ms·
> In what ways do you find them crappy? Not the OP, but I can narrate an incident here. When we were hiring for my team, we had candidates do a small coding a
by mavelikara 10y ago
> In what ways do you find them crappy?
Not the OP, but I can narrate an incident here.
When we were hiring for my team, we had candidates do a small coding assignment. It was expected to take 2-4 hours of work, was for a toy problem which was a simplified form of something we used in production, and contained no puzzles or "a-ha!" insights.
We got a submission from a candidate who has been in the industry since 1994. The candidate had used a static variable when a member variable was the right thing to do. The class (in Java) looked something like this:
class Foo {
static Map map = new HashMap();
void addStuff(String key, Object stuff) { map.put(key, stuff); }
int getSize() { return map.size(); }
}
Now, he had a test to go with it that looked like:
void testFooInit() {
Foo foo = new Foo();
assertEquals(3, foo.getSize());
}
The value 3 was chosen, apparently, such that the JUnit runner from Maven would have the test pass! But the tests would fail randomly when run from within IntelliJ.
So look at this way - the candidate had long years of experience, had an impressive resume, did code that superficially looked OK, knew enough to write tests and package a Maven project. Yet, that non-sensical test indicated that he had missed the point about unit testing completely.
I am sure that the candidate is a productive employee at his current position. He might have written such bugs into his codebase, identified it in production, would have valiantly debugged and fixed the issue, and would have gotten kudos from his management.
--
Having said that, I agree with the sentiment here that HackerRank questions are complete waste of time! It seems that the only employees HackerRank can attract to build a question bank are fresh CS grads, and they make up problems which they are aware of - TopCoder-style, array/dynamic programing/regular expressions/counting problems. These questions come up as irritating when a seasoned programer is trying to find a job.
- mkagenius 10y ago> knew enough to write tests and package a Maven project. thats enough for me to not call him "crappy" ...perhaps i would call him "ok"
- __derek__ 10y agoHow so? Given the status quo bias, writing meaningless tests is worse than writing none at all. It gives the illusion that something is well-tested and may even lead people to write code in order to accomodate the test. That causes real damage on a team. Being able to cargo-cult to provide the illusion of competency should get no credit.
- mkagenius 10y agoThis was a hypothetical test scenario, it just proves he knows those stuff and we do not need to teach those to him. Perhaps he is weak in logically deciding what exactly needs to be tested but writing good tests doesn't come easy either. Many can fail in that given time constraint and other management pressure.
- mavelikara 10y ago> Perhaps he is weak in logically deciding what exactly > needs to be tested but writing good tests doesn't come > easy either. True, but we were looking for "senior" engineers. In that role, the candidate is expected to have a taste for these things, do code reviews, and even help junior engineers acquire that taste. > Many can fail in that given time constraint and other > management pressure. I forgot to mention it, but this was a take-home assignment. So there really was no time constraint or interview pressure.
- lisivka 10y agoHe mismatched C "static" with Java "static". In C, variables defined in the file scope with static keyword, i.e. defined outside functions will be visible only within that file. Any attempt to access them from other files will result in unresolved symbol at link time. I made exact same error when tried to write C code after years of coding in Java. I knew C, but my knowledge was blurry. Despite that, I finished project in time with excellent recommendations. I am senior after all.
- mavelikara 10y agoYou are right - the 'static' itself is a mistake, but not a terrible one. But when the line: Foo foo = new Foo(); is followed up with: assertEquals( if one types in anything other than -1, 0, Integer.MAX_VALUE, Integer.MIN_VALUE etc, big blaring warning alarms should go off in a senior developer's head. Even after it is typed in, when you read through the code it should have stood out to you.