Earlier this month I was working on a fairly thorny problem for work—taking a total value and splitting it into numbers which summed up to it, possibly including with a rule about what the split-up values had to be a multiple of. E.g. you want to order 50 Buffalo wings, and you have to choose the flavors for the wings in increments of 5. I spent a lot of time thinking about the implementation of the algorithm for that, but I also spent a lot of time thinking about what its API should look l...