Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I was doing this kata in JavaScript, and I believe the test that initially failed and then passed dealt with backstage passes. Unfortunately, I do not recall the input or output, as I was expecting to see that failed test a second time and didn't note it.
In reference to giving the kata an "interview feel", I have had several interviews like this and am generally told that the purpose of the question is not only to see how the candidate solves the problem but how he/she interacts with the team/individual asking the question. These tend to be "social" or "culture" type questions, rather than hammer-at-it-until-it-breaks type questions. Generally, the purpose is to work collaboratively with those asking the question - which is not possible in this format.
Hi,
I enjoyed the Kata, but wanted to raise an issue. Since the tests are random, it is possible that an incorrect solution will be accepted and appear in the solved answers portion. I had an answer that came up with a failed test and resubmitted my answer to see if other tests would fail when it came up passing all tests. I then attempted to rerun it but all the tests passed and my answer was accepted. Rather than offering randomized tests, you should make sure your tests cover all acceptance criteria. The purpose of a kata isn't to trick the participant or show that you can be more clever. The instructions should be clear and the tests should be complete and consistent. To that end, as a native English speaker and a linguist, I agree that the use of "the quality of an item can never be negative or increase beyond 50" is ambiguous, as it doesn't address what should happen if the value is already above 50. The instructions do imply that the value cannot exceed 50 - particularly since this is supposed to be a replacement for the existing store management system, which should have also followed these rules. As it is written, it is hard to imagine anyone successfully completing this kata without receiving feedback from the test results. Thanks!
Hi xcthulhu, I don't know if you've noticed but there are several cheating solutions under JavaScript and Python. Thanks.
Fortunately, the author of that kata has fixed the tests.
Thanks!
I'd like to suggest that those developing kata throw in a random number in tests that return numbers. I just came across a solution in Least Common Multiple (JavaScript) where a user created an array of the answers and popped them on each test case. We can avoid that sort of cheat through randomly generated test cases. BTW, that user is currently ranked #201!
My 2 cents: ban the f#@kers!
Wow! That's ballsy!
Try using this test case:
It's ugly, but it's darn fast for large numbers :-)
OK, this has gotten ridiculous! I just failed a test with:
function add2(x,y) { return x+y; } ; add2_ = defaultArguments(add,{y:9})
For the love of God, add doesn't take a y, so why is NaN wrong for add2_(10)?!?
This comment is hidden because it contains spoiler information about the solution