I've been a web developer for a little over 3 years now and I mainly develop Windows phone applications. I feel silly when I have to Google even the simplest syntax online because I should know all this by now right? I haven't been called out on it at work but it's still a personal battle for me and my own confidence.
Don't feel silly of having to look for the answer. The most important thing is you know the structures and algorithms you need for the problem you're solving.
Each programming language has its own style and syntax but structures and algorithms apply universally.
Practice, practice, practice and even more practice is when you'll eventually get there. However, even I finding myself doing it occasionally.