Problem
In an AIG PC Global Services mobile workflow, you need a utility function that reverses a string. Given a string s, return 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 behavior: The function must return the reversed string and should handle empty strings, spaces, punctuation, and Unicode characters.
Constraints
- 0 <= len(s) <= 10^5
- s may contain letters, digits, spaces, punctuation, and Unicode characters
- The function should return the reversed string in O(n) time
Function Signature
def reverse_string(s):
Practicing as: Mobile Engineer interview at AIG PC Global ServicesHi, I'll play your AIG PC Global Services interviewer for the Mobile Engineer role. Answer the question above like we're in the room, and I'll respond the way a real interviewer would.
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.


