Tesla interview question

1. When will you use cte vs subquery