ByteDance interview question

2 coding problems 1 database problem