Rakuten interview question

1 SQL, 1 DSA question