Work in HR or Recruiting?
Facebook
www.facebook.com Menlo Park, CA 1000 to 5000 Employees
Work in HR? Complete Your Profile

35 interview experiences Back to all Facebook Interview Questions & Reviews

Interview Question for Software Developer Intern at Facebook:
Feb 28, 2013

Given a string, return true if it's a palindrome. Only alphanumeric characters considered. Do this in one pass through the string.


Add Tags [?]

See more for this Facebook Software Developer Intern Interview

Helpful Question?  
Yes | No
Inappropriate?

Answers & Comments (1)

Mar 2, 2013

by KSP:

boolean isPalindrome(String input) {
    String copy = input;
     for(int i = 0, j= input.length() - 1; j >= 0; --j)
           if (input.charAt(i++) != copy.charAt(j))
                 return false;
     return true;
}
Helpful Answer?  
Yes | No
Inappropriate?

To comment on this question, Sign In with Facebook or Sign Up

Facebook – Why Work for Us?

We're making the world more open and connected. Want to help? Working at Facebook means doing what you love. We hire trailblazers, hackers and pioneers. We want people who can solve challenging problems… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.