WASHINGTON -- Last month, The Huffington Post surveyed the major 2016 presidential candidates in an effort to compare their views on criminal justice. The two leading Democratic contenders, former Secretary of State Hillary Clinton and Vermont Sen. Bernie Sanders, participated -- as did former Maryland Gov. Martin O'Malley, who has since suspended his campaign following a poor showing in Iowa.

Here's what we learned. The Democratic presidential nominee -- whether Clinton or Sanders -- will call for expanding federal investigations into local police departments, believe racial inequalities in the criminal justice system cannot be explained away by economic disparities, and think a variety of factors -- not mass incarceration alone -- contributed to the historically low levels of violent crime in the U.S. in recent years.

The nominee will also think that prisons need to put more emphasis on rehabilitation, that the harmful practice of solitary confinement should not be used as a punishment, and that the U.S. Department of Justice should dole out federal grants in ways that push law enforcement agencies across the country to stop routinely violating constitutional rights.

Jewel Samad/AFP/Getty Images Sen. Bernie Sanders and former Secretary of State Hillary Clinton both see a role for the federal government in reforming criminal justice.

The nation has been paying more attention to criminal justice reform in the year and a half since protests broke out in Ferguson, Missouri, over the shooting death of 18-year-old Michael Brown. As social media have helped give a voice to communities whose longstanding concerns were often dismissed by elected officials and ignored in the traditional media, many prominent law enforcement leaders have conceded the need for reform. Both Clinton and Sanders have met with key organizers in the Black Lives Matter movement.

Yet the issue -- so connected to race -- remains tricky for Democrats to navigate. During the "tough on crime" 1990s, both Clinton and Sanders supported legislation that led to massive growth in the federal prison population, which they now seem to regret. In a country that remains heavily segregated, Democrats also risk alienating a segment of moderate white voters who struggle to relate to the experiences of many black Americans with police officers, who have little exposure to problems within the criminal justice system and who may be generally allergic to the suggestion that their skin color has given them any advantage in life.

The Republican presidential nominee may seek to capitalize specifically on the racial divide in perceptions of law enforcement. In the years since Barack Obama was elected to the White House, many conservative politicians and media outlets have shown little hesitation in casting the nation's first black president and his former attorney general -- Eric Holder, a black man who spent most of his career in law enforcement -- as anti-police. Donald Trump has called police "the most mistreated people" in America and suggested that a Black Lives Matter activist "should have been roughed up" at one of his rallies. Other GOP candidates, including Ted Cruz and Chris Christie, have demonized the Black Lives Matter movement.

Although some of The Huffington Post's questions asked candidates how they thought about criminal justice, many focused on what candidates would do as president. In contrast to the Republican contenders -- who have, for the most part, spoken very generally on criminal justice and suggest the issue should be handled mainly at the local level -- the Democratic candidates argue that the federal government can and should play a significant role.

In answering HuffPost's survey, Clinton and Sanders both pointed to experiences early in their lives that informed their view of the criminal justice system. Sanders recalled "being harassed by the police simply for putting up flyers in a neighborhood" as a student organizer in the 1960s. He found the contrast between the officers he faced in real life and the ideal of local government he learned in class "striking," Sanders said.

Clinton recalled the work she did fresh out of law school for the Children's Defense Fund, where she investigated the incarceration of juveniles in adult jails in South Carolina, and with the University of Arkansas School of Law's legal aid clinic, where she advocated for inmates and low-income families. "I saw how families can be torn apart by excessive incarceration and the toll it takes on children growing up in homes shattered by poverty and prison," Clinton wrote. "Through my work, I came to see how our legal system can be stacked against those who have the least power and are the most vulnerable."

Both candidates were born in the 1940s and began their schooling before the Supreme Court's 1954 Brown v. Board of Education decision, which declared state-sponsored educational segregation to be unconstitutional. Both came of age in the civil rights era. High-schooler Clinton met Martin Luther King Jr. around the time she was campaigning for Republican presidential nominee Barry Goldwater, who opposed the Civil Rights Act of 1964. College student Sanders was in Washington, D.C., for King's celebrated "I have a dream" speech in 1963.

In his survey, Sanders said that race "plays a role in every aspect" of the criminal justice system and that police officers are human, subject to the same biases and behaviors as everyone else. "People of color are more likely to be stopped by police, arrested, receive a prison sentence, receive a disproportionately longer sentence, and receive more punitive treatment in the prison system compared with white people," the senator wrote. "Discrimination in the law enforcement and judicial systems must be addressed at every level."

There is "something profoundly wrong when African American men are still far more likely to be stopped and searched by police, charged with crimes, and sentenced to longer prison terms," Clinton wrote. "When an estimated 1.5 million black men are missing from their families and communities because of incarceration and premature death. And such racial inequalities are not merely a symptom of economic inequality. Black people across America still experience racism every day, whether intentional or implicit bias. That's the reality in the African-American community -- and we shouldn't stand for it."

Clinton has said before that she'd beef up the section of the Justice Department's Civil Rights Division that investigates patterns of constitutional abuses, such as the predatory and profit-driven ticketing system in Ferguson. In the survey, she said she also wanted to double funding for the Collaborative Reform Initiative run by DOJ's Office of Community Oriented Policing Services, which is a process of working with local police that's intended to be less adversarial than civil rights investigations.