Shift Technology interview question

2 Coding Data Structure Questions, on Leetcode, easy level