Skip to main content

Timeline for Interview coding test: Fizz Buzz

Current License: CC BY-SA 3.0

18 events
when toggle format what by license comment
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Apr 29, 2016 at 3:30 comment added Mathieu Guindon If it's any consolation, the system gives you a [badge:disciplined] for deleting your own answer scoring +3 or higher. You're entirely free to decide whether/when you want to remove this post, that's your decision to make. Cheers!
Apr 29, 2016 at 0:41 comment added Software Engineer Oh, and I'd just like to say, for the sake of being bitchy: "you used a feature that you did not really understand in order to look good"...
Apr 29, 2016 at 0:41 comment added Software Engineer Ok, after further research based on the comments above I agree that this is wrong, so I've removed the accepted answer status and I retract my OMG comment :). The answer's author can decide if the answer is to be deleted or not -- I'd tend to keep it for educational purposes -- code reviews are not always right, which is instructional to everyone.
Apr 29, 2016 at 0:35 vote accept Software Engineer
Apr 29, 2016 at 0:39
Apr 28, 2016 at 16:40 comment added Phrancis @Necreaux I edited your answer to include this comment. I'm not sure if the author of the question will un-accept it or not, but this way at least it's made evident to future readers.
Apr 28, 2016 at 16:38 history edited Phrancis CC BY-SA 3.0
Added detail showing answer is not correct
Apr 28, 2016 at 11:58 comment added Necreaux Looks like I am in fact wrong. The problem, however, is that it took quite a bit of time digging through nitty gritty details of the Java 8 implementation to figure this out. The following give better details than the link @Tunaki provided: stackoverflow.com/questions/29710999/… So what should I do with this answer. It perhaps should be deleted, but makes sense in some respects because this is likely what the reviewer thought.
Apr 28, 2016 at 8:21 comment added Tunaki @EngineerDollery No, this answer is completely wrong. The parallelism will work and the correct result will always be produced. It is guaranteed by the Stream API that the encounter order will be kept when collecting. So your code will work, whether it is parallel or not. Refer here stackoverflow.com/questions/22350288/…
Apr 28, 2016 at 7:19 comment added Dair I have to agree with @Vineet. This answer doesn't seem right. His use of parallelism in the theoretical sense is completely fine. The parallel map can work in parallel. The collect then preserves the order. The major issue with parallel is that it is overkill, and although I have not benchmarked it, I would suspect is slower than the serial version given the machinery needed to use them in the first place.
S Apr 28, 2016 at 7:01 history suggested Insane CC BY-SA 3.0
minor / grammar
Apr 28, 2016 at 4:57 comment added Vineet I don't think that parallelism breaks the order of the output. parallel() simply allows the mapping function to be applied on each i in individual threads, so they needn't wait for each other when executed sequentially. Once mapping is done, all results are collected in input order by the Collector. More details here. Had there been a sysout in the mapping function itself, then the order would be broken.
Apr 28, 2016 at 3:16 review Suggested edits
S Apr 28, 2016 at 7:01
Apr 28, 2016 at 1:54 history edited Necreaux CC BY-SA 3.0
Adjusted tone
Apr 28, 2016 at 0:59 vote accept Software Engineer
Apr 29, 2016 at 0:34
Apr 28, 2016 at 0:58 comment added Software Engineer OMG -- you're right -- the tests are asserting a specific order to the results which is not necessarily present because of the parallel processing of the integer stream. That's a bad mistake, and I do understand parallelism I was just not paying enough attention at the time I believe. Thanks for pointing it out. The stylistic problems I care less about. This and brittle tests are the big problems.
Apr 27, 2016 at 22:53 review First posts
Apr 28, 2016 at 7:02
Apr 27, 2016 at 22:50 history answered Necreaux CC BY-SA 3.0