Zendesk Interview Question

Reverse String

Interview Answers

Anonymous

Feb 2, 2015

Quick way to reverse a string: walk through the array from each end and swap the characters until you meet in the middle. O(n) time and doesn't require additional storage since its in place.

4

Anonymous

Feb 6, 2019

def my_cool_reverse_function(str) str.reverse end my_cool_reverse_function('why rewrite the wheel?')