SparklyKoala
SparklyKoala

Stupid question asked in interview.

I was recently called for an interview, and the interviewer asked me a puzzle. It goes something like this:

"You have two containers, C1 and C2, both filled with equal volumes of oil and water, respectively (i.e., C1 -> oil volume V and C2 -> water volume V). A spoonful of liquid is taken from C1 and poured into C2, then a spoonful of liquid is taken from C2 and poured into C1. After these two steps take place, which container will have higher purity (concentration of oil for C1 and that of water for C2)?"

I thought for a while and answered C1, citing that since we put pure oil from C1 into C2 but a mix from C2 into C1, certainly some oil from C2 is back in C1, thereby achieving more purity. The interviewer said it was wrong and asked me to try again. This time, I did some actual math and was told C2 would have a greater concentration based on the calculations. The interviewer again tagged me wrong, so I asked the interviewer to explain, and his answer was that both would be equal since you take 1 spoon of oil from C1 to C2, and put 1 spoon of water from C2 to C1. This is obviously flawed, as no oil is getting back on the spoon when you dip it into C2. I wanted to point that out but didn't. Later, I re-did my math thoroughly and found that C2 would have a greater purity of water.

14mo ago
Talking product sense with Ridhi
9 min AI interview5 questions
Round 1 by Grapevine
TwirlyCupcake
TwirlyCupcake
Gitlab14mo

Use docker, all container problems will be solved.

DancingDonut
DancingDonut

Exactly, after reading the words filled with volume, i have up reading

SparklyBiscuit
SparklyBiscuit
Tekion14mo

They are still asking puzzles. Which profile interview was for?

SparklyKoala
SparklyKoala
Oracle14mo

SDE backend...

GigglyNarwhal
GigglyNarwhal

Lol

ZippyRaccoon
ZippyRaccoon

Have you taken into consideration the fact that oil and water don't mix? Ofc it's still possible to get some amount of both water and oil in the spoon, or just water or just oil, but ig the not mixing part was what was being tested

SparklyKoala
SparklyKoala
Oracle14mo

Yep, in fact I had asked the question to clarify on this assumption, basically got an unclear answer saying that we can consider both cases one by one 🤷🏻‍♂️

ZippyRaccoon
ZippyRaccoon

Then ig the best answer would've been for 3 cases: only water, only oil, both water and oil in the spoon

PerkyWalrus
PerkyWalrus
CARS2414mo

Higher purity of what?? Oil or Water??

This should have been asked as counter

JazzyWalrus
JazzyWalrus

without context i will assume purity means homogeneity

ZippyRaccoon
ZippyRaccoon

It's clearly mentioned concentration of oil for C1 and water for C2. Maybe try reading properly?

BubblyJellybean
BubblyJellybean

It will remain same, assuming oil floats on top of water

SparklyKoala
SparklyKoala
Oracle14mo

Well why? If you dip your spoon from the surface then you're still going to pick some oil in the oil water mixture right?

BubblyJellybean
BubblyJellybean

If you don't keep this problem ideal situation, it's not a problem it's BS, giving sanity by assuming volume of water and oil >>>> volume capacity of spoon

CosmicNarwhal
CosmicNarwhal

The interviewer is correct, the purity in each remains the same. You probably took 100ml as volume for each and transferred 10ml to C2. When transferring back from C2 to C1, need to be careful to reduce volume by 10ml and not 10%.
Try it once, you'll see purity of each will be 100/11%

SquishyBanana
SquishyBanana

from chatgpt---

Let's analyze the situation step by step:

Initial State: Container C1: Oil volume V Container C2: Water volume V Step 1: Take a spoonful of liquid from C1 (which is oil) and pour it into C2. Now, C1 has (V - 1) volume of oil, and C2 has (V + 1) volume of water. Step 2: Take a spoonful of liquid from C2 (which is water) and pour it into C1. Now, C1 has (V - 1 + 1) = V volume of oil, and C2 has (V + 1 - 1) = V volume of water.

After these two steps, both containers return to their original volumes, but the contents have been mixed.

The key point to note is that since the volumes are equal and the liquids are mixed, the concentrations (purity) of oil in C1 and water in C2 are the same. Each container now has a mixture of oil and water in the same proportion as the original contents.

Therefore, after these steps, both containers, C1 and C2, will have the same purity, with the same concentration of oil in C1 and water in C2 as in the initial state.

Discover more
Curated from across
Confessions
by WigglyPenguinSenior Software Engineer

Having some fun with the interviewers

So basically I don't hesitate in challenging the interviewer if I feel like they don't know how to interview a senior candidate

so during many interviews, this is how I have caught them off guard:

  1. The interviewer was asking me t...
Top comments
user

Not sure whether this is something to tom-tom about. Talks more about the quality of interviewer & the approach taken...

user

This show, if you join you are not going to handle things. You’re a type of guy who always want to show, you are...

user

You might be a good tech person but you need to work on ego and attitude. You have a narcissistic personality.

Ask Grapeviners
by GigglyBananaHuman Resources

Got a interview mail from Hike

Hey everyone! I'm about to interview with Hike, and I’m curious to hear about your experiences. If you work there, could you share what the interview process was like? I’d also love to know more about the company culture, pay, and any ot...

Software Engineers
by FloatingLlamaPhonePe

Pattern in Swe interview@ big tech

I am actively giving interviews these days and one common pattern i see for big tech like MSF or WAlmart or golman, tesco Even if you soln is fine and completed you might rejected for Coding problems due to

  • you solved too quickly
  • yo...