Q1) However, the only way you can access values is through queries to the databases. In single query, you can specify value k to one of two databases, and the chosen database will return the kth smallest value that it contains. Since queries are expensive, you would like to compute the median using as few queries as possible.