is there a way prevent backflow from my sink?
In the UK, we can get 'HepVo' waterless valves which are intended to be used instead of a P-trap.  These - the manufacturer claims - are good resisting high backflow pressures.  If you installed one of these or a similar non-return valve, it would prevent the flooding.

You'd still have the root problem - and your sink would not drain when the pipes are blocked - but at least you'd not get waste water in your sink.

You should encourage your neighbours to make sure that their own kitchen waste is properly vented and running freely too.  It might be that a bit of preemptive chemical maintenance (by them and/or you) on a routine basis would keep problems at bay for longer.