Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Reverse Characters in a String

Easy
EasyCodingRecursionArraysStringsTwo PointersAsked 4 times

Problem

At Slack, a text utility needs to reverse user-provided strings for formatting tests. Write a function that takes a string and returns a new string with its characters in reverse order.

Formal Specification

  • Input: A string s
  • Output: A string containing the characters of s in reverse order

Your solution should handle letters, digits, spaces, punctuation, and Unicode characters as regular characters.

Constraints

  • 0 <= len(s) <= 10^5
  • s may contain letters, digits, spaces, punctuation, and Unicode characters
  • The function must return a new reversed string

Function Signature

def reverse_string(s):
Practicing as: Mobile Engineer interview at IDEO

Hi, I'll play your IDEO interviewer for the Mobile Engineer role. Candidates describe these interviews as mostly positive and moderately difficult, so expect me to be friendly and conversational. Take your time with the question above and answer like we're in the room.

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
Skillshare Mobile Engineer Interview QuestionsIDEO Mobile Engineer Interview QuestionsEverlight Solar Mobile Engineer Interview QuestionsTech Mahindra Mobile Engineer Interview QuestionsTop 50 Two Pointers Interview Questions
Next questions
SpeechifyReverse String Without HelpersEasyAppleReverse String In PlaceEasyBae Systems UsaReverse String In PlaceEasy