Westinghouse interview question

Describe algorithms. Walk through code. Explain pros and cons of different solutions.