# Java Interview with a LinkedIn engineer

#### Watch someone solve the reverse word in string problem in an interview with a LinkedIn engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.

Reverse Word in String (Mock Interview) - YouTube

[Reverse Word in String (Mock Interview)](https://www.youtube.com/watch?v=aotBpjJUqJo)

### Interview Summary

**Problem type**  
Reverse word in string  
**Interview question**  
Given a string with multiple words and spaces represented as a character array. Write an in-place algorithm to reverse the order of words in the string. Example: convert \['p', 'e', 'r', 'f', 'e', 'c', 't', ' ', 'm', 'a', 'k', 'e', 's', ' ', 'p', 'r', 'a', 'c', 't', 'i', 'c', 'e'\] to \['p', 'r', 'a', 'c', 't', 'i', 'c', 'e', ' ', 'm', 'a', 'k', 'e', 's', ' ', 'p', 'e', 'r', 'f', 'e', 'c', 't'\]

### Interview Feedback

**Feedback about Ice Gyro (the interviewee)**  
Advance this person to the next round?  
Yes  
How were their technical skills?  
4/4  
How was their problem solving ability?  
2/4  
What about their communication ability?  
4/4  
> In interviews, problem solving ability is considered very important. Failing to come up with the answer is a no deal.  
> But you had written the code so beautifully that how could I say no :)  
> PS: You have nice personality :)

**Feedback about Space Dragon (the interviewer)**  
Would you want to work with this person?  
Yes  
How excited would you be to work with them?  
4/4  
How good were the questions?  
4/4  
How helpful was your interviewer in guiding you to the solution(s)?  
4/4  
> Please keep doing what you're doing! You did a great job explaining the problem and helping me think about it. You guided my thinking with examples until I saw the solution. It's really good to talk and talk about the solution before the coding starts.

### Interview Transcript

**Ice Gyro**: Yeah can you hear me?  
**Space Dragon**: Yeah I can hear you now, thank you.  
**Ice Gyro**: Yeah I can hear you. Thanks for the skype invitation.  
**Space Dragon**: Let's jump in the question right away. Just one quick question: are you actively interviewing right now? How much are you prepared?  
**Ice Gyro**: I'm not very prepared. I'm not actively interviewing right now. I work as a programer. I'd like to get better. This is my first every time doing interviewing.io  
**Space Dragon**: Okay cool. What programming language are you most comfortable with?  
**Ice Gyro**: Java.  
**Space Dragon**: Okay cool, I'll just write the question on top here. So you basically have an array and it has something like this….So here is the array: \[ 'p', 'e', 'r', 'f', 'e', 'c', 't', ' ', 'm', 'a', 'k', 'e', 's', ' ', 'p', 'r', 'a', 'c', 't', 'i', 'c', 'e' \] If you notice there is a space character and another space character later on as well. We want to convert this array into “practice makes perfect.”  
**Ice Gyro**: So it's moving the letters around is what you want to do.  
**Space Dragon**: Yeah, but what's important is that we have an array of characters and spaces in between. This whole list basically has words in reverse order, you know? So this array is basically: “perfect makes practice” and you convert it to “practice makes perfect.”  
**Ice Gyro**: Yeah I think I understand.

... (continues with the dialog details about code and reasoning) ...

**Space Dragon**: Yeah so the last one is wrong here: “perfect.” So we never entered the loop for the last one right? So we can address that very easily.  
**Ice Gyro**: So here's where we're reversing the individual words in place.  
**Space Dragon**: The last word didn't.  
**Ice Gyro**: Oh right here, what if we just say...and instead of wt we're just going to do the length of the inputArray.  
**Space Dragon**: Yeah.

### Conclusion

**Ice Gyro**: That was really fun, what a good time.  
**Space Dragon**: Yeah someone asked me and never gave me any clue and took me like thirty minutes to think how to do it. Yeah you did good, you created a function and used those functions and that's very nice because that isn't something that comes to mind intuitively. So yeah, it was great work here.
