LinkedIn Interview Question

give a method signature, implement it in java