IBM Interview Question

Simple coding questions from hackerrank.