IBM interview question

2 easy to medium coding questions