Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
psudo3408yI love this problem, as there are so many ways of solving it. I do think this is still my favorite: https://github.com/EnterpriseQualit...
-
@andalion probably a for loop with 3 if statements checking i%3 and i%5. 9 lines should cover it unless I'm picturing it wrong
-
@andalion yeah it's close to what I was thinking no need to start from 0 in that case though
-
BartBB6898yYou're entirely right... I read it a second time just to see if they forbid use of loops or something...
If so many fail on such an easy task, I must be a genius..
@jckimble -
psudo3408y@BartBB It's more a way to filter out CS students that only took theory classes and never actually wrote real lines of code. Unfortunately it's still possible to get a degree with very little actual coding, so something this simple can serve as a quick check. It's now so famous you're unlikely to see it in an interview.
-
BartBB6898yI see. I, myself, am not a CS student and I had never been interviewed to a company (at least not to work in a software related position) so I do not know what the interviews are like. @psudo
-
@psudo until very recently I was a university teacher and one of my subjects was OOP. After seeing what was covered the year before by the previous tutor I was appalled at the lack of coding and the clear lack of understanding the tutor had. My entire year and class worked on mini projects then one big class project together. They achieved a lot. It is sad some educational establishments allow for such a lack of actual practical work.
Ok I guess I can feel good about myself... didn't use switch though..
undefined
javascript
eloquentjava