Problem
In the Capital One mobile app, some UI utilities need to display text in reverse order for debugging and formatting checks. Write a function that takes a string s and returns a new string with its characters reversed.
Formal Specification
- Input: A string
s - Output: A string containing the characters of
sin reverse order
Your function should preserve all characters exactly as they appear, including spaces, punctuation, digits, and letter case.
Constraints
- 0 <= len(s) <= 10^5
- s may contain letters, digits, spaces, and punctuation
- The function should return a new reversed string
- Character values must remain unchanged; only their order is reversed
Function Signature
def reverse_string(s):
Practicing as: Mobile Engineer interview at Capital OneHi, I'll play your Capital One 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.


