CareerBuilder Interview Question: Take an input string and outp... | Glassdoor

Interview Question

Software Engineer I Interview Norcross, GA

Take an input string and output the reverse of that string

 . May use any programming language.

Interview Answer

3 Answers


#done in python

myString = "This is a test"

#note: there are two single quotes before .join()

Raul Gil on Sep 14, 2012

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

Jessie on Dec 12, 2012

They won't let you use prebuilt functions like reversed() or strrev(), its not a test of being able to search documentation.

string = 'hello'
reversed_string = string[-1::-1]
print reversed_string

Candice on Jul 23, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.