Wise interview question

Implement some common functional programming primitives like map, reduce and take using loops. Implement the circuit breaker pattern.