4 ms·
If mod isn't something needed for whatever their normal work is, is it a valid test? Or are you potentially throwing away otherwise good candidates because of i
by mysterydip 7y ago
If mod isn't something needed for whatever their normal work is, is it a valid test? Or are you potentially throwing away otherwise good candidates because of it?
- patio11 7y agoIn my experience one sees roughly similar results with: "Write a function which counts the number of a's in the input string." "We will give you an array of words. Print out each word which appears more than 3 times in the array." "We will give you two arrays of words. Print out each word which is in exactly one of the arrays." It's not just the mod operator. These are toy problems for difficulty but they're not "implement the rules to a children's game"; with a few seconds of effort you can describe a boringly plausible business reason for having to implement them during a fairly pedestrian career.
- ciao_ciao 7y agoBear with my potentially dumb solution, but i'm trying to understand what an interviewer would look for in answering questions like these. For the third, in python, could you make both sets and print the symmetric difference? Does this (a) demonstrate practical knowledge of python or (b) necessitate a follow up from the interview to provide a solution that does more of the "work"?
- jdboyd 7y agoIf they take that shortcut in Python, it tells you that they probably know Python, which also likely suggests they could think it out if they had to. If they think it out the harder way, that shows they can do that, which suggests they can get some things done. It isn't rare to find applicants who have more than 10 years of experience who somehow can't do either.
- deleted 7y ago[deleted]
- wikwocket 7y agoSince these are riffs on fizzbuzz, the goal is just to evaluate whether a candidate can use programming to solve these at all, i.e. whether they can 1) think through how to accomplish a basic task with some data and code, and 2) implement it in a language they know. The goal of fizzbuzz in a phone screen should not be to see if someone can solve it in an optimal memory-efficient framework-idiomatic way. Clever syntax and data structure use is lovely, but these are really about finding whether someone can use a 'for' loop and an 'if' condition.
- ecpottinger 7y agoI never use the mod function, and I still could do this test. You are being tested on finding a solution that works, not on what function you use.
- jppope 7y agohttps://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ https://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/
- kjeetgill 7y agoI think this is becoming less true, but I think it was (rightfully) seen as a test of basic competence. Would you hire a chef that didn't know what a fork was even though you never use one to cook? I had to learn C at some point though, and that used to be common. I suppose it's becoming a less useful test.
- 0x5002 7y agoI would argue that every single programmer with at least the tiniest bit of tenure in the field (or a kid straight out of college who took at least some math classes) will have run into this at some point in their life. Even if you (somehow) don't know about it, figure something out? Do something "stupid that works" like this: def floatcheck(x:Float, div:Int): String = (x / div).toString.split("\\.")(1) match { case "0" => "int" case _ => "float" } (1 until 100).foreach(e => { if(floatcheck(e,15) == "int") println("fizzbuzz") else if(floatcheck(e,3) == "int") println("fizz") else if(floatcheck(e,5) == "int") println("buzz") else println(e) }) (I'm guessing this works, or maybe I fall into that category as well ;))
- deleted 7y ago[deleted]
- probablybroken 7y agoYou probably are rejecting potentially good candidates, but I would personally suggest that of the developers that I want to hire, most of them are members of the set of developers who know what the modulo operator is for. And since hiring is a numbers game, it seems like a reasonable filter. Besides, you are allowed to ask other questions in the interview.
- blunte 7y agoThe thing is, you don't need mod. You can, in more steps, arrive at the same output just using arithmetic. But everyone... non-programmers too... should understand the concept of "remainder after division" (of whole numbers). If the test is interactive, the candidate can express, "I need to find out if this number is evenly divisible by that number; if so, then blah blah". Interviewer can remind them that x % 2 is "remainder of x when it is divided by 2". The point should not be whether someone can remember %, but whether they have any idea what minor goal they are trying to achieve.