My first impression in reading your post is to wonder why this employer would put you through the extensive interview and application process you describe if they were not seriously considering you for the job. It sounds as though you were one of the final candidates.
However, it is certainly possible some unlawful considerations may have been the deciding factor. If the employer decides to hire someone less qualified than you and who is not in the protected classification you are in, you have the basics to make a claim (we call it a prima facie case). This would require the employer to come up with some reasonable justification for why they decided to hire the other person over you. That is usually not very difficult to do. Once they offer a justification, the burden falls on you to prove that reason was merely a pretext to cover for the true discriminatory motive and you must have some evidence to show discrimination based on race, age, or other protected classification.
Proving discrimination in failure to hire cases is very difficult. In addition, establishing damages is speculative because there is no guaranty how long the employment would have lasted.
You can certainly file a complaint with the DFEH within one year of the denial of the job (most California lawyers prefer state law over federal law which the EEOC follows) and ask they conduct an investigation. If they accept the case, there is no way to know what the evidence will show. It will take awhile. But if you feel strongly that you were discriminated against, it is your right to attempt to file a complaint.
They say you get what you pay for, and this response is free, so take it for what it is worth. This is my opinion based on very limited information. My opinion should not be taken as legal advice. For true advice, we would require a confidential consultation where I would ask you questions and get your complete story. This is a public forum, so remember, nothing here is confidential. Nor am I your attorney. I do not know who you are and you have not hired me to provide any legal service. To do so would require us to meet and sign written retainer agreement. My responses are intended for general information only.