How to ensure that a reference letter is sent on time if not knowing the reliability of a referee? It has happened to me the second time that I was turned down by a referee (different one) not taking his responsibility seriously. Of course, I let each of them know about my application and the reference request well ahead of time.

The first time I requested the reference letter I was told that everything would be sent on time, etc. But one week before the application deadline the reference was still not sent (even despite my reminders) and so I quickly found another referee who rescued me. I never told the first referee that I found somebody else and the referee never got back to me over the email again...

The second time I had the "advantage" (or rather a deception) of being able to meet the referee everyday in person and so the day before the deadline I reminded that professor in person concerning the reference, also sent emails, etc. He promised into my eyes he would send it on that very day, but the deadline passed and the reference was never sent... No, the referee did not die, did not have an accident or a bomb in his office. They just could not be bothered.

I think it is very sad to know of the existence of such people and their behaviours, especially considering the fact that they used to be (some of them still are, probably should not be) my close collaborators with whom I spent many hours together.
I believed them. I thought I knew them, but only afterwards I realized that whatever smooth words they may have told me in the past, they did not mean them.

How do I ensure that the reference gets sent on time, how can I determine that I can trust somebody who I test the first time?

Usually more than one reference is required and I know that on some people I can rely 100%. Their yes means yes and their no means no. But what about the new referees? I was thinking of telling them of a deadline that is e.g. 15 days earlier than the actual deadline and in case no reference gets sent by my deadline, then I would contact an emergency referee to send the reference by the actual deadline. But sometimes, an electronic application tells the referees of the actual deadline and therefore I cannot make my own deadline.

Also note that many referees do not want to give you their reference that you may read it, but rather want to send it directly to the application committee. Thus something like having a backup letter, I am afraid, is not an option, especially in cases when the reference needs to be signed electronically by the referee oneself.
But one week before the application deadline the reference was still not sent (even despite my reminders)


This strikes me as entirely normal.  I try to write most letters a few weeks before they are due, but I end up writing some letters during the last week, and I believe this is pretty typical.  I don't have any statistics handy, but I'd bet that a substantial fraction of all letters of recommendation are written in the last week (or later!).  It may be stressful for applicants, but it's not unusual or particularly worrisome.

It's also worth noting that many deadlines for letters are actually flexible, and experienced faculty often know which ones are.  For example, NSF graduate research fellowship deadlines are absolutely inflexible (if you miss the deadline by one minute then you can't submit at all), while graduate programs in mathematics at U.S. universities are almost always flexible about letters (if you submit a letter a few days past the stated deadline, it won't do any harm).  Someone who doesn't seem to care about a deadline may just know that it doesn't actually matter.  It's not nice to do this without explaining the situation to the student, but it's not necessarily as terrible as it looks to someone who thinks the deadline matters.

Unfortunately, a few people really are irresponsible, and I don't know of any ideal solution to this problem.  One strategy is to propose frequent reminders, along the lines of "I know you are juggling a lot of things this semester, so I wonder whether you'd like increasingly frequent reminders to minimize the chances of a last-minute rush.  I could send you a reminder e-mail once a week for the last four weeks before the deadline, and once a day for the last four days (of course stopping once you tell me it's submitted).  Would that be helpful?  Or what sort of reminders would you prefer?"  I doubt anyone would be offended to be asked, since they could always ask for fewer reminders.  This can't guarantee that someone will make the deadline, but it minimizes the role of forgetfulness or poor planning.


  I was thinking of telling them of a deadline that is e.g. 15 days earlier than the actual deadline and in case no reference gets sent by my deadline


I would feel a little offended if an applicant deliberately misstated the deadline in this way.  As an alternative, you could explain that you feel very nervous about deadlines and ask whether your recommender could please submit their letter two weeks before the actual deadline.  They might not agree, but the worst case scenario is that they say that's not convenient.  (I would agree if someone asked me, assuming they gave me plenty of time to write the letter, but not if they asked too close to their proposed deadline.)  I wouldn't generally recommend asking this, since it would come across as eccentric, but eccentricity is better than dishonesty.