It sounds like you simply weren't technically prepared and qualified for the position. That is correctable!
1) Interview prep. Here are the 4 standard books to prepare for programming interviews at big companies like Apple, Google, Microsoft, Facebook, Amazon.
- Programming Interviews Exposed - Cracking the Coding Interview - Elements of Programming Interviews - Ace the Programming Interview
2) Open Source - Get involved today! Pick a big open source project like Mozilla. Big projects have great resources and programs to get new people involved. For example Mozilla has mentored bugs where the mentor helps you along from environment setup to submitting the code.
3) Hobby Projects - Pick a technology/platform/framework that interests you. Read up on basic tutorials and setup the development environment. Get the server running. Get the code to compile. Take small steps. Ask for help. You can find answers to basic questions on stackoverflow etc.