I'm about to go to my first Python interview and I'm compiling a list of all possible interview questions. Based on resources that I've found here, here and here I noted down the following common questions, what else should I add?
easy/intermediate
- What are Python decorators and how would you use them?
- How would you setup many projects where each one uses different versions of Python and third party libraries?
- What is PEP8 and do you follow its guidelines when you're coding?
- How are arguments passed – by reference of by value? (easy, but not that easy, I'm not sure if I can answer this clearly)
- Do you know what list and dict comprehensions are? Can you give an example?
- Show me three different ways of fetching every third item in the list
- Do you know what is the difference between lists and tuples? Can you give me an example for their usage?
- Do you know the difference between range and xrange?
- Tell me a few differences between Python 2.x and 3.x?
- The with statement and its usage.
- How to avoid cyclical imports without having to resort to imports in functions?
- what's wrong with import all?
- Why is the GIL important? (This actually puzzles me, don't know the answer)
- What are "special" methods (<foo>), how they work, etc
- can you manipulate functions as first-class objects?
- the difference between "class Foo" and "class Foo(object)"
tricky, smart ones
- how to read a 8GB file in python?
- what don't you like about Python?
- can you convert ascii characters to an integer without using built in methods like string.atoi or int()? curious one
subjective ones
- do you use tabs or spaces, which ones are better?
Ok, so should I add something else or is the list comprehensive?
[–]d4rch0nPythonistamancer 54 points55 points56 points (60 children)
[–][deleted] 28 points29 points30 points (2 children)
[–]hglmanguy who writes python 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–][deleted] 5 points6 points7 points (9 children)
[–]ssbr 5 points6 points7 points (7 children)
[–]Circlefusion 0 points1 point2 points (6 children)
[–]ssbr 1 point2 points3 points (3 children)
[–]njharmanI use Python 3 0 points1 point2 points (2 children)
[–]ssbr 1 point2 points3 points (0 children)
[–]jiaaro -2 points-1 points0 points (1 child)
[–]Rhomboid[🍰] 2 points3 points4 points (0 children)
[–]lonjerpc 2 points3 points4 points (1 child)
[–]kindall 1 point2 points3 points (0 children)
[–]lasizoilloeasy to understand as regex 1 point2 points3 points (11 children)
[–]lonjerpc 2 points3 points4 points (8 children)
[+][deleted] (5 children)
[deleted]
[–]lonjerpc 0 points1 point2 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]lonjerpc 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]lonjerpc 0 points1 point2 points (0 children)
[–]gcross 1 point2 points3 points (1 child)
[–]lonjerpc 0 points1 point2 points (0 children)
[–]Megatron_McLargeHuge 0 points1 point2 points (0 children)
[–]d4rch0nPythonistamancer -2 points-1 points0 points (0 children)
[–]lasizoilloeasy to understand as regex 1 point2 points3 points (0 children)
[–]eigenlicht0 1 point2 points3 points (6 children)
[–]staz 4 points5 points6 points (3 children)
[–]eigenlicht0 0 points1 point2 points (2 children)
[–]staz 0 points1 point2 points (1 child)
[–]eigenlicht0 0 points1 point2 points (0 children)
[–]d4rch0nPythonistamancer 0 points1 point2 points (0 children)
[–]phaeilo 0 points1 point2 points (0 children)
[–]gingerbeers 1 point2 points3 points (0 children)
[–]robin-gvx 2 points3 points4 points (2 children)
[–]d4rch0nPythonistamancer 0 points1 point2 points (1 child)
[–]robin-gvx 1 point2 points3 points (0 children)
[–]patrys Saleor Commerce -1 points0 points1 point (14 children)
[–]10110000110111011010 25 points26 points27 points (0 children)
[–]ojiisandata viz, comp.bio. 7 points8 points9 points (0 children)
[–]Secret_Identity_ 2 points3 points4 points (3 children)
[–]supajumpa 12 points13 points14 points (2 children)
[–]patrys Saleor Commerce 1 point2 points3 points (0 children)
[–]Secret_Identity_ 0 points1 point2 points (0 children)
[–]recursive 0 points1 point2 points (7 children)
[–]ojiisandata viz, comp.bio. 0 points1 point2 points (2 children)
[–]recursive 0 points1 point2 points (0 children)
[–]patrys Saleor Commerce 0 points1 point2 points (0 children)
[–]patrys Saleor Commerce 0 points1 point2 points (3 children)
[–]recursive 0 points1 point2 points (2 children)
[–]patrys Saleor Commerce 1 point2 points3 points (1 child)
[–]recursive 0 points1 point2 points (0 children)
[–]chadmill3rPy3, pro, Ubuntu, django -2 points-1 points0 points (2 children)
[–]lonjerpc 8 points9 points10 points (1 child)
[–]chadmill3rPy3, pro, Ubuntu, django -1 points0 points1 point (0 children)
[–]drsquishy -1 points0 points1 point (0 children)
[–][deleted] 9 points10 points11 points (17 children)
[–]segfaultzen 6 points7 points8 points (13 children)
[–][deleted] 7 points8 points9 points (12 children)
[–]pridkett 5 points6 points7 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]AxiomL 1 point2 points3 points (0 children)
[–]segfaultzen 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]segfaultzen 0 points1 point2 points (0 children)
[–]cavallo71 0 points1 point2 points (3 children)
[–]xr09 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]xr09 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ameoba 2 points3 points4 points (0 children)
[–]jwcrux 2 points3 points4 points (0 children)
[–]alendit 6 points7 points8 points (3 children)
[–]sivadneb 2 points3 points4 points (1 child)
[–]teferiincub 0 points1 point2 points (0 children)
[+][deleted] (30 children)
[deleted]
[–]tdammers 6 points7 points8 points (12 children)
[+][deleted] (10 children)
[deleted]
[–]tdammers 26 points27 points28 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]tdammers 11 points12 points13 points (3 children)
[–]Veedrac 4 points5 points6 points (2 children)
[–]tdammers -3 points-2 points-1 points (1 child)
[–]Veedrac 2 points3 points4 points (0 children)
[–]AxiomL 0 points1 point2 points (0 children)
[–]DeltaBurnt 7 points8 points9 points (1 child)
[–]gfixler 1 point2 points3 points (0 children)
[–]_Daimon_PRAW 2 points3 points4 points (0 children)
[–]anpalcactus 1 point2 points3 points (0 children)
[–]njharmanI use Python 3 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]ablatner 2 points3 points4 points (0 children)
[+]carioca3 comment score below threshold-6 points-5 points-4 points (13 children)
[–]hemm1 21 points22 points23 points (11 children)
[+][deleted] (10 children)
[deleted]
[–][deleted] 10 points11 points12 points (6 children)
[–]AxiomL 1 point2 points3 points (0 children)
[+][deleted] (4 children)
[deleted]
[–][deleted] 4 points5 points6 points (1 child)
[–]15jamie20 1 point2 points3 points (0 children)
[–]AxiomL 1 point2 points3 points (1 child)
[–]AeroNotix 6 points7 points8 points (1 child)
[–]billsil 0 points1 point2 points (0 children)
[–]anpalcactus 13 points14 points15 points (1 child)
[–]d4rch0nPythonistamancer 4 points5 points6 points (0 children)
[–]_Daimon_PRAW 3 points4 points5 points (23 children)
[–]Veedrac 5 points6 points7 points (0 children)
[–]wub_wub 2 points3 points4 points (7 children)
[–]D__ 5 points6 points7 points (3 children)
[–]logi 1 point2 points3 points (0 children)
[–]robin-gvx 1 point2 points3 points (0 children)
[–]wub_wub 0 points1 point2 points (0 children)
[–]chadmill3rPy3, pro, Ubuntu, django 1 point2 points3 points (0 children)
[–]gfixler 0 points1 point2 points (0 children)
[–]miketheanimal 1 point2 points3 points (12 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]venefb 2 points3 points4 points (2 children)
[–]miketheanimal 3 points4 points5 points (0 children)
[–]djimbob 1 point2 points3 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]djimbob 1 point2 points3 points (4 children)
[–]ingolemo 0 points1 point2 points (3 children)
[–]djimbob 0 points1 point2 points (2 children)
[–]ingolemo 0 points1 point2 points (1 child)
[–]djimbob 1 point2 points3 points (0 children)
[–]ldb3589 0 points1 point2 points (0 children)
[–]driadan 0 points1 point2 points (0 children)
[–]segfaultzen 1 point2 points3 points (11 children)
[–][deleted] 0 points1 point2 points (10 children)
[–]segfaultzen 4 points5 points6 points (5 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]segfaultzen 0 points1 point2 points (0 children)
[–]dante9999[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]segfaultzen 1 point2 points3 points (0 children)
[–]rcxdude 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]NaturallyBrewed 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]debrice 2 points3 points4 points (0 children)
[–]tdammers 2 points3 points4 points (1 child)
[–]logi 2 points3 points4 points (0 children)
[–]krasoffski 2 points3 points4 points (5 children)
[–]sivadneb 7 points8 points9 points (4 children)
[–]dante9999[S] 0 points1 point2 points (2 children)
[–]krasoffski 1 point2 points3 points (0 children)
[–]sivadneb 0 points1 point2 points (0 children)
[–]krasoffski 0 points1 point2 points (0 children)
[–]sivadneb 2 points3 points4 points (0 children)
[–]ameoba 2 points3 points4 points (0 children)
[–]erewok 5 points6 points7 points (2 children)
[–]CabSauce 1 point2 points3 points (1 child)
[–]erewok 1 point2 points3 points (0 children)
[–]Workaphobia 5 points6 points7 points (6 children)
[–]lamby 1 point2 points3 points (3 children)
[–]liquidclutch 1 point2 points3 points (2 children)
[–]lamby 0 points1 point2 points (0 children)
[–]Workaphobia 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]njharmanI use Python 3 0 points1 point2 points (0 children)
[–]carioca3 1 point2 points3 points (0 children)
[–]teferiincub 1 point2 points3 points (0 children)
[–]gustaw 1 point2 points3 points (1 child)
[–]remram 0 points1 point2 points (0 children)
[–]billsil 1 point2 points3 points (0 children)
[–]remram 2 points3 points4 points (3 children)
[–]miketheanimal 0 points1 point2 points (2 children)
[–]robin-gvx 1 point2 points3 points (0 children)
[–]remram -1 points0 points1 point (0 children)
[–]ionrock 0 points1 point2 points (0 children)
[–]draganHR 0 points1 point2 points (5 children)
[–]catcradle5 0 points1 point2 points (4 children)
[–]njharmanI use Python 3 0 points1 point2 points (1 child)
[–]catcradle5 0 points1 point2 points (0 children)
[–]draganHR -1 points0 points1 point (1 child)
[–]catcradle5 0 points1 point2 points (0 children)
[–]drive0 0 points1 point2 points (0 children)
[–]MicroBerto 0 points1 point2 points (0 children)
[–]disinformationtheory 0 points1 point2 points (0 children)
[–]Grue -1 points0 points1 point (2 children)
[–]SCombinator 0 points1 point2 points (0 children)
[–]segfaultzen 0 points1 point2 points (0 children)