Oak Systems interview question

Question regarding script for a pattern of stars