MiQ interview question

Algorithms, Java ,oop , puzzles