TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Guide to Recursion for Coding Interviews

16 pointsby samghabout 6 years ago

2 comments

jim-jim-jimabout 6 years ago
I didn&#x27;t major in cs, but took a 101 level course for fun. It was taught with Python. Never really got the unit on recursion. Made it through the work, but I didn&#x27;t feel comfortable actually using it in any future code.<p>Some time after graduating I bought a used copy of SICP and recursion clicked for me as soon as it was introduced. The parenths, prefix notation, and notion of evaluating expressions rather than returning values just made it seem so much more natural.<p>This is probably an annoying comment since HN already has more than enough Lisp wanking, but I wonder if other students also experienced hangups over recursion because the course&#x27;s language&#x27;s syntax doesn&#x27;t quite facilitate it in the same way.
gabrielblackabout 6 years ago
The example is buggy. In a better version, both the parameter and the returned type should be unsigned. With negative numbers, that don&#x27;t make sense, the program will crash. I don&#x27;t think the interviewer will like it written in that way :-)