The transcontinental railroad was a masterpiece of work that are country worked on though out the 1860s starting in 1863 and ending in 1869.
Like most other things in history this did not just happen overnight
It took many years of hard work and over those years of hard work the railroad faced many challenges
One the the real big challenges the Central Pacific railroad faced was that they had to cut though the Sierra Nevada Mountains. Winters provided freezing temperatures and avalanches took out whole camps.
The Union Pacific railroad had challenges too. Mostly it was that they were cutting though Native American territory.