The best VPN 2023

The Best VPS 2023

The Best C# Book

Python coding test problem for interviews

Sign uporlog into customize your list.

@Kal Handling emoticons vs other punctuation can be made non-trivial if you plan the question well.

I specially like we dont care what people have memorized

Fantasy novel with obvious – but never defined – sci-fi elements?

What is the logic behind forbidding conversion therapies?

Thats one of the things we do now. But it turns out to be too easy in Python.

My cat loves coconut oil. Is it safe to give him some?

Does the existence of a mathematical object imply that it is possible to construct the object?

Would a robot really need to use a heads up display (HUD)?

How can I tell someone that I am glad to be leaving them without sounding petty?

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See theHow to Askpage for help clarifying this question.If this question can be reworded to fit the rules in thehelp center, pleaseedit the question.

Ive tidied up the question a bit. See the original linked above along with my answer. It tests a number of things, and there are different ways of tackling the problem. They can also get a half-solution out that first disregards the emoticons and punctuation aspect. Just finding the emoticons is another sub-problem that can be solved separately. And so on…

I have reason to believe that my very competent coworker is being severely underpaid – any tactful way to tell a boss?

Is murder in Washington, DC pardonable by the President?

Start here for a quick overview of the site

permutations of a string is built in in Python. Also, a good python programmer will, in many circumstances, prefer a non-recursive solution.

Identification of filter component in sewing machine foot pedal

Ive asked candidates to write code to implement bowling scoring before, which is readily comprehensible but contains enough wrinkles that most people have to iterate their approach a couple times to cover all the edge cases.

We have a problem which we use for Java coding tests, which involves reading a file and doing a little processing on the contents. It works well with candidates who are familiar with Java (or even C++). But were running into a number of candidates who just dont know Java or C++ or C or anything like that, but do know Python or Ruby. Which shouldnt exclude them, but leaves us with a dilemma: On the one hand, we dont learn much from watching someone struggle with the basics of a totally unfamiliar language. On the other hand,the problem we use for Java turns out to be pretty trivial in Python (or Ruby, etc)- anyone halfway competent can do it in 15 minutes. So, Im trying to come up with something better.

That would make sense if this was a test of their knowledge of Python, but thats not the goal. We want to see a design, watch it evolve and get debugged, etc.

What is Mikes formula for naming software packages?

I can literally do FizzBuzz with my eyes closed in python using emacs. Its super trivial

Learn more about hiring developers or posting ads with us

That sounds close enough to our Java problem that I suspect its going to be too easy unless the requirements get pretty complicated, which is not ideal.

Heres aquestion I answered on SO recentlythat might be the start of something suitable:

Cant you let them do your Java question in Python?

Its available on the Wayback /web/931/

Detailed answers to any questions you might have

Surprisingly, Google doesnt show me anyone doing something like this, unless Im just too dumb to enter the obvious search term. The best idea Ive come up with involves scheduling workers to time slots, but its maybe a little too open-ended. Have you run into a good example? Or a bad one? Or do you just have an idea?

Discuss the workings and policies of this site

This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand ourCookie PolicyPrivacy Policy, and ourTerms of Service. Your use of Stack Overflows Products and Services, including the Stack Overflow Network, is subject to these policies and terms.

site design / logo 2018 Stack Exchange Inc; user contributions licensed undercc by-sa 3.0withattribution required.rev2018.6.6.30686

Formula for Goldman Lie bracket of surface

Im not looking for a tough algorithmic problem- there are other sections of the interview where we do that kind of thing. The point of this section is to sit and watch them actually write code. So it should be something that makes them use just the data structures which are the everyday tools of the application developer – lists, hashtables (dictionaries in Python), etc, to solve a quasi-realistic task. They shouldnt be blocked completely if they cant think of something really clever.

@macrog He stated that the Java thing is really trivial in Python etc.

Are there rules for categorising all pawn-only endgames into won/drawn/lost?

Good analogy needed: Sec issues due to different coders implementing the same features in different ways for the same app

Not the answer youre looking for? Browse other questions taggedpythonorask your own question.

Given a stringO João foi almoçar 🙂 ., split it into a list of words. You must strip all punctuation except for emoticons. Result for example:[O,João, foi, almoçar, :)]

I also suggest searching through thepython+interview-questionsquestions posted on SO. There are some good ones, and you may even want to broaden your search to skim allinterview-questionsposts if you have time.

Learn more about Stack Overflow the company

@Kal then asking them to define a class that did some file I/O might be a good idea.

You can always just give them a few more questions on top of the Java one, like ask them to do the Java task, then ask them to define a class, then ask them to doFizzBuzz. That should be about as rigorous as your Java task.

A lot of the problems at which are taken from ACM competitions, are also suitable for your use. I used them to familiarize myself with python syntax and language features. A lot amount to straightforward application of standard data structures; some are more focused on algorithmic issues. If you sort through them Im sure youll find several that fit your needs.

Im 24 with a 4-year-old son. How to handle uncomfortable questions from people?

Sadly that link is now dead. Old question I know, but still top so maybe select a different answer?

shell to print modification date of all directories name match pattern

What are the registers W and Z inside a Z80?

The tagged search (interview questions + python) returns nothing, as does interview quetions by itself. 🙁

Im trying to come up with a good coding problem to ask interview candidates to solve with Python.

Money and Money, can two different currency types be realistically maintained in the same economy?

Theyll have an hour to work on the problem, with an IDE and access to documentation (we dont care what people have memorized).

Dont be afraid to ask a series of questions. Maybe you can even ask them to write a few one-liners to make sure they get the finer points of Python (write a list comprehension, how do you define a lambda, etc.)

@Ivo Missed that part. @Kal Can you tell us the Java question so we know the level youre looking at?

+1 For list comprehensions, let them do FizzBuzz in a list comprehension, that can be done in under 2 minutes. And then some other non trivial comprehension stuff, or iterators and such.

You could extend it to asking about emoticons adjacent to other punctuation, adjacent emoticons, overlapping emoticons, defining emoticons in:)form but also searching for those of the form:-). You could also turn it into a frequency count problem instead of just splitting to somewhat line up with your Java question.

Is there an idiomatic way to say go to the path of no way out?

A private, secure home for your teams questions and answers.

@Kal Well if you want have them to design something. Give them a more complex application barebone, tell them you want features X, Y and Z. Let them read the code (obviously shows you how long it takes them to understand the existing application), ask them how they are going to add the features to the existing code (shows you how theyre thinking when it comes to extend existing code), you can then see how the interact with the code etc. Put in a bug or two in the existing source to have them debug it.

Which is pronouncement of Lord mentioned in Vivekachudamani?

I dont know about Python specifically, but I found that interview questions which involve recursion are a very effective filter. I have asked candidates to produce all the permutations of a string (and think about how to test it), and I have been asked to pseudo-code the Longest Common Subsequence.

1 thought on “Python coding test problem for interviews”

  1. Hiya! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My website covers a lot of the same subjects as yours and I think we could greatly benefit from each other. If you’re interested feel free to send me an email. I look forward to hearing from you! Terrific blog by the way!


Leave a Comment