Meta Interview Question

Q: Build a data structure for a generic type that with methods to add and remove elements. Q: Given two views, find the closest parent to both and hide it.