I was referred by a employer after they had an opening. Then I was asked to submit my resume. After I submitted my resume they wanted some of my previous projects and their source codes, written by me. After that I was called for an interview. And then after the interview I was contacted for another session to negotiate salary and then got the offer letter.