Wise Interview Question

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