You can make use of char
static methods to do a lot of the work for you. Also, there's no need to memorize the ASCII values of vowels. Just use the vowels themselves.
static string Problem(string arg){ if (arg == null) return null; char[] vowels = "aeiouAEIOU".ToCharArray(); StringBuilder result = new StringBuilder(); for (int i = arg.Length - 1; i >= 0; i--) { char ch = arg[i]; if (vowels.Contains(ch)) result.Append(char.ToUpper(ch)); else result.Append(char.ToLower(ch)); } return result.ToString();}
This solution relies on the assumption that we're working with English. It's a good idea in interviews to clarify the question so that you don't have to make assumptions. Since this was a test, you may not have had the opportunity to ask questions. In that case, simply state your assumptions in code comments.