Feeling incompetent about a written exam scheduled for today. Should I skip it? I have a written exam scheduled today evening in 2 hours for a research scientist position at a major British company. They want to check competency in theory and programming for a position.

My PhD thesis has been broadly on the topic they have advertised. So, I applied for the position as I was interested in the job description. However, the outline of written exam scheduled today demands heavy mathematical and programming expertise. The written exam was scheduled within a week of resume submission. There's no sample questions or preparation materials available on the internet.

To be honest, my research was not mathematically or computationally intensive as what's expected from me. Now I am dreading to appear for the written exam. I am afraid that I will not be able to answer anything. 

What should I do? Should I skip it? Doing poorly will create a bad reputation. I am afraid that would affect my future chances of working with the company.
In general, blowing off an agreed-upon meeting is strictly worse than not performing well in that meeting; the only exception being a temporary issue, such as a scheduling conflict or illness. In either case you would need to contact them immediately, explain the temporary and serious issue, and ask to reschedule.

In your case, this does not seem to have anything to do with a temporary issue, its just that you don't feel you'll do well in general. 

My advise is to prepare to the extent you can, such as by trying to brush up on basic facts if you can find any that seem related to the interview. So if it includes programming, for instance, remind yourself of basic data structures and algorithms (at a high-level), the general syntax of any specific language mentioned, etc. If there are a few basic facts you can review on the math, such as if they mention stats you can brush up on your definitions of standard terms (regression, deviation, distributions, etc.). 

Then go in and give 'em hell, i.e. do your best. Remember, you have no idea what is actually expected in terms of performance. This could be like the Putnam, were anything better than miserably failing every single question is considered a fantastic result. It could be an interview that is mostly about testing you with overly hard things and seeing how you react - can you calmly reason through hard problems, break them down, point out assumptions, clarify, suggest potential approaches? Are you affable and interesting to talk to, or do you break down the first time you encounter something you don't know?

If you don't perform well, oh well - at least try to do it with a good sense of humor and a bit of grace. If you don't know, you don't know. This attitude can make the conclusion "this job isn't a good fit for this person's background", which could be true, in which case now you both know, and this would not usually prevent you from re-applying to the company later. You are generally welcome to re-apply later, and you can then know to emphasis the highly related experience you picked up in the mean time. 

But since you don't actually know what's on the test in terms of actual questions, and you don't know what their real expectation of performance is, I can't really think of a worse strategy than admitting total defeat and giving up before even trying. If you applied to a job that seemed like it would be a good fit for you, and they agreed enough that they want to interview you, it seems like a good time to give it your all and learn as much as you can from the process regardless of result.