Novacoast interview question

Write a function that reverses a string of arbitrary size.

Interview Answers

Anonymous

15 Nov 2018

You do this recursively

Anonymous

16 Nov 2018

You can do this recursively, but if you're using python it is as easy as x = "hello world" x = x[::-1] Or if they want it in JavaScript, you can do var x = "hello world" x = x.split().reverse().join(""); Unless they do want you to do it without built-in functions, you can do it recursively or just get the length of the string and loop backwards.