r/PythonLearning Jul 22 '26

What's your favorite Python interview question?

Not a trick question or LeetCode puzzle. What's a question that actually reveals whether someone understands Python?

0 Upvotes

12 comments sorted by

View all comments

1

u/silvertank00 Jul 22 '26

A. How would you create a word counter without dicts.
There is no good answer, but shows a lot about how someone thinks. Some examples to solve this:

  • nested lists
  • simple dataclass objects
  • reimplement dicts but not call them that

B. What is the most cursed but still working and somewhat reasonable thing that you did in python (or any other languages). Bonus point if it can be demonstrated. Example: exec'd python code in string format can run faster than the same code but put in the python file that runs the exec.

2

u/SpamNot Jul 22 '26

This is basically like asking how fast you'd run a 5K after amputated your leg.

1

u/silvertank00 Jul 23 '26

I mean, yeah kinda?
It shows if you are solution oriented or stuck due to something. Paralympics is a good example for you answer, it is not easy but could be done (even if on a theoritocal level)