Philips Interview Question

a couple of small coding questions