Everyone interviewing candidates believes they’re Dijkstra.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
A group of researchers was studying how different people solve problems. They gathered a physicist, a mathematician, and an engineer and gave them each a problem: find the volume of a red sphere. The mathematician solves it first. Asked how, he explains that he used a simple formula. The physicist solves it next. Asked how, he explains that he submerged the sphere in water and measured the rise in water level. Hours later, they find the engineer buried in paperwork. Asked about his progress, he says “I can only find a table of values for the volume of blue spheres.”
On further inspection, it was found that the mathematician had assumed an ideal sphere of constant radius, while the real object was in fact oblate. The mathematician had neglected to take any measurements, leading to an incorrect value. The physicist's answer was correct, but only at sea level at nominal temperature.
The engineer is currently using calipers to measure the diameter of the object at many different angles in order to build a CAD model. He said we could expect results next year.
The physicist’s answer would be correct anywhere, no matter the temperature or density of the fluid.
Supposing that the measurements with and without the sphere are taken under identical circumstances. But you deserve the upvote either way.
They later added an Anthropologist, who understood that more questions needed to be asked. His first question was "do you want fries with that?"
If you hand out a problem and only accept one solution out of multiple valid ones, you're part of the problem.
When I interview (experienced) devs, I often ask way too generic questions. Something along the lines of "can you explain what a hash is?", without stating what kind of hash and in what context
The primary goal isn't really to explain it in detail, but to see if they get confused and ask for clarification. Way too many people just start assuming something, when a task is not defined properly. I need coworkers that push back on bullshit, and not blindly implement whatever runs along their desk, no matter how little sense it makes
If I don't hear at least one "it depends" during an interview, I don't have high hopes
I had this with one of my guys. He spent a week working on something and the validation at the end wasn't jiving.
He started showing me the complex solution and end results and so I said show me how you started and walk me through it.
It was step 1 the origin location of data was out of position.
I said if you start at this origin the rest of the numbers and data will work out.
He replied that the origin wasn't shown measured from somewhere, so how would we know location.
So I pointed out that the data to origin wasn't directly spelled out but if you take this measure and subtract this one that is your data origin start.
He said OMG I worked on this for a week trying to get the formulas working. I feel so stupid because you solved it in 1 minute.
I replied its not a question of smart or stupid (because my guy is way beyond me for formulae and programming) its just slowing down and following a process. And if you are confused, ask more questions, rather than just continuing.
Your candidates aren't mind readers though. If you want people to ask clarifying questions, you have to ask them things other than comp sci trivia questions.
I mean I'd probably go super generic and say something like "it's a deterministic function which turns a block of data into a usually smaller block of data, usually for comparing equality to the original block of data" which covers most of the uses?
If you ask a generic question, you're gonna get a broad answer, and if you want to draw clarifying questions, you need to ask a more complex question and provide insufficient information to answer it. Even then, making that question something you can easily look up online, and you either know or you don't, doesn't achieve as much as making the question something that you objectively won't know, and have to learn on the spot, as that shows your ability to learn new things including things you can look up on the Internet.
Hash? Sure I can hook you up.
So, to start off, I'm someone who does not typically perform well during interviews because of anxiety (but through some miracle has had no issues with employment), so take this response with whatever bias that brings.
I believe this is bad too. You're still essentially asking a gotcha question, expecting one phrase in your answer and failing the candidate if you don't hear that phrase. And, in fact, I disagree with the premise. I think the question is defined quite well in the context of programming, given that someone answers with the possibility that there are many ways to hash something and many uses of hashing.
Its not a gotcha question though, is ambiguous to see if you ask for more information or just make assumptions.
We are losing a large account at work because a team provided a solution to a customer based on their initial issues without asking for more info on what the root issue was.
Had they just asked "why are you needing to do this particular thing?" The while solution would have been different.
The only definition of hash that I know is an identifier for an object created from that object's data. Everything else stems from that central idea. What other types of hash are there?
How I look at the algorithm nerd on my team who just wrote code that is tightly coupled across 3 layers of the codebase.
B.S.
Dijkstra would have loved the lookup table solution.
He HATED complexity.
I would say Computer Scientist in place of software engineer.
Yeah, software engineers are the sanitation engineers of programming. Source: am one
Scientists research. Engineers do. We are the more practical of the two.
Ha. I had a convo with a programmer in the 90s. He was explaining a complex problem and the steps to solve in the code, to adjust things based on user choices and parameters.
And I said why wouldn't you presolve all of them and then provide a lookup to go get the solution from a list. And he just looked stunned and walked away.
Reminds me of the first time I saw Sin and Cos lookup tables being used in early 3D gaming. The computers could calculate those just fine, especially with a math co-processor. But for 3D gaming it would be too slow to get a good framerate. So lookup tables were used to greatly improve the speed.
Back on those days all sort of neat tricks like that would be used. Often done as little demo programs that were very impressive. Before the internet it was hard to look up something like that and the latest and greatest tricks weren't written in books yet. So often little code snippets and demo programs would be shared amongst programmers using the sneakernet, so we could all learn and get better.
Trigonometry functions are still just a hardware lookup table in most scenarios I believe. One example I've noticed is that you'll get slightly different sin/cos results on AMD vs Nvidia GPUs due to either different lookup table values, or different interpolation functions being applied on top (I'm not sure it's possible to know for sure exactly which without internal knowledge)
Fun fact, most Tetris clones have a 4D table of all pieces and their rotations. Or multiple user selectable. The actual game generates them (look up "tetris recomp site:github.com").
It really depends on what you're building. In an embedded shop, lookup tables are first class solutions to most problems. Computer scientists though, 100%!
Depends on the available memory and size of the tables. I've worked on cases where time to compute didn't matter as much as shaving off three more bytes did. Large lookup tables would have absolutely killed us compared to running some math.
I expected the bottom to say something like "instead of cloud-native scalable microservices using AI models that cost an average US household salary per day to run", but maybe I've been in corporate for too long.
software engineers met the table¹ in web design and never looked back. does a table "mean" tfoot and all (arranged at top)? thead, that sorts(, by server link without javascript)? a "table" in the web means all sorts of sorty things (i mean even "drag and drop" first should meet with server links that move a row up and down — maybe reveal the "buttons" through tap+hold on the row in CSS, and so on) and offset things, and paginated things, by navigable server links, even hide and filter fields by URI! and the two tables nested for layout, oy vey! so many ways with all that engineering the web fell to the broken manual✨️🤷🏾♂️✨️
¹ (for layout) https://www.w3.org/TR/web-sustainability-guidelines/#progressive-enhancement
When I was a kid and my mother was teaching me to read SQL, she really drove home that Elegance is in the eye of the beholder. While a C++ dev finds beauty in reducing a signal processing step to O(n) by recursing through five lines of bitwise ingenuity, a SQL dev finds radiance in completing the task without using any loops at all.
