Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Reverse Capital One App String

Easy
EasyCodingArraysStringsAsked 1 times

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 s in 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 One

Hi, 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.

Take this as a live interview session →

You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.

Sign up freeI have an account
def solve(rows):
    counts = {}
    for row in rows:
        ...
    return result
Sign up to unlock solutions
Capital One Mobile Engineer Interview Questions
Next questions
Cbre GroupString Reverse Coding TaskEasyBread FinancialReverse a String FunctionEasyAmphenol Borisch TechnologiesReverse a String FunctionEasy