Expedia Group Interview Question

DS Algo questions on Strings and Trees. And a design problem.