← Back to videos

Public mock interview with Valery for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Needs more practice Level: Pre-Junior / Junior- (solid basics, lacks depth & code mileage)

The candidate did not quite pass yet: he stayed remarkably calm, knew foundational terminology, and reasoned coherently, but lacked depth and hands-on practice on non-trivial language mechanics—tripping over chained reference assignment, slice assignment, and lazy generator evaluation after mutating the source list.

Candidate: Valery
Target role: Junior Python Backend

Started a Python course in late 2022, resumed active study this January after a hiatus · first mock interview, no commercial experience

Answers accuracy 13 total
58% score
Theory
2/6 correct · 67%
Live coding
3/7 correct · 50%
Practical task
Partially solved

Reference aliasing, slice assignment (lst[1:2] = ...), and lazy generator evaluation

The candidate correctly predicted that slicing via 'lst = lst[:5]' creates a new list leaving lst2 intact, and distinguished list comprehensions from generator expressions. However, he initially missed shared aliasing in 'lst = lst2 = [...]', predicted an error on slice assignment 'lst[1:2] = [20, 30, 40]', doubted 'list(squares)' would consume a generator, and could not explain why the generator included 25 after 'numbers.append(5)'.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Calm, composed communication and strong emotional control throughout his first mock interview
  • + Solid grasp of basic collection terminology, mutability, and O(1) hash-table lookup concepts
  • + Clear thinking aloud and ability to update his mental model after seeing an experiment run
  • + Accurately explained new object creation on slice reads lst[:5] and step-by-step next() on generators

Areas to improve

  • → Expand Python knowledge beyond textbook basics by studying language edge cases and data-model mechanics
  • → Solve hundreds of focused syntax and data-structure exercises (slicing, references, generators, collections)
  • → Master lazy generator evaluation timing and how 'for' and list() consume iterators automatically
  • → Explicitly state 'I haven't seen this, let me hypothesize' rather than guessing tentatively

Questions in this interview

13 / 13
01 ▶ 04:41
What is a list in Python, and what other built-in container types exist for storing collections?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Defined list as a mutable heterogeneous container and listed tuple, set, and dict as built-in alternatives.

Key takeaway

Python's core built-in containers—list, tuple, dict, and set (plus frozenset)—cover sequential, fixed, key-value, and unique-element storage.

Open moment on YouTube ↗
#01
02 ▶ 07:24
How do you choose the right container (list, tuple, dict, or set) for a specific problem?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Contrasted list vs tuple via dynamic growth vs immutability, and highlighted dict for key-value pairs and fast lookups, while omitting uniqueness/set operations for set.

Key takeaway

Choose containers by mutability (list vs tuple), key-value mapping (dict), element uniqueness/algebra (set), and lookup complexity (O(1) in set/dict vs O(n) in list).

Open moment on YouTube ↗
#02
03 ▶ 10:53
Which is faster for lookups—a list or a dictionary—and how does O(1) lookup work?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Correctly explained that dict is faster thanks to its hash table with O(1) time complexity, though briefly misspoke attributing O(1) search to list.

Key takeaway

Key lookup in dict/set averages O(1) via hash indexing, whereas 'x in list' takes O(n) linear time (only index access lst[i] is O(1)).

Open moment on YouTube ↗
#03
04 ▶ 14:44
Are strings mutable or immutable in Python?
Theory Strings, encodings & formatting
?
Candidate's answer

Answered immediately and accurately that strings (str) are immutable.

Key takeaway

Strings are immutable in Python: operations like replace() or '+' allocate a new str object, allowing strings to be safely shared and hashed.

Open moment on YouTube ↗
#04
05 ▶ 15:02
Does Python have arrays, and how does a classic array differ from a list?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Correctly noted arrays require an import and store homogeneous element types unlike heterogeneous dynamic lists, but mistakenly claimed arrays cannot mutate elements.

Key takeaway

Fixed-length C arrays still allow in-place element mutation by index, and Python's stdlib 'array.array' provides a mutable dynamic sequence of homogeneously typed C values.

Open moment on YouTube ↗
#05
06 ▶ 19:13
What are slices in Python, what are they used for, and which built-in types support them?
Theory Collections, lists, dicts & hash tables
?
Candidate's answer

Explained extracting sub-ranges of elements from a list, but had only used slices on lists and speculated they might work on dicts too.

Key takeaway

Slicing seq[start:stop:step] works on all sequence types (list, tuple, str, bytes, range) via __getitem__(slice), not on mappings or sets (dict, set).

Open moment on YouTube ↗
#06
07 ▶ 26:05
What does print(lst2) output after 'lst = lst2 = [1, 2, 3, 4, 5, 6]' and 'lst.append(7)'?
Live coding Data types, numbers & memory
?
Candidate's answer

Predicted [1, 2, 3, 4, 5, 6] assuming two separate lists were created; after seeing 7 in lst2, correctly explained both names pointed to the same list object.

Key takeaway

Chained assignment 'a = b = [...]' evaluates the list literal once and binds both names to the exact same object, so in-place mutations affect both aliases.

Open moment on YouTube ↗
#07
08 ▶ 28:21
Does lst2 change if we execute 'lst = lst[:5]' after 'lst = lst2 = [1, 2, 3, 4, 5, 6]'?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Correctly predicted lst2 remains [1, 2, 3, 4, 5, 6] because slicing allocates a new list object and rebinds only 'lst'.

Key takeaway

Reading a list slice (lst[:5] or lst[:]) always allocates a new shallow-copied list, leaving other references like lst2 untouched.

Open moment on YouTube ↗
#08
09 ▶ 31:11
Is slice assignment 'lst[1:2] = [20, 30, 40]' valid in Python, and what does it do to the list?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Wavered between inserting a nested list and crashing, bet on an error, and could not explain why 20, 30, 40 replaced index 1 inline.

Key takeaway

Slice assignment mutates a list in-place via __setitem__(slice, iterable), splicing the iterable's elements in place of the sliced range even when lengths differ.

Open moment on YouTube ↗
#09
10 ▶ 39:42
What is printed for 'squares = [n * n for n in numbers]' followed by 'numbers.append(5)'?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Accurately predicted numbers becomes [1, 2, 3, 4, 5] while squares stays [1, 4, 9, 16].

Key takeaway

A list comprehension evaluates eagerly right where it is defined, materializing an independent list unaffected by later appends to the source list.

Open moment on YouTube ↗
#10
11 ▶ 42:50
What changes if we replace brackets with parentheses in 'squares = (n * n for n in numbers)'?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Immediately identified a generator expression and predicted print(squares) would display the generator object metadata rather than computed numbers.

Key takeaway

Parentheses turn a comprehension into a lazy generator expression that defers computing elements until iterated.

Open moment on YouTube ↗
#11
12 ▶ 44:35
How does next() work on a generator, and can you consume all values via a for loop or list(squares)?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Accurately explained single-step retrieval via next(squares), but doubted how 'for' iterates a generator without explicit next() and predicted list(squares) would not materialize values.

Key takeaway

Built-ins like list(gen), tuple(gen), sum(gen), and 'for x in gen' all drive the iterator protocol automatically by calling next() until StopIteration.

Open moment on YouTube ↗
#12
13 ▶ 49:50
Why did list(squares) on generator '(n * n for n in numbers)' include 25 after 'numbers.append(5)'?
Live coding Decorators, iterators, generators & context managers
?
Candidate's answer

Predicted [1, 4, 9, 16] and was stumped when 25 appeared, unable to explain why the generator saw the appended 5.

Key takeaway

Creating a generator expression only grabs an iterator to 'numbers'; elements are fetched lazily during list(squares), by which time 5 has already been appended.

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

Mock interview for a Junior Python position. We discuss basic and "tricky" questions about lists, tuples, sets and dictionaries, the difference between mutable/immutable types, slices and their pitfalls, list comprehension vs generators, next(), and I also give detailed feedback to the candidate and a plan on how to level up to a confident junior.

Useful for: beginners in Python, junior job seekers, anyone preparing for technical interviews for backend.

Timestamps

00:00 Greeting and interview plan
00:29 Introduction of participants
04:45 Theoretical questions
22:17 Working with code
52:58 Feedback exchange

If the format is useful — like, subscribe and write in the comments what topic to cover in the next interview (for example: exceptions, iterators, decorators, OOP in Python, async).

Hashtags

#python #pythoninterview #juniorpython #interview #backend #development #algorithms #list #tuple #dict #set #slices #generators #listcomprehension #interviewpreparation