Landing a job is tough, and it’s no secret that some companies are making it even harder.

One clear sign of this is the time companies are taking to fill jobs—25.6 working days, close to a 13-year high according to the Dice-DFH Vacancy Duration Measure.

Several factors have contributed to that lag time, like shrinking human resources departments, employers’ increasing pickiness about candidates’ credentials, and a growing interest in recruiting passive candidates via social media sites. More laborious pre-hire screenings are also to blame.

That’s right: to the already dizzying job hunting obstacle course, companies are adding even more hoops for job applicants to jump through.

Some of the hurdles are rather basic like background and credit checks. Others require prospective employees to take a test of some sort—computer engineers are asked to write code—or complete an even lengthier tryout. For instance, a company called Joor, which connects retailers and brands, hires would-be employees on a temporary basis and brings them on-board full-time if they perform well.

Then there are companies like Australian mobile app development startup Appster, whose in-person interviews serve as a test of mental endurance. Its interview process can last up to 22 hours. The extensive duration causes candidates to crack under the pressure, which can be a good or bad thing. “You start seeing glimmers of people’s personalities they can’t hide, things you would never be able to see in a traditional job interview,” Appster’s co-CEO Mark McDonald has said.

Technology companies are known for intense pre-hire screenings, but Peter Gundy, a managing director in the talent and rewards group at HR consulting firm Towers Watson, says he’s seeing the tendency crop up in other industries too.

What’s behind the trend?

Steven Davis, an economics professor at The University of Chicago Booth School of Business, says companies have a financial incentive to be more selective in hiring because it’s harder—legally—to get rid of employees than it’s been in the past and because the online trove of candidates’ personal and professional data complicates the selection process. Gundy says employers put job hunters through the wringer not just to find someone well suited for a specific job, but because they’re looking for that all-important “cultural fit” and trying to manage a prospective employee’s expectations for what the job will really be like. The ultimate goal is to cut down on turnover, the causes of which, Gundy says, “can often be traced back to things that could have been headed off in the interview process.”

Appster co-founders McDonald and Josiah Humphrey told Fortune that they instituted their rigorous interview process (which includes what the company calls a “one-day intensive” that lasts up to nine hours) about a year ago after determining that their more traditional hiring process had a 50% failure rate. They recalled one woman who sailed through the interview process, but during her first week, McDonald says, it was obvious that “she had no idea about technology and [technology is] a core competency of our business.”

While Appster’s new system is “very exhausting for the candidate,” McDonald says, the company discovered that the candidates who succeed do so because they’re comfortable talking ad nauseam about their careers—often because they’re well qualified and have nothing to hide about their past positions. “We’re really opening up [our] books to them too,” he says, which helps prospective hires determine if Appster is really where they want to work.

Building a cohesive culture is certainly driving more rigorous interviews, but companies’ bottom lines are also giving the trend a big push. That’s because replacing workers is expensive; Gundy pegs the cost of losing and replacing an employee at between 50% and 200% of an employee’s annual salary. There are indirect costs as well, in terms of lost productivity.

That’s why startups and smaller companies might be buying into this trend. “At a startup, there’s a higher risk of making a mis-hire,” says David Fullerton, vice president of engineering at Stack Exchange, a question and answer website for programmers that also posts programmer jobs. “At a bigger company, there are systems that deal with that; a few bad employees at a giant company is not going to sink you.”

Concerns about turnover, employee engagement, and creating a cohesive culture are nothing new. What’s changing is the way employers are addressing these issues.

In the past, Gundy says, companies would simply try to throw money at an employee retention problem by offering employees stock grants and bonuses to get them to stay. But now, “resources are shrinking,” he says. As health care costs increase and salary and bonus budgets diminish, employers are trying to reduce turnover and boost employee engagement from the get-go by implementing more discerning hiring processes.

And according to David Lewin, a professor at UCLA Anderson School of Management, when work sampling is included in pre-hire selection systems, companies are better able to predict a candidate’s future job performance. There’s no perfect employee-employer matchmaker, but getting a glimpse of a prospective hire’s work in real time is “the most valid employee selection method,” he says, more so than interviewing or biographical data that’s obtained from resumes. It’s no surprise, then, that the internship-to-full-time position pipeline is so popular and the temp-to-hire tryout method is gaining steam.

The rigorous pre-hire selection phenomenon is contributing to lower rates of “separation,” or when a worker leaves a job, Davis says. “The basic idea is that if you screen more intensively, you’re going to make fewer mistakes you’re going to make and you’ll get less separation early on,” he says.

All of this breeds mixed results within the economy at large. “There are positives if fewer people are losing their jobs in an unwanted matter. On the other hand, if you do lose your job in a market that doesn’t throw up many hiring opportunities, you’re likely to get stuck there for a long period of time.”