2 ms·
I flubbed a job interview when asked how I'd implement a factorial. Of course I did the well-known recursive version, but then they asked how I could do it with
by 5teev 15y ago
I flubbed a job interview when asked how I'd implement a factorial. Of course I did the well-known recursive version, but then they asked how I could do it without recursion, and I blanked. I think they wanted me to talk about memoizing and the Y-combinator, but...I don't know, maybe they'd have settled for a naive for-loop.