# CVA Probability of default

I have to estimate CVA for an exotic option. I used Monte Carlo method to price the option with 1000 number of simulation, maturity = 1 year, and 360 time steps. So I have two questions:

1. I've read in many papers that counterparty's probability of default can be estimated by CDS. How can I do it? I'm working in Matlab
2. Is the probability of default costant over the time steps?