Google Interview Question

Question on trees and question on project and sql queries