The right way of practicing ds and algo to get good at it

i know a friend who solved 200-250 questions , but not able to clear simple ds and algo interviews , i think it’s because he just cares about number of questions he do,in a way he mugs the answers he admitted and trying to change it now,
when i stuck and , try to take hints in detail, or read editorial solution in detail,i feel i am doing it wrong , what should be my approach when i get stuck while practicing?