Microsoft interview question

write an segment tree