Learning is hard for everyone. The only way to overcome the many obstacles of learning is to prioritize time for it and to have the willpower to see things through even when you feel helplessly stuck.
Getting the job offer only means you meet the minimum requirements. There are no maximum requirements. Keep getting better.
While I agree that coding interviews might not be the best way to assess all your skills as a developer, there is arguably no better way to tell if you are a good engineer in a short period of time. IMO it is the necessary evil to get you that job.