Adobe interview question

Algorithm - find minimum and maximum of the array after each query.