Python Forum
Drop Dead Simple Interview Questions - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Drop Dead Simple Interview Questions (/thread-2042.html)

Pages: 1 2 3


RE: Drop Dead Simple Interview Questions - Larz60+ - Feb-13-2017

I had to take a formal test when I went to work at my first telecommunications job,
even though I had already been there for over a year as an independent consultant.
I seem to recall that I thought the test could be passed by someone who had just taken
a high school programming class. It was implemented by non IT people (who thought quite
highly of it's value).


RE: Drop Dead Simple Interview Questions - nilamo - Feb-13-2017

Ok, so let's use that as an example.  Here's how I'd write it (without spending a ton of time thinking about it) ... (and honestly, my first thought was just is_number = lambda x: x.isdigit() lol)

>>> def is_number(s):
...     try:
...         ignore = float(s)
...         return True
...     except ValueError:
...         pass
...     return False
...
>>> is_number(5)
True
>>> is_number("7")
True
>>> is_number("-7.432")
True
>>> is_number("your mom")
False
You guys must be more impressive than me.  I've always been on the receiving end of interviews, never the giving end :p


RE: Drop Dead Simple Interview Questions - micseydel - Feb-13-2017

Yeah, isdigit() is a lot of people's first thought, and it's not very inclusive. What you have that works, for such a simple question we disallow using a tool that basically does the task directly.

I prefer to give questions that don't prohibit using anything, that (hopefully) can't be Google'd too easily, but this is the closest I get to "dead simple". sqrt() (using binary search) is another simple-ish one.


RE: Drop Dead Simple Interview Questions - nilamo - Feb-13-2017

Does sqrt = lambda n: n ** 0.5 count as cheating?  :p


RE: Drop Dead Simple Interview Questions - Ofnuts - Feb-13-2017

(Feb-13-2017, 08:44 PM)micseydel Wrote: I wouldn't ever give Fizzbuzz, I'd be afraid of insulting the candidate. Are you interviewing them for a specific role or position? Are they expected to be familiar with computer science?

A warmup question I often give is "write a function which takes in a string and returns true if the string represents a number." The candidate is meant to clarify the requirements, and be able to code it up after. If they write something that just handles non-negative integers, I start providing additional sample cases for negative and floating point numbers. They also often don't accommodate for "-", "." and sometimes even after that, "-.".

Well, you didn't think about the thousands separators either. And this question is more complicated than you think. Whistle


RE: Drop Dead Simple Interview Questions - wavic - Feb-13-2017

Hah! I had this job "interview" for maintaining the National TV servers. The questions... :) Am I able to sit for hours watching few screens with data flowing from some monitoring programs? Do I have experience with BSD? When I said that I have Linux experience... Do I know Python? I said that I don't. The next one was am I able to read fifty pages per day in English is I want to study... That was all. Between the common chat. Nice people! I am happy I didn't get the job. It was well paid and I'd learn a lot. But I am much better now. And free from this 8-17 rhythm of life


RE: Drop Dead Simple Interview Questions - micseydel - Feb-13-2017

(Feb-13-2017, 08:56 PM)nilamo Wrote: Does sqrt = lambda n: n ** 0.5 count as cheating? :p
Yes =p

(Feb-13-2017, 08:56 PM)Ofnuts Wrote: Well, you didn't think about the thousands separators either. And this question is more complicated than you think.
I tend to want a solution that accepts what most programming languages do for floats (without concern for underflow/overflow), in ASCII and the locale I share with the candidate. So, no "thousands separator" and the decimal separator is a dot rather than a comma. I also don't expect scientific notation, but I appreciate it when candidates suggest it.


RE: Drop Dead Simple Interview Questions - Ofnuts - Feb-13-2017

(Feb-13-2017, 08:49 PM)nilamo Wrote: You guys must be more impressive than me.  I've always been on the receiving end of interviews, never the giving end :p

I don't ask code questions, because all I get to see is a first shot, and this first shot is very often plain crap. What makes a good programmer is the ability to think it over and rewrite it, but you have no time for this in an interview.

Good programmers like coding so they are not one-language ponies (especially if you hire them for a boring language like Java...), and likely also code at home. So I ask candidates about the compilers they have on their own PC and their pet projects. Some are embarrassed,  others lighten up. It also make them consider that even if the job can be a bit boring, it will at least be done with like-minded people, so there is some hope that they will be able to use some not too decaying technologies. Because, remember that the interview works both ways, programmers are not that desperate, and you also have to attract the good ones.


RE: Drop Dead Simple Interview Questions - micseydel - Feb-13-2017

Yeah, interviews are definitely very artificial. Unfortunately, in Silicon Valley at least, there aren't enough at-home programmers to go around :)

I agree 100% of the interview going both ways though. I think that's the part my current company is really struggling with. Closing the people that we want is tough!


RE: Drop Dead Simple Interview Questions - nilamo - Feb-13-2017

At my current job's interview (which was 5 years ago), I was handed a napkin and asked to write an sql query to get a count of how many "billable leads a certain customer had". I looked at him, and asked "so... what's the table structures like?" He replied "it doesn't matter, I just want to see how you think." Afterwards, he said the position was for a c# developer, and he asked if I wanted the job. I told him I had never even looked at c# before, and he replied "it doesn't matter, you'll figure it out."

My last job's interview... nearly 9 years ago... I walk into the room, we shake hands, then one of the guys gets a text, he makes a comment to the other guy, and they both excuse themselves. I was left alone in the room for nearly an hour, and when they came back, they said simply "some days emergencies happen. Thanks for not leaving." (I think that particular issue was the old computer which did all the shipping through ups and fedex had finally died, and a replacement had to be quickly setup).

Anyway, interviews are weird places.