How to query friends and same followings?

I would recommend doing something similar to this