On Monday Milly borrows $35 from a friend. On Tuesday she pays her friend $40. On Friday she borrows $42 and pays back $30 that night. How much does Milly owe her friend in the end?

Milly borrowed $35 on Monday and paid back $40 on Tuesday, so she still owes 35 - 40 = $<<35-40=-5>>-5.

On Friday, she borrowed an additional $42, so she now owes -5 + 42 = $<<-5+42=37>>37.
That night she paid back $30, so she now owes 37 - 30 = $<<37-30=7>>7.
Therefore, Milly owes her friend $7 in the end. Answer: \boxed{7}.