News for hackers. Stuff that matters.
Re:Gaming CS Interviews by Eleison23 on Wednesday September 28, 2022 @06:05AM (#33006286)
The first time I encountered a "riddle" type interview question, I'd already held 5+ jobs and I nominally had 8 years' experience in IT.

The job was for a Unix sysadmin job in academia. The interviewer described a room with two lightbulbs in it, and a room down the hall with two switches, and I was supposed to figure out which switch controlled which bulb without going back-and-forth so much.

I was stumped & didn't really know how to proceed, so I just gave up. They hired me anyway. Afterward they explained the answer to me. Start with both bulbs dark; turn on one switch, wait a few minutes, then turn on the other and touch the bulbs. The hot bulb corresponds to the first switch. (This only makes sense in the age of incandescent bulbs.)

I thought it was nice and a clever touch to see whether a candidate can think outside the box, and of course I was grateful to be hired even though I couldn't do so.

Oftentimes I'll report for an interview and it's more like a preliminary onboarding and tour of the premises. Sometimes a company has already made that hire decision before they call you in-person. This might raise a red flag for you, if a company is so desparate to put you at a desk that they don't even make you run the gauntlet, so think about it.

Re:Gaming CS Interviews by Ancalagon on Wednesday September 28, 2022 @01:00PM (#33010299)
Obviously I don't get the question. But, two switches, two lightbulbs, can't you just turn one switch on, leave one switch off, and see which lightbulb is lit? You only interact with each room once. Unless there's some funny business going on?

Edit: oh, the bulbs need to be off at the end? Nah

Re:Gaming CS Interviews by sudosysgen on Wednesday September 28, 2022 @02:46PM (#33011661)
I guess the idea is you turn both on for a while, then turn one off. The hottest one is the one that was recently turned off
Re:Gaming CS Interviews by Ancalagon on Wednesday September 28, 2022 @04:25PM (#33012808)
but then wouldn't one of the switches still be on? therefore one of the lights would be on, so you could correlate which switch was on with the on light?
Re:Gaming CS Interviews by sudosysgen on Thursday September 29, 2022 @10:27AM (#33021114)
You'd turn off the second switch right before entering, so that the bulb associated with it would be hotter.
Re:Gaming CS Interviews by netrap on Wednesday September 28, 2022 @10:34AM (#33008448)
I had this same question on my first IT job interview. Stumped me also... I think now I'd probably do some interview prep next time. I didn't get the job. :-)
Re:Gaming CS Interviews by coltonv on Wednesday September 28, 2022 @11:59AM (#33009484)
Why is the heat thing even necessary? Turn on one switch, walk down, see which light is on, process of elimination for the other one. Am I missing something?
Re:Gaming CS Interviews by lucas_ on Wednesday September 28, 2022 @01:05PM (#33010360)
I remember this version of the riddle:

- 1 light bulb and 3 switches outside. Determine which switch powers the bulb while only entering the room once.

Re:Gaming CS Interviews by Izkata on Wednesday September 28, 2022 @01:26PM (#33010622)
There's also one with 3 switches and 3 bulbs; the solution is the same except you leave the third one on.
Re:Gaming CS Interviews by thallium205 on Wednesday September 28, 2022 @06:13AM (#33006329)
Bulbs nowadays are LED and don't get warm.
Re:Gaming CS Interviews by solardev on Wednesday September 28, 2022 @08:32AM (#33007137)
As an aside, this isn't really true. LEDs are way more efficient (more watts in visible light and not just heat), but not 100% so. They still get warm and need heat sinks and sometimes airflow, etc. or they can still overheat.

If you leave a LED bulb on for a while next to one that's been off, you can definitely feel the heat difference with your bare hands.

This is especially true at the higher end of lumen output, where you're optimizing for peak brightness instead of max efficiency. The power vs brightness curve isn't linear for a given emitter (and the human perception of brightness isn't linear either).

A LED that's twice as bright will be more than twice as hot. If you have a bright headlight it will typically be in metal housing that also doubles as a heat sink, and probably have internal thermo regulation to turn itself down before overheating.

Re:Gaming CS Interviews by mrguyorama on Wednesday September 28, 2022 @05:31PM (#33013545)
It's also the big reason why low price LEDs barely last longer than incandescent did. The LED itself is not burning out, but the heat it generated cooks the capacitor used to generate the correct power output, which dies pretty quickly under heat stress.
Re:Gaming CS Interviews by orlp on Wednesday September 28, 2022 @06:14AM (#33006342)
Nowadays everyone and their mother has a smartphone on them. Place down your smartphone and start recording. Move to the switches and flip them as needed. Check back the recording to provide your answer.
Re:Gaming CS Interviews by supernewton on Wednesday September 28, 2022 @10:23AM (#33008303)
LEDs themselves don't really get warm, but LED bulbs that plug into a wall socket have a transformer in their base to step mains voltage down to something the LED can handle, and that can get quite warm.
Re:Gaming CS Interviews by confidantlake on Wednesday September 28, 2022 @09:28AM (#33007641)
Turn on one. Wait a few years. Turn on the other. The one that is off has burned out so it is the first one.
Re:Gaming CS Interviews by LtWorf on Wednesday September 28, 2022 @09:02AM (#33007392)
You never touched a LED light bulb uh?