I was given this coding question in interview:
given a very very large number (say more than long or any in-built types) print out its factorial. you can not assume a max limit anywhere in the program.I had to make a working code on computer and during interview.
I am really curious, how long on average would it take for others?
this is subjective question but an average will set some ballpark figures and a benchmarks for such a coding question.
What I did?
I chose C and represented number by a linked list of characters (containing a single digit). though perhaps it can be made more efficient to store chunks in int/long and do int arithmetic than store it in chunk of characters. I took 2 hours and spat out a code with things in place, major fns coded, but then interviewer said she wanted a completely working one and asked me to do it offline and mail it to her.