Ad
  • Custom User Avatar

    Not allowed to use #rotate or #reverse for my upcoming interview assessment, so I'm doing all method manually.

  • Custom User Avatar

    Okay! So would some code that would catch the ValueError be (in Ruby):

    raise ValueError if int > arr.size

    In my coding program there's a huge emphasis on understanding the whole problem before attemping it, instead of hack/slash coding. My problem isn't super complex, it's closer to 7 kyu than 6, really. The more problems cause people to go back and re-read after they've completed a solution to implement some fix, the more that people will slow down and really think about each step of the problem before tearing into it.

    Okay, I'll republish the kata once it's all corrected and hope for the best. :)

  • Custom User Avatar

    Okay! That's clear on what I should ask from them, but what value is being returned when they raise an Exception?

    I meant that just that for people at or near my level of problem solving ability (6 to 5 kyu), I think we may rush into solving a problem if we can see a probable solution right off the bat. Adding another layer of complexity, like returning the middle value of the new array, may add just a little more challenge and cause us to slow down and think about the problem harder. In hindsight, the different return value of this one seems a little contrived.

    I'm making a random test case method now, but since this is already retired can it be re-published with all the corrections I'm making?

  • Custom User Avatar

    You make some great points, especially about if the array is holding the string 'Integer is too large'.
    Thank you for the feedback! I'm editing now.

    Since I'm new to this, what would be considered a good practice exception? Just returning the middle integer as it is, no reversing, if the integer is larger than the size of array?

    I moreso put the requirement to return the middle value from the array just as a reading comprehension check, to make sure that people read the problem well in creating pseudocode.

  • Custom User Avatar

    Thank you for pointing this out. Currently looking up how to make random tests. If you have any guides to pass along, I'd love any help.

  • Custom User Avatar

    Thank you for the feedback. I think I'll remove that part from the problem. No need to restrain people!

  • Custom User Avatar
  • Custom User Avatar

    Thank you so much, Chrono! I really appreciate the help. :) Have a great night!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution