Tech Interview

Dave’s on Fire

dave winer is stuck on a deserted island, with lots of trees, which is very thin and ten miles long (east to west). large cliffs surround the entire island and if he jumped off, he wouldn’t survive the fall. a fire starts burning at the west side of the island. unfortunately this island always has a west to east blowing wind blowing at 2mph and this moves the fire slowly toward dave at 1mph. (so he only has ten hours left). save dave (or maybe, let him burn :-) ! what to do?

Solution

someone suggested he could dig a pit across the island to act as a firebreak. good suggestion, if he had a shovel and the ground wasn’t too hard.

but even if he didn’t have a shovel, he could pick up a branch and run up to the fire and light the branch. then run all the way to the eastern edge of the island, but stop about a mile short. there he could light all those trees on fire and they would start burning and the fire would move east. it would consume all that vegetation in an hour, and then dave could wait for awhile for that part to cool down some. when the initial fire reached him, he could just run into the already burnt part, and the fire couldn’t get him.

T = tree
D = dave
B = burnt
 
top view
==========================
| fire-> T T T T T T T D |
==========================
 
dave gets branch and lights it from fire
==========================
| fire-> D T T T T T T T |
==========================
 
dave lights trees farther east on the island
==========================
| fire-> T T T T D fire->|
==========================
 
dave waits until second fire cools, and then hides out there
==========================
| B B B fire-> T T B B D |
==========================

dave is saved!

Exit mobile version