6 ms·
An integer formula for Fibonacci numbers (2015)
- grenoire 8y agoNow you're really gonna' piss the interviewers off! http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/
- tobyhinloopen 8y agoNeat text. I'd be really impressed if I were to interview him, but then again: I'd never ask someone to write a fizzbuzz... hmmm... Edit: I actually tried a FizzBuzz myself and I actually like it. I get why people were to ask it at interviews since it does require you to think for a second (if you haven't done it before) so you can easily filter out people who can't think
- aldanor 8y agoIndeed, what's the point to ask someone to write a fizzbuzz when it's already been done to the highest of professional enterprise standards! [1] [1] https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- philbarr 8y agoHighest professional enterprise standards my arse. Where's the message queues? Why isn't there a Fizz microservice and a Buzz microservice that live behind an API Gateway and receive messages from an event driven architecture?
- jedimastert 8y agoI'm gonna need a write up. I've been looking at the code for 10 or 15 minutes and I still haven't found "fizz", "buzz", or the number 100 anywhere in the code. It's amazing.
- Aardwolf 8y agoFound it!! https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/blob/f98ec95911ed319809e915754c872f90dc194408/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/Constants.java https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- conistonwater 8y agoI have no idea either, but those are "constants", and so it is only logical that they belong in com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.Constants (https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/blob/f98ec95911ed319809e915754c872f90dc194408/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/Constants.java https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...).
- Sharlin 8y agoI think it’s really shortsighted to hardcode them statically into constants. You’d have to build a completely new binary should the requirements someday change! Obviously they belong behind a configuration interface, an instance of which can then be dependency injected to places that need them. In this way you can easily supply them from whatever source you like, such as a properties file, XML document, a database or even a web service. As it is now, 2/10 would not pass review.
- oweiler 8y agoSounds like Spring ConfigurationProperties https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-typesafe-configuration-properties https://docs.spring.io/spring-boot/docs/current/reference/ht...
- Sharlin 8y agoI'm utterly unsurprised.
- ConcernedCoder 8y agoIsEvenlyDivisibleStrategyFactory.java ... now I remember why I hate java.
- zaptheimpaler 8y agoNeeds more AWS Lambda, this is outdated.
- IshKebab 8y agoIt doesn't require you to think - it makes you think there is an elegant solution but there isn't really. I suspect you've done it wrong.
- arethuza 8y agoMany many years ago I did a project building a functional programming language that macro expanded into lambda calculus that was then compiled down to SK combinators for evaluation. This was entertainingly inefficient. I'm tempted to resurrect the code (I still have a printout) and use it to implement Fizz Buzz....
- jedimastert 8y agoYou could take a look at what this guy[1] did. It was a great read for me as a real beginner in lambda calculus. [1]: https://www.jtolio.com/2017/03/whiteboard-problems-in-pure-lambda-calculus/ https://www.jtolio.com/2017/03/whiteboard-problems-in-pure-l...
- OscarCunningham 8y agoDiscussion on Reddit: https://www.reddit.com/r/math/comments/910dlj/an_integer_formula_for_fibonacci_numbers/?st=jjy6qdya&sh=15775854 https://www.reddit.com/r/math/comments/910dlj/an_integer_for...
- nayuki 8y agoAnother article on the HN front page also talks about computing Fibonacci numbers quickly. "Automatic Algorithms Optimization via Fast Matrix Exponentiation (2015)" ; https://news.ycombinator.com/item?id=17592359 https://news.ycombinator.com/item?id=17592359 ; https://kukuruku.co/post/automatic-algorithms-optimization-via-fast-matrix-exponentiation/ https://kukuruku.co/post/automatic-algorithms-optimization-v...
- wnissen 8y agoStill looking at the formula and puffing my cheeks out in disbelief. Every time I read it again it seems weirder. Bitwise and?
- user2994cb 8y agoPrevious discussion: https://news.ycombinator.com/item?id=11560122 https://news.ycombinator.com/item?id=11560122 and Paul Hankin has some more thoughts on the subject: https://blog.paulhankin.net/fibonacci2/ https://blog.paulhankin.net/fibonacci2/