Uber Interview Question

simple coding sql pl sql java