You can tell what someone's like by looking at their friends.
Literal
Friends [object-を] look-at-[by-によって] what-kind-of person be [question-か] understand.
~ことによって ('by means of X-ing') is a formal cause/means construction. どんな人か is an embedded question — 'what kind of person [they are]' — with か retained inside. わかる ('to understand, figure out') at the end completes the observation. A proverbial-feeling statement about character judgment.