Problem
In the Zumper mobile app, some text-processing utilities need to reverse user-entered strings. Write a function that takes a string and returns a new string with its characters in reverse order.
Formal Specification
- Input: A single string
s - Output: A string containing the characters of
sin reverse order - Function: Return the reversed string; do not print it
Constraints
- 0 <= len(s) <= 10^5
- s may contain letters, digits, spaces, and punctuation
- The function should return a new string
- Aim for O(n) time
Function Signature
def reverse_string(s):
Practicing as: Mobile Engineer interview at ZumperHi, I'll play your Zumper interviewer for the Mobile Engineer role. Candidates describe these interviews as often stressful and moderately difficult, so expect me to be direct and to the point. Take your time with the question above and answer like we're in the room.
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.


