FastPrepReverse an ASCII String
Problems/Reverse an ASCII String

Reverse an ASCII String

Squarepoint Capital logoSquarepoint Capital● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Squarepoint Capital new-grad phone screen. The task of reversing a string, and the focus on clean, safe C code, come from the report. Here we use printable ASCII and return a string. We do not test memory safety in native C. Our version is about 80% the same as the reported question for the values it returns.

Return text with its characters in reverse order.

For this exercise, assume the input contains printable ASCII characters. Reverse every character, including spaces and punctuation. An empty string stays empty.

Function

reverseText(text: String) → String

Examples

Example 1

text = "code"return = "edoc"

The characters c, o, d, e become e, d, o, c.

Example 2

text = ""return = ""

There are no characters to reorder.

Example 3

text = "ab cd!"return = "!dc ba"

Reading the six characters from right to left gives !, d, c, space, b, a.

Constraints

  • 0 <= text.length <= 50000.
  • Every character has an ASCII code from 32 through 126.

More Squarepoint Capital Phone Screen questions

  • Newton Square Root to a Guaranteed TolerancePHONE SCREEN · Seen Nov 2026
  • Probability of Consecutive HeadsPHONE SCREEN · Seen Nov 2026
  • Three Points in a Semicircle: Monte Carlo EstimatePHONE SCREEN · Seen Nov 2026
  • Combine Two Index SequencesPHONE SCREEN · Seen Aug 2026
  • Parse, Normalize, and Combine PolynomialsPHONE SCREEN · Seen Aug 2026
  • Sorted Insertion SnapshotsPHONE SCREEN · Seen Aug 2026
  • Strong and Weak Reference LifecyclePHONE SCREEN · Seen Aug 2026
  • Target Sum Across Two Sorted ArraysPHONE SCREEN · Seen Aug 2026
  • Classify Heap Addresses from a Memory SnapshotPHONE SCREEN · Seen Nov 2025
  • Fixed Worker Pool with a Shared QueuePHONE SCREEN · Seen Nov 2025

Similar questions at other companies

  • Check if a String Is a PalindromeCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Reverse a StringAmazon · PHONE SCREEN
  • Reverse a String ManuallyNewgen Software · PHONE SCREEN
  • Reverse a String with Two PointersSnowflake · PHONE SCREENSnowflake interview questions
  • Palindrome with One DeletionWhatNot · PHONE SCREENWhatNot interview questions
  • Valid Word AbbreviationMeta · PHONE SCREENMeta interview questions
  • Reverse a StringPersistent Systems · PHONE SCREEN
  • Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • Valid Palindrome IIBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions

Interview reports that mention this question

  • Squarepoint Campus SDE Interviews: 7 Experiences (Part 2 of 2)

Squarepoint Capital interview experiences

  • Squarepoint Capital C++ and Python SWE Interviews: 7 Experiences
  • Squarepoint Capital New Grad SDE OA: 5 Experiences (Part 1 of 2)
All Squarepoint Capital interview questionsSee Squarepoint Capital hiring insights
Saved
class Solution {
    public String reverseText(String text) {
        // write your code here
    }
}
Checking account…