← Back to videos

Mock interview with Gregory for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed interview Level: Junior

The candidate passed confidently: answered roughly 80% of questions accurately across data structures, mutability, indentation, and exception handling, communicated calmly, and caught the tuple trailing-comma trick and major PEP 8 issues. Key growth areas are precise terminology (authentication vs authorization) and module import mechanics around if __name__ == '__main__'.

Candidate: Grigory
Target role: Junior Python Developer

20 y/o · self-taught / ~8 months learning Python without a CS degree; received a job offer after a one-week internship the day before the interview

Answers accuracy 13 total
73% score
Theory
7/9 correct · 83%
Live coding
1/4 correct · 50%
Practical task
Partially solved

Analyzing trailing-comma tuple creation, issubclass, and PEP 8 refactoring

The candidate correctly parsed numeric underscores and the trailing comma creating a tuple, converted camelCase/PascalCase names to snake_case, split semicolon-joined statements, and renamed the function to match its behavior. However, he missed several remaining defects in the snippet and misexplained how if __name__ == '__main__' interacts with importing functions from another module.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Solid grasp of Python types, reference rebinding vs mutation, and list internals (over-allocated dynamic array of pointers)
  • + Sharp code reading (immediately spotted numeric underscores 1_999_333 and the trailing comma creating a tuple)
  • + Clear comparison of EAFP (try/except) and LBYL (pre-check if) error-handling strategies
  • + Calm, confident communication and strong soft skills

Areas to improve

  • → Clearly distinguish authentication (verifying identity) from authorization (checking permissions/roles)
  • → Understand Python module imports and why if __name__ == '__main__' guards script execution without blocking function imports
  • → Look beyond naming in code reviews to catch unused variables, runtime type pitfalls, and pure-function separation

Questions in this interview

13 / 13
01 ▶ 04:00
What are data types in Python, which built-in ones exist, and how does a data type differ from a data structure?
Theory Data types, numbers & memory
?
Candidate's answer

Listed built-in scalar and collection types by mutability and concisely contrasted data types ('what value is stored') with data structures ('how elements are organized in memory').

Key takeaway

A data type defines value semantics and valid operations, whereas a data structure defines memory layout and algorithmic complexity of operations.

Open moment on YouTube ↗
#01
02 ▶ 06:10
How does Python's list differ from a classic fixed-type array and from a linked list?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Explained classic arrays store homogeneous items of fixed size, Python's list is an over-allocated dynamic array of object references supporting mixed types, and a linked list chains nodes via next pointers.

Key takeaway

CPython implements list as a contiguous dynamic array of PyObject* pointers with over-allocation, giving O(1) indexing and amortized O(1) appends.

Open moment on YouTube ↗
#02
03 ▶ 08:23
How do you choose the right Python collection for a specific task?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Proposed deciding on mutability first (choosing tuple/frozenset for fixed data to save memory and prevent mutation), then checking whether uniqueness (set) or ordered dynamic storage (list) is needed.

Key takeaway

Match collections to access patterns: tuple for fixed records, list for dynamic sequences, set/dict for O(1) hash lookups, and collections.deque for O(1) pops/appends on both ends.

Open moment on YouTube ↗
#03
04 ▶ 13:34
If we run 'value = (1, 2, 3)' followed by 'value = (1, 2, 3, 4)', did we mutate the tuple?
Theory Data types, numbers & memory
?
Candidate's answer

Clearly explained that the tuple (1, 2, 3) was not mutated; the variable 'value' was simply rebound to a newly allocated tuple (1, 2, 3, 4).

Key takeaway

Rebinding a variable name only updates the reference; the original immutable tuple remains untouched and is garbage-collected once unreferenced.

Open moment on YouTube ↗
#04
05 ▶ 15:05
What is None in Python and when does a function return it automatically?
Theory Data types, numbers & memory
?
Candidate's answer

Defined None as the sole value of NoneType representing the absence of a value, returned implicitly whenever a function finishes without returning another value.

Key takeaway

None is the singleton instance of NoneType; Python functions without an explicit return expression always return None.

Open moment on YouTube ↗
#05
06 ▶ 16:23
What does the snippet with 1_999_333, a trailing comma after 'abc', and issubclass(..., int) do?
Live coding Data types, numbers & memory
?
Candidate's answer

Correctly recognized numeric underscores in 1_999_333 and the trailing comma turning Text into a tuple, predicting False for the int subclass check while missing other subtle issues in the snippet.

Key takeaway

A trailing comma creates a 1-element tuple ('abc',), and issubclass() requires a class as its first argument (raising TypeError on instances, unlike isinstance()).

Open moment on YouTube ↗
#06
07 ▶ 18:09
What PEP 8 convention violations appear in 'def getValue()' and 'a = 1_999_333; Text = "abc",'?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Converted camelCase function naming to snake_case, split the semicolon-separated statements onto two lines, and lowercased Text because PascalCase signals a class name to other developers.

Key takeaway

Consistent PEP 8 naming conventions let readers immediately distinguish classes (CapWords), functions/variables (snake_case), and constants (UPPER_CASE).

Open moment on YouTube ↗
#07
08 ▶ 21:30
Why are single-letter variable 'a' and naming a printing function 'get_value' considered bad clean-code practices?
Live coding Algorithms, code reading & engineering practices
?
Candidate's answer

Renamed 'a' to descriptive 'big_value' and 'get_value' to 'print_type' to match its printing behavior, but missed that 'big_value' was dead unused code inside the function.

Key takeaway

A 'get_' prefix implies returning a value rather than printing, and clean-code reviews should also eliminate dead/unused local variables.

Open moment on YouTube ↗
#08
09 ▶ 25:04
Why use 'if __name__ == "__main__":' in a module, and does it prevent importing and calling the module's functions elsewhere?
Live coding Modules, packages, imports & stdlib
?
Candidate's answer

Started on the right track about main entry-point files, but mistakenly claimed the guard prevents other modules from importing and calling the function.

Key takeaway

Far from blocking imports, 'if __name__ == "__main__":' enables safe reuse of a module's functions elsewhere without triggering its top-level script execution on import.

Open moment on YouTube ↗
#09
10 ▶ 31:02
What is the difference between authentication and authorization in a web application?
Theory Algorithms, code reading & engineering practices
?
Candidate's answer

Swapped the two concepts at first—defining user lookup in the DB as authorization and permission granting as authentication—and remained unsure when challenged.

Key takeaway

Authentication verifies identity ('who are you?'), whereas authorization checks permissions and access rights ('what are you allowed to do?').

Open moment on YouTube ↗
#10
11 ▶ 35:46
Should Python indentation use spaces or tabs, and what happens if you mix them?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Explained either spaces or tabs work alone, PEP 8 standardizes on 4 spaces for readability, and mixing tabs and spaces raises a syntax error.

Key takeaway

Python 3 raises TabError (a subclass of IndentationError / SyntaxError) when tabs and spaces are mixed inconsistently; PEP 8 prescribes 4 spaces.

Open moment on YouTube ↗
#11
12 ▶ 37:49
Are 'error' and 'exception' the same thing in Python, and what happens when an exception goes unhandled?
Theory Exceptions & debugging
?
Candidate's answer

Initially equated them, then refined his answer: an exception is the runtime object raised when an error/special condition occurs, terminating the program if uncaught.

Key takeaway

An exception is a structured runtime object propagated up the call stack to signal errors or control-flow events; if uncaught, Python prints a traceback and exits.

Open moment on YouTube ↗
#12
13 ▶ 40:07
What two approaches prevent crashing on division by zero, and when is try/except preferable to an upfront 'if' check?
Theory Exceptions & debugging
?
Candidate's answer

Described both catching exceptions with try/except and pre-checking the divisor with 'if', explaining try/except scales much better for network requests and complex operations with many failure modes.

Key takeaway

Simple local checks like 'if b != 0' avoid exception overhead, while EAFP (try/except on specific exception types) is essential for I/O, network calls, and race-prone operations.

Open moment on YouTube ↗
#13
Original video description & timecodes

Gregory successfully passes a mock interview! 🔥

In this video you will see a mock interview with Gregory, a Yandex Practicum student who is trying his hand at a mock interview for a Junior Python developer position.

What awaits you in this video?
✅ Real questions that might come up in an interview
✅ Code example and detailed discussion
✅ Feedback and advice on how to prepare for an interview

Gregory confidently answers questions and shows deep understanding of the fundamental foundations of programming. But there will be mistakes too!

Want to try yourself in this format? Write in the comments and apply!

🔥 Support Gregory with a like and subscribe if you want more such interviews!

Timestamps:

00:00 Introduction
00:28 A few words about the interviewer and candidate
03:42 Questions
16:01 Working with code
31:00 Continuation of theoretical questions
44:15 Feedback exchange

On this channel I conduct mock interviews for the role of Python developer for anyone interested. This is a great opportunity to prepare for a real interview, improve your skills, get useful tips and honest feedback. I do all of this absolutely for free. However, maintaining quality requires significant time and resources. If you like my content and want to support the channel, I'll be grateful for any financial support.

https://www.tbank.ru/cf/4PYyn4udS41

#MockInterview #Interview #Python #Backend #Programming