Rakuten interview question

2 Java problems nd n SQL problem