How to translate: have you finished doing the homework (which) our teacher gave us last week?
I'm Chinese.

The sentences:

你做完   上个星期  老师  给我们的作业  了吗?
你做完了 上个星期  老师  给我们的作业吗?

are both correct.

The word "了"，just emphasize whatever you want to emphasize.