Google interview question

Question on trees and question on project and sql queries