Red Apple Group interview question

all questions were expected