FastPrepReverse a String Manually
Problems/Reverse a String Manually

Reverse a String Manually

Newgen Software logoNewgen Software● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in the first technical round of a Newgen Software phone screen. One task was to reverse a string yourself, without a built-in reverse function.

The report gives no input limits, character set or examples. Here the string has at most 2000 printable ASCII characters. An empty string stays empty. You return the reversed string instead of printing it.

Our version is about 90% the same as the reported question.

Given a string s, return its characters in reverse order. Implement the reversal manually without calling a built-in string or collection reversal operation.

Preserve every character, including spaces, punctuation, and letter case. The empty string reverses to the empty string.

Function

reverseString(s: String) → String

Examples

Example 1

s = "FastPrep"return = "perPtsaF"

Reading the eight characters from right to left gives perPtsaF.

Example 2

s = "a b!"return = "!b a"

The exclamation mark moves first and the space remains between b and a.

Constraints

  • 0 <= s.length <= 2000.
  • Every character is printable ASCII (code 32 through 126).

More Newgen Software interview questions

  • Employees Who Joined More Than a Week AgoPHONE SCREEN · Seen Oct 2026
  • List the Key and Value of Every Map EntryONSITE INTERVIEW · Seen Oct 2026

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 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
  • Reverse String In PlaceThe Walt Disney Company · OA · PHONE SCREENThe Walt Disney Company interview questions
See Newgen Software hiring insights
Saved
class Solution {
    public String reverseString(String s) {
        // Write your code here
    }
}
Checking account…