|
comedyblissoption posted:The candidates I've interviewed so far I've done through remote-ing and them using an IDE and filling in an implementation of a function to pass a test.
|
# ? Feb 1, 2014 23:40 |
|
|
# ? May 30, 2024 12:19 |
coffeetable posted:Do you not sketch code out on whiteboards with colleagues either? I generally have only used whiteboards for UML-type stuff and making sure the math works. Actual code on a whiteboard is a last resort, and I'm not really sure why people are always on about it.
|
|
# ? Feb 1, 2014 23:46 |
|
The only correct answer is to hand them a printout of the source code to Linux and require a formal proof of correctness by the close of business that day. Good luck!
|
# ? Feb 1, 2014 23:48 |
|
comedyblissoption posted:Is it better to not ask implementation of simple library functions or fizzbuzz just because someone might have memorized pseudocode for that? It seems like if you can google the problem and find it in the first page hit, it might not be a good question. For FizzBuzz you could change it something else. I used our company name you could do SomethingAwful. I also asked for the candidates to reverse a string. They could use the internet but we didn't tell them that up front. One candidate asked right out of the gate so they got the string reversal question but almost nothing of FizzBuzz. The second didn't ask until a few minutes in. As soon as I said yes there was a flourish of keyboard strokes as they just Googled "string reversal c#" and didn't get FizzBuzz anywhere. The third person got most of FizzBuzz except they checked divisible by 3, divisible by 5, and finally divisible by 3 and 5. Which was wrong but close enough. Really glad we did the simple coding exercises because if we picked candidate #1 or #2 we would have been firing them. I can try digging up the code. It was pretty bad
|
# ? Feb 1, 2014 23:50 |
|
Dessert Rose posted:I always give people Visual Studio and an internet connection because gently caress, if I can't write code without an API reference and intellisense in front of me, why should I expect someone to be able to do it in an interview? See, I'd like that. Doing poo poo verbally or on P&P is loving frustrating.
|
# ? Feb 1, 2014 23:53 |
|
gariig posted:For FizzBuzz you could change it something else. I used our company name you could do SomethingAwful. I also asked for the candidates to reverse a string. They could use the internet but we didn't tell them that up front. One candidate asked right out of the gate so they got the string reversal question but almost nothing of FizzBuzz. The second didn't ask until a few minutes in. As soon as I said yes there was a flourish of keyboard strokes as they just Googled "string reversal c#" and didn't get FizzBuzz anywhere. The third person got most of FizzBuzz except they checked divisible by 3, divisible by 5, and finally divisible by 3 and 5. Which was wrong but close enough. Really glad we did the simple coding exercises because if we picked candidate #1 or #2 we would have been firing them. In one interview, I had to determine if a string was a palindrome. I confused C#'s with Java's substring parameters; one uses substring(StartIndex, EndIndex) and the other did substring(StartIndex, LengthFromThere). The guy was a smug gently caress about it, too, and it was hardly a secret at the time I had more experience with Java. This was all on a whiteboard with no references at all, and it was a very obvious honest mistake. I probably dodged a bullet, though, that just reeks of insufferable bullshit.
|
# ? Feb 2, 2014 00:01 |
|
comedyblissoption posted:Is C#'s string being an enumerable of 16-bit char instead of unicode code points a coding horror? It has the excuse of backwards compatibility, and having unicode codepoints be the atomic units of your string is way less useful than it sounds. Something created from scratch today with the API exposing UTF-16 strings would be a horror though.
|
# ? Feb 2, 2014 00:36 |
|
Look Around You posted:I like how instead of letting it keep crashing and figuring out why "this cannot happen" happened, they just decided to say "gently caress it, let's keep on trucking" with the program in a potentially catastrophically invalid state. The story of my every single day. I'm a BA and not a developer, but every single day I see something that becomes the dumbest thing I've ever seen. I cannot wait to get promoted high enough to do DB & code reviews and put them off until the day before End of Sprint. edit: or get high enough to just fire people big trivia FAIL fucked around with this message at 01:40 on Feb 2, 2014 |
# ? Feb 2, 2014 01:38 |
|
2banks1swap.avi posted:In one interview, I had to determine if a string was a palindrome. I confused C#'s with Java's substring parameters; one uses substring(StartIndex, EndIndex) and the other did substring(StartIndex, LengthFromThere). The guy was a smug gently caress about it, too, and it was hardly a secret at the time I had more experience with Java. This was all on a whiteboard with no references at all, and it was a very obvious honest mistake. If that was actually a reason to fail an interview you totally dodged a bullet.
|
# ? Feb 2, 2014 02:08 |
|
gariig posted:For FizzBuzz you could change it something else. I used our company name you could do SomethingAwful. I also asked for the candidates to reverse a string. They could use the internet but we didn't tell them that up front. One candidate asked right out of the gate so they got the string reversal question but almost nothing of FizzBuzz. The second didn't ask until a few minutes in. As soon as I said yes there was a flourish of keyboard strokes as they just Googled "string reversal c#" and didn't get FizzBuzz anywhere. The third person got most of FizzBuzz except they checked divisible by 3, divisible by 5, and finally divisible by 3 and 5. Which was wrong but close enough. Really glad we did the simple coding exercises because if we picked candidate #1 or #2 we would have been firing them.
|
# ? Feb 2, 2014 04:07 |
|
gariig posted:The third person got most of FizzBuzz except they checked divisible by 3, divisible by 5, and finally divisible by 3 and 5. Which was wrong but close enough. That's the most telling part... they start trying to fix the problem, and you can see if they actually try to debug it, or if they just change things at random.
|
# ? Feb 2, 2014 04:34 |
|
comedyblissoption posted:What is even the point of asking a string reversal question that they just code an implementation of by googling which garners them a success by the interviewers? It seems like a complete waste of time. Wouldn't it be way better to allow googling and just ask questions within the same realm of complexity that aren't easily google-able? One would presume that's what the other, less googlable problems he mentioned he always asks too are for. It's not a bad idea to give them one that's both simple and easily searched for, because whether or not they go to Google for the answer tells you a lot about them and what sort of understanding of the code they'd end up producing as an employee they'll have.
|
# ? Feb 2, 2014 07:44 |
|
comedyblissoption posted:What is even the point of asking a string reversal question that they just code an implementation of by googling which garners them a success by the interviewers? It seems like a complete waste of time. Wouldn't it be way better to allow googling and just ask questions within the same realm of complexity that aren't easily google-able? I think you're misinterpreting the intention of FizzBuzz-type questions. They're not intended to check whether someone can program, they're intended to save time. Some candidates might memorize the answer, but that doesn't matter because they're gonna be caught out at the next question you ask. Meanwhile, anyone who has written a line of code in their life will have it out in 30s and you can get on with the interview.
|
# ? Feb 2, 2014 14:07 |
|
biznatchio posted:One would presume that's what the other, less googlable problems he mentioned he always asks too are for. It's not a bad idea to give them one that's both simple and easily searched for, because whether or not they go to Google for the answer tells you a lot about them and what sort of understanding of the code they'd end up producing as an employee they'll have. Really? I don't know that I agree with that. I produce good code as an employee but if you give me a problem that I can tell is going to be well solved, many times before me, gently caress yea I'm gonna go to Google to see if there's an implementation jump off point. It's one thing if someone is just blindly copying stack overflow with no adaptation or fitting the solution to the problem. But why would you want to hire someone that doggedly insists on reinventing every wheel? Damiya fucked around with this message at 18:17 on Feb 2, 2014 |
# ? Feb 2, 2014 18:15 |
|
2banks1swap.avi posted:In one interview, I had to determine if a string was a palindrome. I confused C#'s with Java's substring parameters; one uses substring(StartIndex, EndIndex) and the other did substring(StartIndex, LengthFromThere). The guy was a smug gently caress about it, too, and it was hardly a secret at the time I had more experience with Java. This was all on a whiteboard with no references at all, and it was a very obvious honest mistake. What sort of solution did you have that required using a substring method?
|
# ? Feb 2, 2014 18:15 |
|
Steve French posted:What sort of solution did you have that required using a substring method? I'm guessing: code:
edit: wait poo poo it is right isn't it edit: I don't know why someone would write it like this piratepilates fucked around with this message at 18:30 on Feb 2, 2014 |
# ? Feb 2, 2014 18:23 |
|
Won't that return 'false' for palindromes with an odd number of characters due to the use of len/2 in the second_half method?
|
# ? Feb 2, 2014 18:32 |
|
piratepilates posted:I'm guessing:
|
# ? Feb 2, 2014 18:34 |
|
Yeah it would but it's not a very good solution so I wouldn't worry about it.
|
# ? Feb 2, 2014 18:35 |
|
Steve French posted:What sort of solution did you have that required using a substring method? A good question. No real reason to use substring when afaik pretty much every language has some kind of regex implementation (or punctuation replacing method) and a string reversal mechanism. For example: Python code:
|
# ? Feb 2, 2014 18:46 |
|
Yeah, I can't think of any reason to use a substring method when checking for a palindrome. piratepilates' code was about the closest I could think of to something reasonable, but it would be a lot easier and simpler to just reverse the whole string and skip the substring bit if you're gonna go that route. Perhaps this is related to the real reason the guy was being a smug rear end in a top hat?
|
# ? Feb 2, 2014 18:52 |
|
Blinkz0rz posted:A good question. Or, assuming sanitized input, iterate over string length/2, check string[i] == string[string.Length-1-i]. That has the added bonus of breaking out of the method if you're dealing with a string like "hello world", where 'h' != 'd'. You can safely do length/2 because if the length is an odd number, it doesn't need to check the middle character. [edit] I agree that the sanest, most readable approach is definitely just to sanitize input and reverse the string, though.
|
# ? Feb 2, 2014 18:53 |
|
I'd be curious if there are test that go from fizzbuzz and get more and more complex just to see where/if you say "yeah that's the point where i'm not going to reinvent a wobbly, broken wheel on my own and use a well tested, documented library if it exists" because otherwise you end up with your own buggy "but it works on my dev machine/locale" date/time math or "totally safe because obscure" authentication/encryption system.
|
# ? Feb 2, 2014 19:15 |
|
Ithaqua posted:Or, assuming sanitized input, iterate over string length/2, check string[i] == string[string.Length-1-i]. That has the added bonus of breaking out of the method if you're dealing with a string like "hello world", where 'h' != 'd'. That makes sense and feels like it should be more efficient. Out of curiosity, I tested it in python: Python code:
code:
|
# ? Feb 2, 2014 19:59 |
|
Blinkz0rz posted:That makes sense and feels like it should be more efficient. Out of curiosity, I tested it in python: Is len a function in Python? It could be iterating the entire string every time to get the length, or something silly like that.
|
# ? Feb 2, 2014 20:13 |
|
len is a builtin function; getting the length of a sequence is O(1). It might be worth checking that out anyway, though, as well as the latter with s == reversed(s) rather than s == s[::-1].
Crosscontaminant fucked around with this message at 20:17 on Feb 2, 2014 |
# ? Feb 2, 2014 20:15 |
|
I've found as a general rule that interpreting python is actually quite slow. That's one of the reasons that things like numpy are built the way they are (with a big emphasis on vectorized operations). I expect pypy would fare better with the iterator.
|
# ? Feb 2, 2014 20:24 |
|
Crosscontaminant posted:len is a builtin function; getting the length of a sequence is O(1). It might be worth checking that out anyway, though, as well as the latter with s == reversed(s) rather than s == s[::-1]. code:
|
# ? Feb 2, 2014 20:27 |
|
As far as I know, the string comparison "==" just calls the __eq__ method on the built in string type, and I would imagine that's precompiled C. The only overhead is the string reversal, which is independent on whether the string is a palindrome.
|
# ? Feb 2, 2014 20:49 |
|
I thought nobody expected best performance for off the cuff, non prepared, no research, spit it out immediately interview questions. If someone wants me to write a library or a few methods for one why not just ask me to? That's MUCH more of a gauge of how I'd actually program at work than how I do poo poo with marker and whiteboard. I do find it funny that split and reverse works better. I just think of it in those terms, though yes doing it char by char makes sense, and if I was doing C I'd do it that way. I REALLY hate that interviewing is a separate skill set from programming that only slightly overlaps. At least now I know to practice it.
|
# ? Feb 2, 2014 21:05 |
|
But could you answer my question?
|
# ? Feb 2, 2014 21:18 |
|
I split the string into two halves, reversed one of the halves and compared them, but because I confused the parameters for .substring it wouldn't have worked in C#. I didn't do it character by character since I was trying to avoid off-by-one errors in an interview - you're not given time to test, research, or even really a lot of time to think. Split, reverse and compare seemed safer.
|
# ? Feb 2, 2014 21:44 |
|
2banks1swap.avi posted:I split the string into two halves, reversed one of the halves and compared them, but because I confused the parameters for .substring it wouldn't have worked in C#. Reverse and compare is safest/easiest. Don't need to split at all. Don't sweat it though, this is a safe space for silly mistakes. To balance it out, all my work today is for nothing because I forgot which way the hands on a clock go round coffeetable fucked around with this message at 22:08 on Feb 2, 2014 |
# ? Feb 2, 2014 22:05 |
|
Meh. At least now I have stuff I've done to talk about, and I'm not forced to do boring school questions in interviews.
|
# ? Feb 2, 2014 22:10 |
|
Palindrome testing is kind of begging for a recursive solution. And if anyone complains about stack space you talk about tail calls. If you have to allocate a reversed string I would be fairly alarmed.
|
# ? Feb 3, 2014 01:33 |
|
Is it? Can you show an elegant tail recursive solution? also, just because scala code:
Steve French fucked around with this message at 02:12 on Feb 3, 2014 |
# ? Feb 3, 2014 02:03 |
|
Steve French posted:Is it? Can you show an elegant tail recursive solution? if (s.length < 2) return true else if (s[0] != s[-1]) return false else return isPalindrome(s[1:-2])
|
# ? Feb 3, 2014 02:12 |
|
Jabor posted:if (s.length < 2) return true this would be cool in a language that uses structural sharing for strings, I guess.
|
# ? Feb 3, 2014 02:14 |
|
Fizzshedding: dozens of replies arguing about implementations of a trivial interview question.
|
# ? Feb 3, 2014 02:19 |
|
|
# ? May 30, 2024 12:19 |
|
Deus Rex posted:this would be cool in a language that uses structural sharing for strings, I guess. Allocating n/2 extra strings is cooler than allocating 1 extra string
|
# ? Feb 3, 2014 02:20 |