Meta interview question

General algorithm involving list merging, string pattern, math functions.