What exactly did they ask? Did they ask some Data structures/ algorithm, or Java Internals.
AFAIK most of the companies stick to DS/Algo, unless you have some extra stuff that you have done.
If indeed you are a web developer and understand web really well, put it on top of your resume. Make it crystal clear for anyone who reads it that you know your stuff. Put some previous work that you have done, either as a part-time project or a hobby project.
It is not expected out of an engineer coming right out of a college to know a lot about what is not taught in college and I assure you whatever is taught about web in college, in India is horrendously outdated.
This is the reason why, interviewers stick to DS/Algo. But for some reason someone asked you to implement custom hashcode() for a random object, that someone is extremely poor interviewer, and doesn't understand CS Engineering himself.