Motorola Mobility Interview Question

some pseudocode coding