CareerBuilder interview question

Question #1 sent over email: Given a string, write a function or method that takes in that string, and returns the same string in reverse order. · Example: Given the string “Hello”, your program would return “olleH” · Do not assume that “Hello” is the only string it will handle

Interview Answer

Anonymous

23 Nov 2016

I guess it is pretty straight forward in python def reverse_string(string): return string[ : :-1] print(reverse_string("Hello"))