Bending Spoons Interview Question

[coding question] Given a number in base 3, write some functions to apply operations like sum and shift. Then more functions, then with more data at hand optimize the functions.