Python Interview Questions Beginner
1. Know how to write code on a whiteboard or paper
2. Know basic python control flow
Know how to use if/else statements
Know how to use for loops
Know how to use while loops
for loops:
while loops:
if/else statements:
3. Be able to discuss how you've used python in the past
Spamcannon
Webscraper BVB
Template Generator
To do webapp using flask
4. Know how to solve common interview problems
Fizz Buzz - i.e Bolt
Fibonacci Sequence
You print out a number and each next number is the previous 2 numbers added
5. Know basic python data types and when to use them
Strings
Lists
Tuples
Dicts
Sets - A List with no repeated values
NOTE: AND HOW TO ITTERATE THROUGH THEM!
List vs tuple, when to use each?
Apart from tuples being immutable there is also a semantic distinction that should guide their usage. Tuples are heterogeneous data structures (i.e., their entries have different meanings), while lists are homogeneous sequences. Tuples have structure, lists have order.
Using this distinction makes code more explicit and understandable.
One example would be pairs of page and line number to reference locations in a book, e.g.:
6. Know how to use list comprehansion
7. Know how to use Generators
Fibonacci Generator:
range
vs xrange
xrange gives 1 result at a time
range gives the entire range of numbers in memory at once
8. Know the basics of OOP
What is self? - The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class. It does not have to be named self , you can call it whatever you like, but it has to be the first parameter of any function in the class
9. Have python related questions ready to ask your interviewer
Do you guys use python2 or python3?
What modules are you using to interact with databases?
10. Know the basics of other Technologies
Version control like GIT
Linux CLI
Databases and SQL
Last updated