IBM Interview Question

Two moderately easy coding questions