Let us assume the origin to be equivalent to (4:00pm, 4:00pm)… and the marking on the x axis and y axis are in minutes…
$X$ is the random variable which shows the time instant at which friend $X$ arrives. And $Y$ is the random variable which shows the time interval at which friend $Y$ arrives.
Friend $Y$ shall not be able to meet $X$ if $Y$ arrives 10 mins after X arrives. So this is given by $\color{green}{Y>X+10}$ and the region is shown by $\color{green}{GREEN}$ in the graph above.
Similarly, Friend $X$ shall not be able to meet $Y$ if $X$ arrives 10 mins after Y arrives. So this is given by $\color{blue}{X>Y+10}$ and the region is shown by $\color{blue}{BLUE}$ in the graph above.
By virtue of how we have considered the picture above:
> they will wait for 10 minutes or the end of the hour whichever is earlier and leave.
Automatically gets covered…
So required probability = (Area in Blue+area in green)/Total area of the rectangle=25/36