Write code. Lots of it. Becoming a good programmer is the same as becoming a good anything: it is mainly a matter of practice. You need to get those hours in now.
You also need to choose a field that you are interested in, so that you will be able to maintain the effort required to succeed. But I would recommend weighting your choices towards fields which give you an advantage towards employment given your situation. Machine learning, for example, would be an opportune choice, given the similarity of subject matter (statistical analysis), and the fact that there are large H1-B employers with demand for Ph.D grads with machine learning experience (e.g. Google).
Pick a sub-field, and learn it inside and out. And code, code, code.
Source: I'm was undergraduate physics student that went on to write code at NASA and now does full-time bitcoin consulting.
Machine learning seems like an excellent thing for the OP to look at, yes. It's (1) potentially useful for a career in software, (2) potentially useful for a career in quantitative finance, (3) potentially useful in scientific research. And also (4) currently trendy, which might be either a good or a bad thing.
I'm a theoretical physics (quantum computing) grad student. I really like what I do, and would like to continue doing it for a long time.
But I'm aware that the job market in academia for freshly minted physics PhDs is not spectacular. For personal reasons, I may not be able to go through the post-doc treadmill and I might want to make good money. Thus: programming & finance. I currently lean towards programming.
I thought LW is a good place to ask for advice related to this.
Current skills: Good at math, definitely not "gifted". I know C++, and some Python; neither inside out. I don't know specific techniques to design good algorithms for problems. For example, I tried my hand a few times at programming contests (including those at small scales) and got my ass handed to me. I've only taken basic college courses in programming.
I'm not very aware of the skills tested in quant interviews. I'm sure googling and talking to a few people will fix this, but please feel free to add your thoughts.
I have about a couple of years left till I graduate, so I can do this properly: What is the best way to make sure that when I graduate I can easily take a job in software or finance after the PhD? Looking for the most bang-for-the-buck (the buck here being time and money) way to do this.
Also, I may have blinders on. Are there other well-paying jobs out there for physics PhDs? I'm not an American citizen, so many of the government/government-funded lab jobs are out of the question.
Thanks in advance.
Some resources I've identified:
1. USACO training gateway.
2. SICP. (How much is it worth going through this?)
3. Cracking the Coding Interview.