You don’t say much about your background or where you are, so it’s hard to answer your question. I think there’s really two parts to your question: “1. How do I become a great software engineer?” and “2. How do I emigrate to a country with higher salaries for engineers?”
To me, these are pretty basic questions. To be a great software engineer, teach yourself to solve difficult problems and then go do it. Always push the limit of your ability. Learn multiple languages. If you’re a system software person, go tinker with databases. If you’re a compiler guy, go tinker with neural networks. If you’re a C programmer, go learn Scheme or Haskell. Read books on lots of topics: microprocessor design, good software engineering practices, design patterns, etc. In your job, be indispensable. Be the guy who can solve any bug or solve any problem, even if it spans multiple areas of knowledge. Be indispensable.
Don’t be the guy who holes himself up as a guru in a little obscure walled-off technical area and hides his knowledge as a form of power or job security. There is no job security. Even if you’re good, your company could go through a rough spot and lay you off. The only job security is to be known in a network of other people as a great engineer, and then if you don’t have work it’s no problem to find another job.
If you go interviewing for any serious jobs, you’re going to get coding questions. Whether they are a great way of assessing a candidate is a topic of debate on HN, but that doesn’t matter. You’re going to get them. People have put together anthologies of these questions: be sure you can solve them. If you practice and are good at it, you will be able to solve similar problems that you haven’t seen before.
If you’re in an “emerging economy” with low salaries for engineers, then figure out how to get to a different country. The demand for software engineers worldwide is huge right now, and so if you can figure out a way to legally work in a richer country and you have any talent at all, you can find a job. Visa programs put a high value on university degrees in technical fields, so if you don’t have one it’s likely you’ll need to get one.
The United States has the best paying jobs for software engineers right now, but it is very hard to emigrate to right now because the H1-B visa category is oversubscribed. The best way to get in now is to go work for a big company that has a presence in both the USA and abroad (like, say, Google) and then after a year you can transfer to the USA on an L1 if your employer allows it.
I’m no expert on moving to Europe, but I know that various countries have “blue card” programs for skilled technical people to move to Europe on. Anecdotally, I believe the best-paying jobs are in northern Europe, especially in Germany. But the pay will be less than in the USA. I transferred one engineer from Silicon Valley to Germany (his request) and I had to give him a 25% salary cut and he got a lot less equity compensation going forward.
The good news is that there is a huge demand for skilled programmers everywhere. I’m so glad that my childhood passion was computers and not medieval French poetry, in which case I’d be serving lattes at a coffee shop and be living in fear that a robot is going to take my minimum-wage job.