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.
They later added an Anthropologist, who understood that more questions needed to be asked. His first question was “do you want fries with that?”
Sorry for the stupid question, but doesn’t the rise in water level show the density of an object? Can you measure volume too? What if the sphere floated?
Edit: thanks everyone for helping me understand. I was totally misremembering the story about Archimedes and the crown.
Nope, the rise in water shows exclusively the volume. Density is derived using volume and mass, with mass being measurable by weighing. The only factor density plays directly is indeed floating, but you can just push the sphere under with a thin rod without significantly impacting the measurement.
It’s generally simple - water has some volume, sphere has some volume. Assuming a cylindrical container, the base of the cylinder is known, and the volume of it is equal to the volume of water, which means you can derive the height (or vice versa). If you now add the sphere, the sphere pushes out the water, which means you add the volume of the sphere to the water - and if you measure the height, you can calculate the total volume of water+sphere, and subtract the initial volume of water to isolate the volume of the sphere.
If you fully submerge an object, you displace its VOLUME of water. It will always be the same amount (imagine a bowling ball and a soccer ball). You might need to push it.
When you relate that to its weight, you get the density.
Imagine you have two 1kg lumps of steel. Out of one you make a bowl with thin walls the out of the other a metal ball. Afterwards they still have (about) the same weight, volume and density - as it’s still steel.
But put the bowl onto the basin and with a little luck it will float like a boat *, put in the steel ball it will sink.
But when you put in the bowl sideways without splashing it will displace about the same amount of water than the ball. And it will still weigh 1kg.
*= The thing with floating people remember from school: The floating bowl will displace as much water as it weighs - that’s the thing Archimedes found out. So our 1kg bowl will displace 1kg of water - which is incidentally about 1 liter, because the density of water is about 1kg/l (it was intentionally defined that way, some guys in the French revolution used water to define mass by volume)
attach something to the bottom, pull, fix position
Edit: I am late. kudos for everyone who was faster :)
Density comes into it if we are measuring buoyancy. The weight of the displaced water is equal to the weight of the buoyant object, and the ratio of volume submerged vs above water should give a way to determine density, but I don’t have the precise method in my head right now.
However assuming all you want is the volume, you simply need to fully submerge the object (by applying enough downward force if its density is too low), and the displaced volume is equal to the objects volume. The displaced water will have to flow to the top of the container, so by measuring the rise in water level and multiplying with the base area of your container you can get it easily.
Just make sure you don’t accidentally also measure your hand if you’re pushing down the sphere.
Submerging the sphere gives you the volume. You’re thinking of the legend of Archimedes who measured volume this way and measured mass with an ordinary scale and deduced the density from those two values.
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.
Also, any CompSci grad I’ve worked with couldn’t write code for shit unless they learned how outside of their schooling, and yet so many go the CompSci -> programmer route instead of doing like SW Eng or something like that.
any CompSci grad I’ve worked with couldn’t write code for shit
Damn, that sounds pretty bad.
We had tons of math and theoretical work too, but we also programmed a fair amount: We had to write a renderer in one class, a compiler in another, various Android apps in a third, and in one elective I took we wrote a micro kernel OS as well.
Red thinks you’re making up words

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.
Ah my prior manager suggested something similar… Dynamic views that would adjust based on user set parameters… We set up canned views and called it a day.
He was let go, but always pushed for the art of the possible (even if it would take a few extra sprints to wrap)
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”).
B.S.
Dijkstra would have loved the lookup table solution.
He HATED complexity.
Everyone interviewing candidates believes they’re Dijkstra.
disappointing. no such algorithm.
yeah I looked it up
Good news, you can invent it!
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
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 thinks that’s the whole point, they can’t read minds so they need to ask questions to gain information. So you can makean better response.
When I’ve done support and customer says “This isn’t working I need this bug reported”
The first question I ask is “Why do you need to do that?”
Because just fixing what they asked solves their current issue, but not the underlying pain they have in their process.
100s of techs would just solve the bug, but they you never find out the deeper issue or lack of features that push the customer to using the other thing.
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.
The point is that in a real software engineering process, specs and requirements are rarely defined precisely from the start, and the programmer should be able to identify the gaps and clarify them. A generic answer doesn’t help as much as a clarifying question.
A common but amateur mistake is to just make assumptions about how something should work and then forge ahead. As a programmer in a company, you are building things for somebody else (your boss, your client), so you need to ask them first.
Sure but as I said, that’s a knowledge question and not an engineering problem to solve. They’re very different and unless you work in software consulting, you’re not gonna get a problem that looks remotely like that from a client.
You actually get them all the time, because the programmer is more deeply knowledgeable about the features they wrote and can identify gaps better.
Boss: “Can we move the widget to the left side of the page?”
Programmer: “Sure but that means when the sidebar opens it will obscure the widget, making it hard to see both at the same time. Do we want that?”
Boss: “Hmm I didn’t consider that. Let me ask the UX team what they think.”
“Can we move the widget to the left side of the page” is not in the same category as “what is a hash” though?
I don’t think the “what is a hash” question was a great example, but paired with the rest of the comment and context, I understood their point
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.
The hash question is just something from the top of my head. I normally fit it to the situation.
I absolutely take nervousness into account, as I can relate to it.
The thing is, I need to know if the person can push back in some way. it’s a hard thing to do in interviews, but also the first point for me to check how a person reacts
I’ve been bitten too many times, with dev coworkers who don’t give at least a little resistance when vague or stupid tasks show up. Only to notice hours or days later, when something was done completely the wrong way
Sounds like you need to fire the person handing out vague and undefined tasks to everyone 😂
Listen up every client ever, I’m sorry but I’ll have to let you go.
Every task starts out as a vague idea that, at some point, needs to be narrowed down to something specific and actionable.
If you’re at a sufficiently large organization and you get lucky, that happens before it makes it to a developer. For the rest of us, it’s an important skill to be able to take a task, ask clarifying questions, and narrow it down to something actionable.
Well, he did say ”push back on bullshit” soo congrats? 🤭
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?
I smoked some on the way in here to make interviewing more tolerable
I had a can of it and made some Reuben sandwiches.
Yeah, it’s basically that, but it has different uses - two main things I can think of right away are 1) verifying data when downloading large files and 2) cryptography (e.g. when storing credentials). Oh, and hash tables too.
Hash? Sure I can hook you up.
Fair point, but depending on the interviewee, you might get very different answers and/or follow up questions.
Even if they assume something, it might be just for the sake of the example. If they’re competent, they’ll follow up with another example and so on, depending on how exactly you pose the problem.
If you present it as an abstract question, one possibility is that you get an abstract answer. If you present it like a ticket with no description, you might get prompted to clarify.
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.
Related sidenote: I don’t think I have any form of tism, but something activates when people ask computer science terms where my terrible memory goes “oh yeah I remember the dictionary definition perfectly, punctuations included, let’s recite!”
Also I love the hash exampple. If they start talking about checksums and whatnot, you know their hobby lmao.
If you want something to blindly implement a vague task by making a ton of assumptions, just use AI.
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%!
IIRC, Elite used lookup tables for trigonometric functions on certain target platforms (maybe the NES) because memory wasn’t as much of a constraint as computing performance. It’s a barrel of game compressed into a pint of code.
Your MOM is marginally optimal, nerd!
Hah, gottem.
It’s either “gotcha” or “got 'im”.
Nope. You’re wrong.
There is no such word as “gottem”. This is a recent bowel movement from ignorant people. “Gotcha” has been around for generations, and the use of the apostrophe is quite simple.
Gottem.
holy shit.
you might be the biggest fucking nerd ever for being so thoroughly “em” who just got “gott”
hahaha gottem
(no but seriously dictionaries are descriptive not prescriptive; they add new words as the language evolves. if you were correct about new implementation of the language being “bowel movements from ignorant people” then you should be speaking Shakespearean English as that is Proper English™. the language wasn’t finished changing when you stopped going to school, pal. I’d recommend you research linguistics as it seems you have a weak grasp on the concept and it’s bringing your nerd card into question.)
Talk to a linguist about how languages evolve.
Gotcha addresses the person you’re talking to, gottem is used to address a real or fictional audience, highlighting for them what you did.
Okay. So it’s not a word. That’s fine. The popular expression in this context is indeed “gottem” and it doesn’t matter if you think that’s a word or not, that’s just objective reality. Suck it, nerd.
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.
Alright to anyone who would question this statement. I am a mom, and have had extremely similar conversations with my kid regarding programming and perspectives.
Seriously it’s important for problem solving to not get caught up in perfect solutions or solutions you think are the right path be cause of your own bias’.
Sometimes to solve a problem you are stuck on, or is proving too challenging the best course of action is to figure out why you are trying to solve it that way, and what other solutions there might be.
When I was a kid and my mother was teaching me to read SQL
Why would a mother do this, I’m horrified
In the case of my mother, she’s pretty autistic and a very well known data scientist. This was her way of teaching me how she relates to the world - I’m quite grateful to her for it; it has given me a love of programming and allowed me get a great deal closer with her.
My mom taught me ORM. I’d rather have had the SQL mom.

I am torn between this and “AAA videogames should be optimized more.”
How I look at the algorithm nerd on my team who just wrote code that is tightly coupled across 3 layers of the codebase.
New shortest path meta dropped










