In 1939, Shahi enrolled in Indian Institute of Science where he joined the Department of Physics, and receiving his BSc in Physics, followed by MSc in applied physics and MA in Mathematics in 1944. Following his master's degree, he joined the faculty of Mathematics teaching undergraduate calculus courses but his parents were unsatisfied of their son being a scientist; therefore, encouraged by his parents, Shahi soon left his position after applying at the Indian Civil Service in 1944. He took the advanced exam, "All India Competitive Examinations", where he excelled and was commissioned in the Indian civil service soon after.
In 1939, Shahi enrolled in Indian Institute of Science where he joined the Department of Physics, and receiving his BSc in Physics, followed by MSc in applied physics and MA in Mathematics in 1944. Following his master's degree, he joined the faculty of Mathematics teaching undergraduate calculus courses but his parents were unsatisfied of their son being a scientist; therefore, encouraged by his parents, Shahi soon left his position after applying at the Indian Civil Service in 1944. He took the advanced exam, "All India Competitive Examinations", where he excelled and was commissioned in the Indian civil service soon after.