I've 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.
A lot of the problems at http://www.streamtech.nl/site/problem+set, 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 I'm sure you'll find several that fit your needs.
Answer from Seamus Campbell on Stack OverflowI've 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.
A lot of the problems at http://www.streamtech.nl/site/problem+set, 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 I'm sure you'll find several that fit your needs.
I can recommend to you Checkio.org
Favorite Python Interview Question
"What don't you like about Python?"
More on reddit.com20 Python Interview Questions To Challenge Your Knowledge
Python is one of the popular and loved programming languages. Companies ask different tricky questions during an interview. So here are the 20 Python interview questions, and there are 1-line answers that can be helpful for you in an interview.
1. What do you know about Python as a programming language?
Python is a very popular and high-level programming language.
2. What makes Python different from other existing programming languages?
Python is straightforward to learn and has high readability. Its simplicity and readability set it apart from other programming languages.
3. What is a pip? How is it related to Python?
Pip is the package manager and installer we use in Python to install different packages.
4. How to create a dictionary in Python?
To create a dictionary in Python, we use curly braces and values in the form of key-value pairs.
5. What is the difference between a tuple and a list?
Lists are mutable, while tuples are not. Tuple initialized using (), while list using [ ] braces.
6. Differentiate between a module, a package, and a library in Python.
The module is the Python code, a single file, while the package is the collection of modules, and libraries are the collection of packages.
7. What are decorators?
Decorators are functions that modify other functions.
8. How can we manage memory in Python?
Python uses a method called garbage collection to manage memory.
9. What is monkey pitching in Python?
Monkey pitching is the way to modify your code during runtime.
10. Define using the __init__( ) method in a Python class.
In Python, class __init__ is used to initialize the attributes.
11. How to write data in a file?
We use open() function with write mode to write data into a file.
12. Tell the difference between "is" and "==" operators.
Operator "is" Checks if two objects have the same identity, while "==" checks if two objects have the same value.
13. What do you know about Python generator?
A generator in Python is a function that returns an iterator to generate a sequence of values on the fly without creating an entire list in memory.
14. What is PEP8, and where is it used?
It is a style guide for Python code, and it helps the programmer to maintain the coding standards.
15. Explain the lambda function in Python.
It is an anonymous function that can take any number of arguments.
16. How to handle exceptions in Python?
7. 1Try-except blocks in Python are used to handle the exceptions.
How will you read a large Python file(say 10 GB) if your computer has only 4GB RAM?
We can load the file in a buffer in chunks and process each chunk. This technique loads only part of the file in memory at a time.
18. Define scope in Python.
Scopes define the accessibility of any variable in the code.
19. What do you know about docstrings in Python?
Docstrings are used to document functions, classes, and modules in Python.
20. Define the use of "with" statement in Python.
The "with" statement is used for resource management in Python.
More on reddit.comPython interview questions. Junior
What is currying?
Are you sure this should be part of the list? Python doesn't naturally support currying, and it's not something that I would anticipate an interviewer focusing on in a Python interview.
P.S. I like the pictures on your site!
More on reddit.com150+ Python Interview Questions and Answers for Freshers [Latest]
Some of these examples are really great.
But a few of these require more elaboration, and look like unfinished stubs.
Q.67 seems incomplete, and incorrect.
Explanation of "With" is better explained by the Python Docs.
the with statement allows the execution of initialization and finalization code around a block of code.
It's not simply about opening files.
More on reddit.com