Insight Global Interview Question: Implement a method to determi... | Glassdoor

Interview Question

Junior Java Developer Interview Philadelphia, PA

Implement a method to determine whether a string is a


Interview Answer

3 Answers


Recursive method; start from the ends and work your way in. Use indices if worried about memory.

Interview Candidate on Nov 15, 2012

Take a string as function parameter. Copy this str value into a new var, then use .reverse() thereupon. Compare the reversed copy back against original string using turnery operator to set resVariable to "true" : "false". Return resVariable.

Anonymous on Nov 2, 2017

(Using .split(""), as well as .join(""))

Anonymous on Nov 2, 2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.