CareerBuilder Interview Question

Take an input string and output the reverse of that string. May use any programming language.

Interview Answers

Anonymous

Dec 12, 2012

$string = 'Hello'; echo strrev($string);

2

Anonymous

Jul 23, 2014

They won't let you use prebuilt functions like reversed() or strrev(), its not a test of being able to search documentation. #python2.7 string = 'hello' reversed_string = string[-1::-1] print reversed_string

1

Anonymous

Sep 14, 2012

#done in python myString = "This is a test" ''.join(reversed(myString)) #note: there are two single quotes before .join()