Juniors in a function should report to senior members of the same or similar function.
For example: Designers should report to Group Design Leads who report to Head of Design. Engineers should report to Eng Managers who report to Group Eng Managers and so on.
There are exceptions where functions are similar. E.g. it makes sense for designers to ultimately (toward the top of the org) Product. It makes sense for Data Scientists to ultimately report into Engineering.
Stated in the negative, Product shouldn't report to Engineering. Design shouldn't report to Marketing.
Why?
This is because it's essential that managers can be of service to their direct reports. They must be in a position to provide guidance about their craft, perform fair performance reviews, nurture their career during 1:1s, and help them resolve interpersonal issues that might be unique to their particular area of responsibility.
But what about when individuals are deeply embedded in a department (as they should be)? For example, what happens when designers are working closely with Marketing. They need to be able to heavily influence the work the designers are focused on, right?
This is solved by splitting "management" into two separate parts:
Part 1: Management of people, culture, and craft: This is performed by your "manager". They help you understand HOW to do your work. They are the "solid" line on the org chart.
Part 2: Management of workload and priorities: This is performed by your "colleagues". They help you understand WHAT work to prioritize. They are "dotted" line on the org chart.
By splitting it this way, you get the best of both worlds and unlock the potential in your team.