Cognizant Interview Question

Two puzzles.