Got this when requested to enter my password. How is something like this enhancing security ? Is it each time taking random set of index locations and compare it's hash against a database?
It is a kind of challenge-response protocol, which means that if an eavesdropper manages to read the communication, they'll only have part of the password.
In the same way, it offers a little protection against shoulder surfing.
Whether this really enhances security is open for debate. Eavesdropping should be prevented by proper use of TLS.
One drawback is that the server must know at least part of the plaintext password. Or hashes of several parts of the passowrd, which effectively splits a long password in several smaller ones that are easier to brute-force.
Also, as @Matthew points out in their comment, this might give away the length of the password to an attacker, if the password interface is poorly implemented.
I'm generally in favor of challenge-response protocols for authentication and identification, but this seems a poor implementation of one.