For young doctors, the first year after medical school, called internship, means round-the-clock hours, low rank, constant demands from patients and superiors, learning complex new skills and constant fear of making a mistake that could harm a patient.
The result is a year of stress, sleeplessness and self-doubt that drives up thoughts of suicide to nearly four times the normal rate, researchers said.
The free web-based cognitive behavioural therapy or wCBT tool, called MoodGYM, offers a digital, streamlined form of the "talk therapy" that mental health professionals provide in office visits.
The study by researchers at the University of Michigan (UM) and the Medical University of South Carolina (MUSC) in US suggests that such a tool could help others in high-stress, high-pressure positions.
Teaching hospitals and medical schools could use the new results to guide mental health programmes for interns, residents and medical students.
"This is a relatively risk-free intervention to help interns recognise and treat depression," said senior author Srijan Sen, a UM Medical School faculty member.
"This is the first study to show that wCBT can reduce suicidal ideation, or suicidal thoughts, in training doctors," Sen said.
Medical interns make an ideal population to study wCBT's effects, said Sen, because all of them experience a predictable sharp rise in stress and pressure with the start of their residency.
First author of the study, Connie Guille, of MUSC, said that this type of intervention is well-suited to this population because "the majority of interns won't seek traditional mental health treatment, mainly because they lack the time, don't have convenient access to care or have concerns about confidentiality."
Sen and Guille tested the app on 199 interns. Half of them were randomly assigned to use the wCBT. The other half got general information on depression and suicide, and contact information for mental health professionals.
In all, one in five of this latter group thought about suicide sometime in their internship year - compared with one in eight of those who used the MoodGym.
Most of those assigned to use the MoodGym site stuck with it, using it all year.
Other studies have shown that wCBT can help people treat existing depression, but never in a randomised controlled way to prevent mood problems in a group whose stress level changes almost overnight and remains high for an entire year.
"Doing this in physicians means we now have a model that shows that this form of wCBT can be remarkably effective as a preventive tool," said Sen.
The study was published in the JAMA Psychiatry journal.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.