IBM Interview Question

An algorithm question involving counting the a pattern of numbers in an array forwards and backwards