Microsoft Interview Question

write an segment tree