this post was submitted on 06 Feb 2025
21 points (100.0% liked)
CSCareerQuestions
1047 readers
43 users here now
A community to ask questions about the tech industry!
Rules/Guidelines
- Follow the programming.dev site rules
- Please only post questions here, not articles to avoid the discussion being about the article instead of the question
Related Communities
- [email protected] - a general programming community
- [email protected] - general question community
- [email protected] - for questions targeted towards experienced developers
Credits
Icon base by Skoll under CC BY 3.0 with modifications to add a gradient
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Interviewing is a skill in itself, and one that you can practice. I would encourage you to apply for all sorts of positions you don't actually want just for the experience.
Sometimes, these questions aren't meant to get an accurate answer. They're meant to see how you approach an issue, especially under pressure. I've seen people print out multiple pages of indecipherable code and ask a candidate "what does this code do?". Of course, if you can answer it correctly you're hired, but no one realistically can. But they can watch how you break down code you've never seen, in an unfamiliar environment, to piece it together.
Sometimes the questions are meant to call a bluff, or reveal a know-it-all. In a good interview, you'll flat out say "I have no idea" a couple of times. But you'll follow it up with details on how you would handle it. For instance, I've never heard of a dict in Python until now, so I googled it. It seems they're the same as key-value pairs that are common in other languages.
They will never find a perfect candidate. The question in their minds is whether you're close enough and can be trained.
The way Python is implemented, almost all objects in the language are dicts and can be accessed with the
__dict__
dunder. Which has some useful applications when transforming data.But in the case, the interviewer was likely looking for knowledge that one is structured and maintained by indicies vs defined keys. And that searching through a dictionary is O[1] vs list that is O[N] but are inverted for deletion. So if you are doing a lot of inserts and seaeching, use a dict, but if you have something that has tons of deletions, use a list. However, there's tricks to improve the deletion speed downside that can be used with a slight memory tradeoff.