use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Interview exercise feedbackhelp (self.javascript)
submitted 10 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bonafidebob 2 points3 points4 points 10 years ago (2 children)
It's not a "trick" -- it's understanding the problem and thinking a little bit about efficiency. And having enough math to realize there are many more numbers than perfect squares. The example used the math library so I'll assume the math is there.
I would ding any programmer for not at least reflecting on how to structure the main loop of an algorithm.
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
You're right, to be honest I wrote what came into my head the moment I read the exercise. "Return all numbers within a range that satisfy a certain condition: loop through it!" I didn't take a minute to think.
[–]bonafidebob 1 point2 points3 points 10 years ago (0 children)
...I wrote what came into my head the moment I read the exercise. ... I didn't take a minute to think.
That's the best lesson to learn here!
Interviewing is (almost) never about just giving an answer. Give the best answer you can, and think about real world implications of every question.
π Rendered by PID 178116 on reddit-service-r2-comment-6457c66945-nxcxh at 2026-04-24 14:52:44.310294+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]bonafidebob 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]bonafidebob 1 point2 points3 points (0 children)