So i can help you with that.
First at all you can't rly say because a gram or less of the same 'bunch' of coke may be good, while others may suck,
Due to this it's also luck
But you can look at different things:
The smell ( has a very particular smell i dk how to describe)
When you lick it it numbs quickly the zone you applied it to ( Lidocaine cut may do this too so this doesnt always mean you're getting good coke)
Id say the best way to tell is try it
I can recognize good coke cause when i snort it, in 1-2 mins my front teeth get numb, along with a great euphoria. IMPORTANT: GOOD COKE ISNT 'SO STIMULATING', IT GIVES YOU AN EUPHORIC BUT CALM FEELING, not wired or too much stimulated ( this is cuz they put amph and shits in it!)
Edit: for the dose just start low:try a small line or two to see how is it and work your way up: there's no sense in riskingg with big fat lines if you dont know the product; it's always better having to redose instead of reaching the 'too much im scared' point.