How to Reverse a String

The only way to get better at solving algorithms and data structures is to power through a few

Jake Zhang
The Startup

--

Can you write a function that reverses an inputted string without using the built-in Array#reverse method?

Let’s look at some examples. So, calling:

reverseString("jake") should return "ekaj".

reverseString("reverseastring") should return "gnirtsaesrever".

This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.

True or False?

In Java, C#, JavaScript, Python and Go, strings are immutable. This means the string object's state can't be changed after creation.

Solution: True

On Interviewer Mindset

--

--