FastPrepReverse a String
Problems/Reverse a String

Reverse a String

IndiaMART logoIndiaMART● EasyONSITE INTERVIEW

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Source note: This problem is backed by a real IndiaMART onsite interview report. The report directly named string reversal, but it did not include the exact function interface, examples, or constraints. The core task match is about 95%.

Given a string s, return a new string containing the same characters in reverse order.

Character case and all non-letter characters must be preserved.

Function

reverseString(s: String) → String

Examples

Example 1

s = "FastPrep"return = "perPtsaF"

Reading the input from right to left produces perPtsaF.

Example 2

s = "hello"return = "olleh"

Similar questions at other companies

  • Longest Spoken PrefixElevenLabs · ONSITE INTERVIEWElevenLabs interview questions
  • Palindrome Check Ignoring SymbolsWalmart · ONSITE INTERVIEWWalmart interview questions
  • Reverse a String Keeping Dashes in PlaceNykaa · ONSITE INTERVIEWNykaa interview questions
  • Reverse Vowels of a StringGoogle · ONSITE INTERVIEWGoogle interview questions
  • Valid Palindrome After NormalizationKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Count Binary SubstringsDocuSign · ONSITE INTERVIEWDocuSign interview questions
  • Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • Palindrome Match PercentageApple · ONSITE INTERVIEWApple interview questions
  • Reverse A StringNVIDIA · ONSITE INTERVIEWNVIDIA interview questions
  • Validate a Word AbbreviationSalesforce · ONSITE INTERVIEWSalesforce interview questions
See IndiaMART hiring insights
Saved
class Solution {
    public String reverseString(String s) {
      // write your code here
    }
}
Checking account…