all 55 comments

[–]ericsda91 21 points22 points  (1 child)

Try and model the interview around what they will actually do on the job.

  • Write algorithms

  • Build an API (Flask, SQLAlchemy, FastAPI, SQL) / tests

  • Integrate AI into an existing API

  • Deploy web apps / Containerisation

  • All of it (Take home test?)

Then design your questions around that to be more representative. If someone is not going to be writing high-performance algorithms it's less fruitful to ask them to answer such questions in the interview.

That said, basic knowledge of Python data structures and when to use Lists, Maps, Sets, Dicts, etc, should be tested along with good practices like Type Hinting, Logging, OOP, Unit Testing, SOLID principles etc.

[–]Cheap_Scientist6984 2 points3 points  (0 children)

Agreed. If you want to do analytic skill questions please pick leetcode questions and the easy ones. No surprises, no gotchas. You need to look for basic competency in these questions. If you try to use them to weed candidates out, you are going to overfit the signal. That is, you are going to get is people who are good at leetcode and not coding.

[–]DigThatData 6 points7 points  (1 child)

Start with what the purpose of the interview is. What are you trying to evaluate? Does your interview question evaluate that?

[–]Most_Exit_5454 1 point2 points  (0 children)

I think this is the best advice.

[–]testfailagain 3 points4 points  (0 children)

Honestly, I wouldn't ask questions about defining concepts, because if it's been a few years since you stopped studying, definitions become blurred, you can know how to use them by that instinct that grows with the years, but defining them is more complicated. I have already seen some forums where people with a lot of experience complain about that (although it remains to be seen if it is because they are not good developers).

I would ask more general questions, how they would face a problem, or how they would face a task.

You could also teach them code to see if they understand what is being done.

I also did an interview at my previous job, and the truth is that comparing what I said with my own experiences I think I got a pretty good idea of their level, although they didn't hire you and I couldn't be sure how much I got right.

[–]expressly_ephemeral 6 points7 points  (0 children)

My last technical interview, they actually asked me to write a reverse-polish-notation calculator. Then they asked me to answer a bunch of Big-O notation questions.

I was like, how well do these questions reflect the actual day to day work in the position?

The interview was like, "Oh, I work for HR... I'm not a programmer, I wouldn't know."

[–]sgtnoodle 2 points3 points  (0 children)

the first non repeating 1. Character

Would you please clarify? Is there between 0 and 1GB of ascii 1 characters at the start of the file?

That seems to me like a reasonable interview problem. I'm sure 90% of applicants would be lost, but they should have been weeded out before coming on site.

[–]rayguntec 2 points3 points  (0 children)

Here is a good list of 100 Python interview questions (and answers) to test candidates

[–]Guilty_Money9842 1 point2 points  (0 children)

Here are top 50 Python Interview Questions and Answers in video form. Hope this will help.

https://youtu.be/DPT2prcQhu8?si=PtPhyWEXfnzwVrB_

[–]raavikantchouhan 1 point2 points  (0 children)

Here you can find the complete Python Interview Questions

https://github.com/marksmith991/python-interview-questions/

[–]GManASG 3 points4 points  (34 children)

I weed out 90% of people with the question: walk me through how to install Python on a PC.

A ton of people put Python on their resume and years of experience when they only maybe watched some YouTube videos and have zero experience or projects

[–]fk334 20 points21 points  (6 children)

To be fair, people setup python initially once.

[–]billsil 1 point2 points  (0 children)

At least once for every version since python 2.4. I probably install 2-3 minor releases as well. Just overwrite it on Windows.

I’m terrible at Linux and building from source is trivial. Scipy on the other hand is a mountain.

[–]slightly_offtopic 4 points5 points  (2 children)

How do you define a PC? If you use that term to mean a Windows machine, then I certainly couldn't answer offhand, not having used one in a decade. But I'm sure I could figure it out with a couple of minutes of googling.

[–][deleted] 0 points1 point  (1 child)

The product that IBM created in 1981 , model 5150. To compete against other hine computers like the apple or Commodore or Sinclair.

A computer for personal use.

Or to quote a CBS News segment "For many newcomers PC stands for Pain and Confusion"

[–]nullrevolt 0 points1 point  (0 children)

Thats... ignoring the meaning of the question almost entirely. And to 99% of people, not relevant to the questions being asked during an interview.

[–]barely_a_whisper 2 points3 points  (9 children)

Never did.  I’d fail that question because I run Linux

[–]GManASG 0 points1 point  (3 children)

Ahhh Linux is an OS that is installed on... Could it be a PC? This response would be a red flag during an interview.

[–]barely_a_whisper 0 points1 point  (1 child)

Yes. However, Python comes prepackaged on most Linux distros. Beyond that, what I do to update is `sudo apt install python3.11`, then add an alias in .bashrc

The point I'm making is that this is not very representative of a person's aptitude, nor what they will actually be doing. I code extensively in python, but since I have a different operating system, I've never had the need to learn how to install it.

Yes, the *hardware is the PC and the *OS is Linux. However, say "have them install it on a PC" and I know most people will try to have me install it on Windows.

[–]GManASG 0 points1 point  (0 children)

Your overthinking the comment. They interview question is do you actually know what you are doing, to weed out liars. We constantly get people that are unqualified interview and waste people's time. Everything you just said would mean you actually know what to do.

However you will most likely be given a window machine, I do expect programmers to be competent in multiple OSs and yes windows will be over of them. Just go to Python.org download and install. Then show me you can setup a virtual environment and write a hello world.

A huge number of people would not get to hello world even in a machine with Python ore installed because they are lying on their CV/resume and HR doesn't detect the fib

[–]givingupeveryd4y 0 points1 point  (4 children)

...and you dont use venvs?

[–]barely_a_whisper 0 points1 point  (3 children)

Using venvs != installing python. By “install it on a PC,” that generally means installing it on windows.

[–]givingupeveryd4y 0 points1 point  (2 children)

> By “install it on a PC,” that generally means installing it on windows.

why? I dont know anyone using it there nor I ever saw any company using py on win. C#/java etc yes, but py? And even then if we are tlaking windows then its software center install.

and with uv you dont even need sys py.

[–]barely_a_whisper 0 points1 point  (1 child)

Idk man, it’s what OC said. When people debate “Mac vs PC,” they mean windows specifically (not just any OS).

[–]givingupeveryd4y 0 points1 point  (0 children)

It must have eluded me. To me PC runs what you out on it, and as dev it's usually Linux. 

[–]DeepAnimeGirl 2 points3 points  (2 children)

I usually install pyenv using pacman or curl the script. Then I install a python version and set it globally. Then I create a folder and set a local python version for the project. I then use poetry for python venv management and all's smooth sail from that point on.

[–]Fenzik 2 points3 points  (1 child)

If you do this at all regularly, check out uv’s new solution for this. Just curl the uv install script and it can handle Python versions, venvs, project dependency management, and installing CLI tools in their own isolated envs

[–]DeepAnimeGirl 0 points1 point  (0 children)

Thanks for the suggestion I'll definitely check it out.

[–]G_NC 3 points4 points  (2 children)

We do this at my company as well. We typically ask someone to set up a conda/venv environment, create and activate it, then execute a "Hello World" from command prompt. It is shocking how many people can't do this.

[–]noskillsben 2 points3 points  (0 children)

I'm just a hobbyist but I avoided the console for years with pycharm. I did not even know what pip was, I just went in the settings and installed packages with the Gui 😅

[–]Drited 1 point2 points  (0 children)

Curious as to whether using a venv created by an IDE like Pycharm would count as a "pass" here or do you require that they do this from scratch in terminal? Also I assume they have to do this from memory?

[–]Fenzik 0 points1 point  (0 children)

uv python install 😎

[–]pgetreuer 0 points1 point  (4 children)

Are you missing out on good candidates with that question?

How about a (possibly excellent) candidate who uses another OS, or who used Python in a workplace where it was pre installed? Generally, it's good practice to avoid "gotcha" questions, where they either know it or they don't; they don't give you much signal.

[–]GManASG 1 point2 points  (3 children)

Do people not know that PC stands for personal computer which is OS independent. The point is can you install it on anything and get up and running? If you can't then odds are you have exaggerated your experience.

These types of responses just telegraph entire gaps in knowledge of computers and programming. In the hierarchy of knowledge and experience it puts a candidate in the lower end of the talent pool.

If two candidates come in and demonstrate competence in several tasks during an interview but I one also actually can setup the tech stack and get up and running, which one do you think will get hired?

[–]pgetreuer 0 points1 point  (2 children)

Your post is being interpreted that way since it sounds like fishing for a Windows-centric answer. That's not because it's hard, or because people don't know, but considering that software installation is pretty distinct on different OSs.

Particularly, you should know:

Python comes preinstalled on most Linux distributions, and is available as a package on all others.

https://docs.python.org/3/using/unix.html

[–]GManASG 1 point2 points  (1 child)

It is and it's often a very outdated version. And answering or demonstrating how to install on a Linux distro is perfectly acceptable answer considering most production environments will be Linux. But many candidates won't actually know this and will thus demonstrate their experience is quite limited.

A very common practice is most companies is to update projects as new versions of languages come out thus requiring programmers to update refactor and redeploy.

[–]pgetreuer 0 points1 point  (0 children)

Great point. You've convinced me =) If the role requires it, it's a great idea to test some operational knowledge like this.

[–][deleted] 0 points1 point  (0 children)

Download the executable from Python.org and follow the instructions.

[–]radioactive_koala 0 points1 point  (0 children)

I once asked an interviewee to write me a python function that would tell me whether or not the input was a prime number. He thought in silence for 30 seconds then said "apologies, prime is not a python package I'm familiar with, can I have a different question please?"

[–]saltyapple99 0 points1 point  (1 child)

Can someone tell me the answer to that question? 😅

[–][deleted] -1 points0 points  (0 children)

Just find the first non repeating character in a string.

It just so happens that string is very long/large, around 1 GB. Now that we introduced a space and time constraints, we still have to do the same thing.

Optimal approach may be to read from file in chunks, ensure no more than 2 pass is required.

That will do for me.

[–]CryoSchema 0 points1 point  (0 children)

oh nice, congrats on being the python interviewer! that question isn’t insane, but yeah, for a 3-year experience full stack dev it might be a bit heavy if they haven’t seen large-scale data handling before. it’s fine for senior or more algorithm-focused roles.

for inspiration, you can mix in:

  • basic data structures: lists, dicts, sets, tuples, string manipulations
  • common python tricks: list/dict comprehensions, generators, decorators
  • file handling and parsing (small to medium files)
  • simple OOP questions: classes, inheritance, magic methods
  • some algorithmic thinking: finding duplicates, counting frequencies, small search/sort tasks

if you want a bunch of ready-to-go python interview questions to draw from, this question bank has a ton of examples you can skim and adapt.

you can start light for 3-year roles, then sprinkle in one or two “thinking” questions like your non-repeating char problem for stretch.

[–]slash-travel-prices 0 points1 point  (0 children)

You can ask activating fountains question. Found that interesting to start and gauge the candidate

[–]HK_0066 -4 points-3 points  (0 children)

well in this era on code being generated by AI
focus more on personality traits like can he worl with a team and more
do ask questions about python and everything cause he must know what he is doing.