Re: PHP Interview questions

From: Date: Tue, 26 Aug 2003 18:35:48 +0000
Subject: Re: PHP Interview questions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-160836@lists.php.net to get a copy of this message
* Thus wrote Richard Baskett (php@baskettcase.com): > on 8/26/03 9:57 AM, Robert Cummings at robert@wocmud.org wrote: > > > This smells like a trick question... Are the switches connected to the > > same light bulb? You've only mentioned one light bulb? 8) > > > > Cheers, > > Rob. > > > > > > On Tue, 2003-08-26 at 12:35, Jay Blanchard wrote: > >> Also ask a couple of other questions that require thought, but have > >> nothing else to do with code. such as... > >> > >> In one room you have 3 light switches, each connected to one light bulb > >> in another room. How many trips must you make to determine which switch > >> is connected to which light bulb? > > Only one trip, and Im not sure if I should explain or let you guys figure it > out :) toggle_light(1); sleep(120); toggle_light(1); toggle_light(2); move('self', 'room/'); if ($lightbulb['temp'] > $room['temp']) { echo "switch #1"; } elseif ($lightbulb['ison']) { echo "switch #2"; } else { echo "switch #3"; } hm.. i had to keep it OT somehow :) Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#160836) next »