Ally Financial Interview Question

Write a function that takes a string and switches the case for each letter. "Hello" becomes "hELLO"

Interview Answer

Anonymous

Feb 12, 2020

I wrote a function that switched the case for each letter. The team wanted me to non-linearly optimize the function (this is just a guess based on their followup questions). I missed a few things, mostly because the performance improvement was minimal and I try to focus on linear optimization in interviews.