HI @elmirap
So my interviewer told me that two screens were given of Person A and Person B as shown in the figure and text synchronization between the screen has been already done. But they have one problem, they are not able to synchronize the cursor positions.
So suppose in screen A cursor and cat are on line 1 and the cursor is behind the cat. So if Person A hits enter , both cursor and cat will move to line 2. Since the text is synchronized between the screens, the cat in the screen B is also being moved to the next line but the cursor in the same screen is still at line 1. So we have to synchronize the cursor position too.
We have a following method that will give us the diff between the old and new content.
public Cursor fixCursorRow(String[][] diff, String content, Cursor cursor) {
}

Note:
1 means addition of something
0 means nothing is changed
-1 means removal of something

So for this problem we get following diff array
{{"1", "\n"}, {"0", "cat"}}

So in the diff array you can see there is an addition of the new line {"1", "\n"} and also there is no change in the content {"0", "cat"}.This mean we have to move cursor to the next line.

This was kind of very open ended question and I got only 25 min to give the solution.Please let me know if you want more explanation.