eBay Interview Question

LC problem and some behavior