← Back to videos

Mock interview with Ruslan for a Junior Python developer position

Interview timeline Click any block to jump

Interview breakdown

Interviewer verdict
Passed interview Level: Junior

The candidate passed at the Junior Python Developer bar: after just three months of study he showed solid foundational knowledge, composure, and logical reasoning. Two caveats stood out: unfamiliarity with basic iterable unpacking (*) and abrupt shifts in hypotheses without explaining his thought process on the bonus bitwise NOT (~) question.

Candidate: Ruslan
Target role: Junior Python Developer

Technical degree · 3 months of daily self-directed Python study, first technical interview

Answers accuracy 13 total
81% score
Theory
4/5 correct · 90%
Live coding
6/8 correct · 75%
Practical task
Partially solved

Underscore variables, * unpacking, ** precedence, and bitwise ~

The candidate accurately traced _ and __ variable names, def func(*_, **__), tuple return values, and right-associative 2 ** 3 ** 2 = 512, but missed tuple unpacking in print(*func(...)) until seeing the output 2 512. On the bonus __ = -~_ twist, he initially confused ~ with -inf, then recalled -(x + 1) after execution without knowing bitwise NOT.

Topics covered Click a topic to filter questions

Candidate strengths

  • + Calm, confident communication and structured reasoning in his very first interview
  • + Clear understanding of operator overloading, dunder methods (__add__), and polymorphism
  • + Accurate evaluation of right-associative exponentiation (2 ** 3 ** 2 == 512) and *args / **kwargs
  • + Strong self-study momentum and broad awareness achieved within 3 months

Areas to improve

  • → Master iterable and mapping unpacking (* and **) in function calls, returns, and assignments
  • → Explain the reasoning bridge whenever changing an answer mid-discussion so it doesn't look like guessing
  • → State knowledge boundaries explicitly on unfamiliar topics instead of jumping between contradictory theories
  • → Review Python bitwise operators (~, &, |, ^) and two's-complement integer representation

Questions in this interview

13 / 13
01 ▶ 03:26
What operator categories exist in Python, and how do unary, binary, and ternary operators differ?
Theory Control flow, loops & syntactic sugar
?
Candidate's answer

Listed arithmetic, logical (and, or, not), comparison, and assignment operators, and distinguished unary, binary, and ternary operators by operand count (one, two, or three).

Key takeaway

Operator arity reflects operand count: -x and not x are unary, a + b is binary, and x if cond else y is Python's ternary expression.

Open moment on YouTube ↗
#01
02 ▶ 04:40
What kind of operator is *, can it be unary like + and -, and what data types support multiplication?
Theory Data types, numbers & memory
?
Candidate's answer

Identified * as binary multiplication for numbers, strings, and lists and explained unary + and -, but was unsure whether prefix * is valid in Python.

Key takeaway

Binary * multiplies numbers and repeats sequences by an integer; a prefix * is iterable unpacking syntax rather than a unary arithmetic operator.

Open moment on YouTube ↗
#02
03 ▶ 06:53
Why does the same operator (* or +) behave differently for numbers vs strings, and what OOP principle is this?
Theory OOP, classes & dunder methods
?
Candidate's answer

Explained that values are instances of classes (int, str, list) implementing type-specific special methods (such as __add__), naming operator overloading and polymorphism.

Key takeaway

Python operators dispatch to dunder methods (__add__, __mul__, __radd__, __rmul__), providing ad-hoc polymorphism behind a uniform operator syntax.

Open moment on YouTube ↗
#03
04 ▶ 09:42
What does the ** operator do in Python and what is its arity?
Theory Data types, numbers & memory
?
Candidate's answer

Explained that ** is a separate binary operator raising the base operand to the power of the exponent operand.

Key takeaway

Binary x ** y invokes __pow__ and binds tighter than a leading unary minus (so -2 ** 2 evaluates to -(2 ** 2) == -4).

Open moment on YouTube ↗
#04
05 ▶ 11:41
What are *args and **kwargs used for in function definitions, and are the asterisks operators there?
Theory Functions, scopes & closures
?
Candidate's answer

Explained that *args collects arbitrary positional arguments and **kwargs collects keyword arguments into a dict, noting that in signatures they are parameter syntax rather than operators.

Key takeaway

In a def signature, * packs extra positional arguments into a tuple, ** packs extra keyword arguments into a dict, and a bare * enforces keyword-only parameters after it.

Open moment on YouTube ↗
#05
06 ▶ 15:28
What do single _ and double __ mean in _ = 2 and __ = _ + 1 — are they valid variable names?
Live coding Control flow, loops & syntactic sugar
?
Candidate's answer

Mentioned the convention of using _ for throwaway loop variables and correctly identified _ and __ here as valid identifiers holding 2 and 3.

Key takeaway

Underscores like _ and __ are valid Python identifiers; _ conventionally signals an unused value (and holds the last expression in REPL), but behaves like any normal variable.

Open moment on YouTube ↗
#06
07 ▶ 17:08
Is def math_function(*_, **__): valid instead of *args, **kwargs, and do outer _ and __ affect it?
Live coding Functions, scopes & closures
?
Candidate's answer

Correctly explained that args and kwargs are just naming conventions, so *_ and **__ are valid local parameter names that shadow outer _ and __.

Key takeaway

The * and ** prefixes define argument packing; the parameter names themselves are local to the function and shadow outer-scope variables.

Open moment on YouTube ↗
#07
08 ▶ 21:55
What does a function unpacking *args and **kwargs in return produce when called with no keyword arguments?
Live coding Functions, scopes & closures
?
Candidate's answer

Reasoned that an empty kwargs dict causes no error and contributes no items, concluding after a brief prompt that the function returns a tuple of the positional arguments.

Key takeaway

Comma-separated expressions in return (including * unpacking) build a single tuple; unpacking an empty dict with * yields zero elements.

Open moment on YouTube ↗
#08
09 ▶ 24:39
What does the leading asterisk do in print(*math_function(...))?
Live coding Collections, lists, dicts & hash tables
?
Candidate's answer

Admitted he hadn't seen * before a collection, guessing multiplication by 0 or multiplying tuple items to get 1024, before deducing iterable unpacking from the 2 512 output.

Key takeaway

Iterable unpacking with * expands a sequence into separate positional arguments: print(*(2, 512)) calls print(2, 512), printing items separated by spaces.

Open moment on YouTube ↗
#09
10 ▶ 31:38
In what order does 2 ** 3 ** 2 evaluate, and why is the result 512 rather than 64?
Live coding Data types, numbers & memory
?
Candidate's answer

Correctly evaluated right-to-left: first 3 ** 2 = 9, then 2 ** 9 = 512.

Key takeaway

Exponentiation (**) is right-associative in Python, following mathematical convention: a ** b ** c evaluates as a ** (b ** c).

Open moment on YouTube ↗
#10
11 ▶ 33:52
Does the output change if we swap the unpacking order of *args and *kwargs in the return statement?
Live coding Functions, scopes & closures
?
Candidate's answer

Correctly predicted the output stays identical because no key=value arguments were passed, leaving kwargs empty.

Key takeaway

Unpacking an empty **kwargs with * adds zero elements regardless of position; if populated, single-* unpacking on a dict yields its keys in insertion order.

Open moment on YouTube ↗
#11
12 ▶ 36:06
Will the code run if __ = _ + 1 is replaced with __ = -~_ (where _ = 2), and what does ~ do?
Live coding Data types, numbers & memory
?
Candidate's answer

Initially confused ~2 with negative infinity and predicted an error; after seeing the output, recalled ~x == -(x + 1) giving -~2 == 3, but could not explain bitwise inversion.

Key takeaway

Unary ~ is bitwise NOT on integers using two's-complement semantics (~x == -(x + 1)), making -~x equal to x + 1 — a clever obfuscation to avoid in real code.

Open moment on YouTube ↗
#12
13 ▶ 44:45
Why does removing the minus sign (__ = ~_, i.e. -3) keep _ ** __ ** _ equal to 512?
Live coding Data types, numbers & memory
?
Candidate's answer

Clearly explained that __ holds -3, and raising the variable to an even power ((-3) ** 2) still produces +9, keeping 2 ** 9 equal to 512.

Key takeaway

Because -3 is already bound to the variable __, evaluating __ ** 2 computes (-3) ** 2 == 9, unlike the literal expression -3 ** 2 which parses as -(3 ** 2) == -9.

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

In this episode I conduct a mock interview for a Junior Python developer position for Ruslan. Questions and answers without academic style — just how the candidate understands the basics and how he reasons.

Ruslan started learning Python just 3 months ago, so it's quite natural that he doesn't know much yet and may get confused in some details. But I really liked his attitude, calm demeanor in an "interview" and progress: in such a short time he's already navigating the basics quite well, can reason out loud and you can see that he really invests in learning every day.

What's inside:
• unary/binary/ternary operators — what they are and how to distinguish;
• why the same operator (*) behaves differently with numbers, strings and collections: operator overloading, class methods, polymorphism;
• * and **: multiplication, exponentiation, *args and **kwargs;
• small code analysis on screen: unpacking collections through *, operator precedence, reading unfamiliar code and testing hypotheses;
• final feedback: what went well, where are the gaps and how to improve communication in an interview.

If you're preparing for an interview — pause on each question and try to answer yourself, then compare with the candidate's answer.

Support the video with a like and subscribe — this way I'll understand that the format is useful.

Timestamps:

00:00 Greeting and interview plan
00:32 Introduction of participants
03:29 Theoretical questions
14:53 Working with code
49:00 Feedback exchange

#python #junior #interview #programming #pythondeveloper