what is the source of bitcoin for trading site like koinexcoinbase/etc...? I understand sites like koinex/coinbase/etc.. credit bit coins when we try to buy bitcoins from them. 

How do they (koinex/coinbase/etc..) get bitcoins to give it to users when they buy? are they doing mining and getting coins? or do they buy bitcoins from somebody who is mining ?
No, simply they sell and buy bitcoins. I sell them my bitcoins and you buy from them these bitcoins.