Work in HR? Unlock Free Profile Software Engineer Intern Interview Question

I interviewed in Seattle, WA and was asked:
"In-place array reversal, level-order binary tree traversal, reading two files and outputting strings common to both."
Add Tags [?]

Part of a Software Engineer Intern Interview Review - one of 4,681 Interview Reviews

Answers & Comments

of 0

In Place reverse array:

    public char[] inPlaceReverse(String s) {
        char[] array = s.toCharArray();

        if (s != null) {
            int p1 = 0;
            int p2 = s.length()-1;

            while (p2 - p1 > 0) {
        return array;

    private void swap(char[] array, int p1, int p2) {
        char temp = array[p1];
        array[p1] = array[p2];
        array[p2] = temp;

- Juan on Feb 4, 2014

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

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