Amazon interview question

STAR - based queries