# You are given a partially-ordered seque

You are given a partially-ordered sequence of

*n*computer science theory exercises, drawn from*k*books stacked randomly on your desk. Provide an algorithm to solve them all in O(k log n) time before your Google interview on Monday. In parallel your algorithm must entertain your five year old daughter (a rogue process who doesn't respect mutex locks on brain resource allocation) who has just come home with an adorable furry spider toy that she wants to scare you with.Shared with: Public

*This post was originally on Google+*

The second part is a lot harder. My best strategy there would be to use a Ouija board to summon the ghost of Richard Feynman or Martin Gardner, who could certainly explain the problems and solutions to your daughter in a playful way that incorporates the toy spider, thus freeing you to think in peace.

I presume the expected answer is that I

learnthe associated computer science theory, such that my brain can group the exercises into nested categories and solve them in groups recursively. But it would be far more fun togamifythe problems as you suggest, maybe through an augmented-reality phone game, so that my daughter and I can run around and play and learn concurrently, removing the need for the exclusion locks at all. Brilliant!