VMware Interview Question: How do you reverse print a st... | Glassdoor

Interview Question

Senior Member of Technical Staff Interview Palo Alto, CA

How do you reverse print a string. After answering the same

  by providing an out of the box API, the next unexpected question was "What if it does NOT exist". While and 2nd alternative was provided, it was pretty much shot down as being not acceptable.

Interview Answer

3 Answers


Use String tokenizer, dump to array and print the array in reverse. However, the prompt response to that answer was "What if there is NO stringtokenizer?" Stringtokenizer is an Out Of The Box API in java.util.

Interview Candidate on Aug 1, 2012

maybe try something like this
StringBuilder sb = new StringBuilder(str);

Anonymous on Oct 31, 2012


Munib on Dec 2, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.