Introduction
In this article, we will learn some advantages of the BST over the Hash table. But before that, we must know some basic information about the two.
So a Hash Table stores data in an associative manner. Hash tables store data in array format, i.e. each value in a hash table is assigned an index which makes access to the desired data fast. It uses an array as a storage medium and a hash technique to generate an index where insertion and location happen. Hash table does insertion, deletion and searching in O(1) time.
On the other hand, a binary tree data structure where each node of the left subtree is less than the node key, and each node of the right subtree are greater than the node key are called a Binary Search Tree. The left and right subtree formed from the node key must also be a binary search tree. Selfbalancing binary search tree (AVL Tree, RedBlack Tree etc.) does operations like searching, deletion and insertion in O(log N) time.
So it seems like the hash table is beating the binary search tree in standard operation as the time complexity of operation in the hash table is much lesser than BST. So when does one start considering using a BST over a hash table?
There are certain conditions where we start considering BST over a hash table.

Sorted data in a binary search tree could be obtained just by doing an inorder traversal as data in the binary search tree is already stored in a sorted format. On the other hand, to obtain sorted data in the hash table, we have to traverse each element and sort them using any sorting technique, which makes sorting an O(n) operation for binary search tree (just simple traversal ) and O(N log N) for the hash table.

A binary search tree can do operations like finding the largest node, smallest node, and node nearest to the given value in O(log N) time. On the other hand, to carry out these operations in the hash table, we traverse through all elements, and hence it takes O(N) time.

Implementing a binary search tree seems much simpler than implementing a Hash Table. In most programming languages, customized hash tables are implemented with the help of inbuilt libraries.

Selfbalancing binary search tree can perform operations like insertion, deletion, updating and searching with an upper limit in the time complexity of O(log N), i.e. none of the above operations in worst cases for selfbalancing binary search tree takes more time than O(log N). On the other hand, though avg time complexity for the above cases in the hash table is O(1), there is no such upper limit for worst cases where it could take more time depending on how libraries implement hash tables.
So both binary search tree and hash table have their advantages and disadvantages, so BST over a hash table or hash tables over BST, the decision should be based on the requirements.
You can also read about mock interview.
Also see, Must Do Coding Questions
Recommended Topic  hash function in data structure
FAQs

How does the hash table store data?
Hash Table stores data in an associative manner. Hash tables store data in array format, i.e. each value in a hash table is assigned an index which makes access to the desired data fast. It uses an array as a storage medium, and a hash technique is used to generate an index where insertion and location happen.

What is a binary search tree?
A binary tree data structure where each node of the left subtree is lesser than the node key, and each node of the right subtree is greater than the node key is called a Binary Search Tree. The left and right subtree formed from the node key must also be a binary search tree.

What is the time complexity of sorting in the binary search tree and the hash table?
Sorted data in a binary search tree could be obtained just by doing an inorder traversal as data in the binary search tree is already stored in a sorted format. On the other hand, to obtain sorted data in the hash table, we have to traverse each element and sort them using any sorting technique, which makes sorting an O(n) operation for binary search tree (just simple traversal ) and O(N log N) for the hash table.