Halliburton Interview Question

How would you write a program to do blank.