Predicting interface structures: from  SrTiO 3  to graphene