Nimbula Interview Question: Write a function that will re... | Glassdoor

Interview Question

Senior Software Engineer Interview Mountain View, CA

Write a function that will reverse a string in the

  following fashion: Input: "My name is Amanda" Output: "Amanda is name My"

Interview Answer

3 Answers


You reverse the whole string in place and then you reverse the individual words.

Interview Candidate on Mar 17, 2011

" ".join(reversed(i.split()))

Python on Jun 27, 2012

Indeed some things that take quite a bit of work in C are incredibly easy to do in Python.

rumberobueno on Jun 27, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.