45-minute Skype Interview.
It started with simple resume questions and Java fundamental questions.
Then the interviewer asked the following interview question with 25 minutes left on the clock.
The Problem:
I'm working on a collaborative code editor for two people. I have the text synchronizing across both screens, but I've encountered the problem illustrated below.
Example:
Screen Person A Initially | Screen Person B Initially | Cat | Ca|t
After pressing Enter on Screen 1:
Screen Person A After | Screen Person B After | | Cat | Cat
Expected Output <<<
Screen Person A After | Screen Person B After
| Cat | Ca|t
The content updates, and the word "cat" shifts down a line. However, Person B's cursor remains in its original position instead of moving down a line as expected.
Implement the fixCursorRow method. Don't worry about updating the column.
java public class Cursor { public int column; public int row;
public Cursor(int row, int column);
}
// diff comes from the other screen. // content is the content of the current screen before diff is applied. // cursor is the cursor of the current screen.
// diff format: // The diff contains all content from the beginning to the end of the document.
json [{"1", "\n"}, {"0", "cat"}]
// house -> horse = {{"0", "ho"}, {"-1", "u"}, {"1", "r"}, {"0", "se"}} // "0" -> equality, "1" -> addition, "-1" -> removal
java public Cursor fixCursorRow(String[][] diff, String content, Cursor cursor) { }
Java fundamentals and the question that I have mentioned.
The following metrics were computed from 280 interview experiences for the Yelp Software Engineer role in United States.
Yelp's interview process for their Software Engineer roles in the United States is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Yelp's Software Engineer interview process in United States.