Alonso attended Jesuit High School in Tampa for his first two years of high school, and transferred to Henry B. Plant High School in Tampa to finish high school. He played lacrosse and football as a freshman before deciding to focus solely on baseball. For the baseball team, he was a third baseman. He enrolled at the University of Florida, where he played college baseball for the Florida Gators as a first baseman. He was named All-Southeastern Conference in his freshman year. In 2014, he played collegiate summer baseball with the Madison Mallards of the Northwoods League, and in the summer of 2015, he played for the Bourne Braves of the Cape Cod Baseball League. In 2016, his junior year, he hit .374/.469/.659 with 14 home runs and 60 RBIs in 58 games. He competed for Florida in the 2015 and 2016 College World Series.