After I had a phone screen with the hiring manager, I was invited to an on-site interview with 5 different developers, one at a time, each for 30 minutes. I spent most of my time coding on a whiteboard and answering core Java questions.
Overall, I felt that the interview went well. It could have gone a lot better, but I was completely flustered by the second person who interviewed me (Interviewer B).
My confusion was caused by Interviewer B refusing to accept my answer to his 'reverse a string' question (without using StringBuilder). Below is the method that I drew up:
java String reverse(String str) { char[] in = str.toCharArray(); for (int i = 0; i < str.length() / 2; i++) { char temp = in[str.length() - 1 - i]; in[str.length() - 1 - i] = in[i]; in[i] = temp; } return new String(in); }
When I finished, he kept asking me if I could find an issue with my code. I couldn't seem to find anything wrong, so I walked him through the program line by line and still couldn't find an issue. Interviewer B then told me that my index was off by one and I was not retrieving the last value of the char array. After attempting to argue that I was not off by one, he began to chuckle at me and insist that I was incorrect. By this point, I was muddled and gave in. I updated a couple lines of the method to be:
java char temp = in[str.length() - i]; in[str.length() - i] = in[i];
And then he accepted my answer. I thought those changes would have caused a StackOverflowError, but I just assumed it was correct somehow.
So I met with the next interviewer (Interviewer C). After some core Java questions, he told me to report to the whiteboard and asked the last question I wanted to hear: "Write a method to reverse a String." So I coded it to exactly what Interviewer B accepted. In my head, I knew it was wrong, but I felt that maybe things worked differently at Comcast. Interviewer C immediately told me that it was a StackOverflowError. I adjusted my code to my original solution, and he accepted it.
In hindsight, I wish that I would have stuck to what I believed was correct and should have asked the interviewer to run the program on his laptop instead of trusting him. Because of what happened, I felt that the interview was very unfair.
Explain how hashCode works in a HashMap.
FizzBuzz
The following metrics were computed from 21 interview experiences for the Comcast Software Engineer role in Philadelphia, Pennsylvania.
Comcast's interview process for their Software Engineer roles in Philadelphia, Pennsylvania is fairly selective, failing a large portion of engineers who go through it.
Candidates reported having good feelings for Comcast's Software Engineer interview process in Philadelphia, Pennsylvania.