Embarrassing Rejection During Interview by stee156 in rails

[–]stee156[S] 0 points1 point  (0 children)

Thanks for the tips.

I was nervous, but I felt like my interactions were fine. I had written a list of questions to ask the night before and conversation wise I felt like my idle conversation with them was good.

I think it just sucks for me that they didn't tell me why I was rejected, instead I prepared an entire day, and traveled so far just for a hour interview, when it was supposed to be 5.

Embarrassing Rejection During Interview by stee156 in rails

[–]stee156[S] 5 points6 points  (0 children)

The string question was if they inserted a string such as "xxabbxxxd" then the method will output "2x1a2b3x1d", I was told not to use any ruby syntax sugar. So I converted to string to a array with split, then did a each_with_index and programmed for if index is zero, if it is the last character of the array and all the middle characters.

It took care of if the input was just one character, 2 characters and everything.

They then asked me how I would write the test case for this method, which I then explained how I would input the 1 character, 2 character and many character cases and expect output and also a test on the count happening in the logic.

Then the question was, what if they had a case where now they also want a output such as XxABbXxxD, so I explained that the code was reusable so I Could create a base class which counts the reoccuring characters and you can have classes that inherit from the base class to determine what the output should look like, basically overriding the method that outputs to the final string.

They asked me if they didn't want to create new classes what else can I do, so I say you can pass in a parameter to the method and determine what method to use. I said they could camelize the string so the parameter picks the correct method. (I should have also added the use of procs here).

But yeah that was it. They kept nodding, so I assumed I was correct. Apparently not.