|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 20 Jan 2010 17:00:45 -0800, Darren New wrote:
> Jim Henderson wrote:
>> That makes more sense - but fairly easy to answer algebraically.
>
> That's why I think the original poster meant to ask the later questions,
> which are somewhat trickier.
Likely, yes.
>>>> And I'm not sure that discarding the length of the track allows the
>>>> question to be answered even then.
>>> No, that would eliminate the ability to answer.
>>
>> How so? If you know the distances and speeds,
>
> Oh, you're discarding the length of the track, but you still know the
> distances?
Wait, what? No, I was saying that the length of the track is a critical
missing piece of information in the original question (the question
specifically states the length doesn't matter - but I believe it does).
> I don't understand, but ... nevermind. :-)
Are we having one of our "we're both saying the same thing" moments
again? ;-)
>>> You want to average 60MPH over two minutes. You go 30MPH for the first
>>> mile. How fast do you have to go to average 60MPH for two minues?
>>>
>>> Second alternate question: you want to average 60 MPH. You drive 10
>>> miles at 30MPH. How many miles do you need to drive at 90MPH to
>>> average 60MPH?
>>
>> I agree, that question formulation would be easier to answer.
>
> Well, except for the first one. And the second one is unobvious, easy to
> fall into a trap.
True.
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Thu, 21 Jan 2010 00:00:38 -0200, nemesis wrote:
> Darren New wrote:
>> Google had a lot of these kinds of questions. Stuff like "how can you
>> determine how big a machine's cache is?"
>>
>> I couldn't figure out if they wanted a program to measure the timing of
>> something assuming different cache sizes and look for the step in the
>> timing, or "look it up in the x86 instruction set manual".
>
> I would just write: "I'd google for it". a bit of butt-kissing can't
> hurt... :D
That wouldn't work so well if you were interviewing at Yahoo. ;-)
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 20 Jan 2010 17:02:16 -0800, Darren New wrote:
> Jim Henderson wrote:
>> Now my brain is going to be busy for the next month..... ;-)
>
> It took me a while, but it became easy once you think about it logically
> and approach the problem systematically.
I have a vague idea of how it could be implemented - but like the
interview I did with a software engineering department years ago (where I
had a similar 'problem solving' type of question to answer during one of
the interviews) translating that into usable code is a skill I haven't
spent a lot of time developing.
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> You have an infinitely long line. Two robots are dropped on parachutes
> onto the line at random, and each drops its parachute (leaving it behind)
> where it lands. Your task is to crash the two robots into each other.
>
> Each robot runs the identical program starting at the beginning, and the
> parachutes are identical, and they are in all ways identical other than
> where they land, which is random.
>
> You have the following instructions available for programming the robots:
>
> Move the robot one step left.
>
> Move the robot one step right.
>
> Move the instruction pointer to a particular instruction (i.e., "goto")
>
> Skip the following instruction if you're standing on a parachute.
Wow that's a good one.
Given that both programs are identical, you'll need to use the fact that the
only difference in the "input" is that one robot has another parachute to
his left, and one has another parachute to his right.
Something like this should work (I think):
(spolier space)
.slow_loop
Move left
Move right
Move left
Skip_next_if_parachute
Goto slow_loop
.fast_loop
Move left
Goto fast_loop
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I agree that some do see useful. I like #19, probably partly because I
> know how I'd answer: "Roughly one per space where a light bulb can be
> fitted to the fixture." (This would allow for some of the fixtures to be
> empty).
Sure, but it doesn't account for the stack of spare bulbs in the
janitor's closet.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Thu, 21 Jan 2010 01:55:13 -0800, Tim Attwood wrote:
>> I agree that some do see useful. I like #19, probably partly because I
>> know how I'd answer: "Roughly one per space where a light bulb can be
>> fitted to the fixture." (This would allow for some of the fixtures to
>> be empty).
>
> Sure, but it doesn't account for the stack of spare bulbs in the
> janitor's closet.
Interesting thought, hadn't thought of that one. :-)
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott wrote:
> Wow that's a good one.
That was fun, wasn't it? :-) It took me a while to come up with the "only
way", and then another moment to figure out I needed the initial
instructions of your first loop (cleverly avoiding spoilers), but once you
see the answer, it all falls together in an "of course that's how you have
to do it" sort of way.
--
Darren New, San Diego CA, USA (PST)
Forget "focus follows mouse." When do
I get "focus follows gaze"?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Thu, 21 Jan 2010 08:50:38 -0800, Darren New wrote:
> scott wrote:
>> Wow that's a good one.
>
> That was fun, wasn't it? :-) It took me a while to come up with the
> "only way", and then another moment to figure out I needed the initial
> instructions of your first loop (cleverly avoiding spoilers), but once
> you see the answer, it all falls together in an "of course that's how
> you have to do it" sort of way.
What was along the way I was thinking as well, after initially realising
I couldn't use variables (my first thought was to do an increasing number
of L/R moves in each iteration, but without a variable to track how many
times to loop, that doesn't work so well).
Jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New wrote:
>
> You have an infinitely long line. Two robots are dropped on parachutes
> onto the line at random, and each drops its parachute (leaving it
> behind) where it lands. Your task is to crash the two robots into each
> other.
>
I like this puzzle. It's one of just a few that quickly go from seeming
impossible to having a nice satisfying solution.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jim Henderson wrote:
> of L/R moves in each iteration,
which also fails because the other robot will move in sync. :-)
--
Darren New, San Diego CA, USA (PST)
Forget "focus follows mouse." When do
I get "focus follows gaze"?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |