Exelis Interview Question: how do you reverse a string?... | Glassdoor

Interview Question

Intern Interview(Student Candidate) Bowie, MD

how do you reverse a string?

java, c#, algorithm

Interview Answer

2 Answers


you can look up the answer online.

Interview Candidate on Sep 1, 2010

1. Create an array of characters with size of a given string for storing a reversed characters.
2. Convert a given string into an array of characters.
3. Loop through an array of characters from last character to first character storing a character into an array created in step 1.
4. Convert an array which hold a reversed characters into a string

Anonymous on Jan 15, 2011

Add Answers or Comments

To comment on this, Sign In or Sign Up.