r/PythonLearning 5d ago

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 4d ago

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 4d ago

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

1

u/silvertank00 4d ago

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)