最中に・うちに・途中に・途中で: the difference
最中にN3
Meaning
In the middle of
Past papers
Example
それについては考えている最中です。
I am in the middle of thinking about that.
うちにN3
Meaning
While, During
Past papers
Tested 4 times in past papers
Example
彼と毎日会ううちに、だんだんと彼のことが好きになってきた。
Meeting him every day, I gradually came to like him.
途中に・途中でN2
Meaning
On the way, Partway, In the middle of
Past papers
Tested 2 times in past papers
Example
シャッターが途中で閉まらなくなってしまった。
The shutter stopped partway and won't close.
How to tell them apart
「途中で」: partway along, partway through, then interrupted.
「最中に」: right at the peak of an activity, something suddenly happens.
「うちに」: do it while the state has not yet changed.