IBM interview question

Basic coding questions. Similar to ones you see on leetcode