Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
I don't think there's anywhere near enough information here to provide a solution. Production systems do not use random inputs -- they are very carefully and fully specified. Since you did not use BBcode for your post, it is not at all clear from your examples what, if any, manipulations are being done to the input data to create the output data.
Honestly, this sounds more like a homework problem than an interview question -- did the interviewer expect you to reel off a couple hundred lines of COBOL off the top of your head? How would the interviewer know if what you said was correct and solved the problem?
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
If at the time of interview, what you post is the interpretation of the question asked by interviewer - no wonder, giving an answer should have been tough for sure...please rephrase your question; as Robert has asked for, too.