From Table Tennis to Algorithms

Those who first encounter  Professor Rajiv Gandhi, with his steadfast composure and characteristic solid-colored polos, may find him simple and quiet. However, Rajiv has a hidden energy - one that allows him to memorize all students’ names across 200-person classes and one that materializes as he teaches Mathematical Foundations of Computer Science (CIS 160) and Algorithms and Data Structures (CIS 121) at the University of Pennsylvania. We sat down with Professor Gandhi to learn more about his childhood, his path to academia, his advice to students, and more.


We asked, “Rajiv, if you didn’t go down the computer science path, what do you think you’d be doing?”


“Table tennis.”


Yes, Rajiv Gandhi was a table tennis enthusiast in his childhood days. In fact, with hard work and dedication, Rajiv ranked 6th nationally at the age of 14. He practiced hours each day and even inspired others in his town to be competitively involved with the sport. He added,

“I wanted to help other players achieve success in table tennis. When I was young and started playing, there was no one in my vicinity playing table tennis, but once I started, about 10 to 12 kids in my immediate locality started playing. I would say that I had a small part to play in inspiring them to take up the sport.”

A drive to help others is a common theme we see throughout our conversation with Professor Gandhi; it purposes his strong work ethic. Although he was obsessed with the sport, Rajiv’s parents encouraged him to focus on his academics; eventually, he had to quit.


Rajiv then applied his strong work ethic to academics. After completing his bachelor's in India, he came to the United States, completed a master’s in computer networking, and then worked at Qualcomm. Rajiv mentioned, “it became very clear after being in industry that I wanted to go into academia.” Naturally, we questioned what initially drew Rajiv to computer science, to a Ph.D. in the field, and eventually to instruction. His answer caught us a bit off-guard:

“You see, my life was, in a way, simple. I used to envy people like you in America who had so many choices in life. I didn’t have many choices. I was told ‘You have to become an engineer.’ If you’ve seen the movie Three Idiots, I was one of those - whose life was scripted. I was told ‘Hey, you have to be an engineer. Then you have to go to the U.S., get a masters degree’ and so forth. But, it worked out well for me because I’m not the kind of person that thinks too much. ‘Oh do I like this? Do I not like this? Is this for me?’ Those questions never came to me.”

Professor Gandhi’s intense focus, work ethic, and perseverance allow him to excel in any endeavor. Whether it's playing table tennis or engaging students in complex mathematical proofs, he’s someone who takes the cards he’s dealt and plays his absolute best game. We were still curious - how did Rajiv’s philosophy guide his passion for studying computer science?

“I came into the master’s program with zero computer science knowledge. Imagine, I was a master’s student sitting with 17-year olds in introductory computer science courses; I had a tough time with the subjects I teach now - algorithms, proofs, and induction. Then, I started my job at Qualcomm, who, at the time, offered opportunities for employees to take courses at UCSD. Having completed my formal education, I wanted to use this opportunity to go back to school and fill some holes in my knowledge. I used to study because I wanted to get an A. However, at UCSD, I took courses purely for the sake of learning. Then, it hit me: all this time, I should have studied for the love of learning, not for the grades. With this mindset, I never lost an A grade. I felt terrible about myself! I wanted to at least have one degree where I could be satisfied - and that was my Ph.D. I did my Ph.D. in computer science because that was my background from my master’s. Here, I realized that I loved theory. ”

Rajiv’s approach to learning focuses on an intrinsic desire to learn the subject matter over focusing on the end grade. It’s something most of us have heard at one point or another, but he finally took the advice to heart. His Ph.D. was simply a way for him to act on a new motivation. Naturally, we next asked Rajiv, “What other advice do you have for Penn students regarding how to make the most out of their college experience?” He responded,

“Stop making comparisons between yourself and others. There will always be people  who are doing amazing things. You need to focus on what your strengths are, what you can learn from others, and, most importantly, doing your best… Keep in mind, some of the most successful people were not necessarily 4.0’s. Some of the most successful people had very average transcripts. So I don’t believe that academic performance is an accurate barometer for success.”

Following this advice may help to foster a more collaborative learning environment on Penn’s campus. It boils down to two definitions of success: being the best possible or simply better than the rest. Intent on hearing Rajiv’s definition of success, we asked him how he thought Penn students should define success.

“I think success is what one decides for one’s self.  For me, I consider my students’ success as my success. So my goals and my students’ goals are very aligned. Now, that is also wonderful for the students because they know they have someone who works in their interests. People’s perspectives are different. I think success is defined differently for each person. It is very easy to get caught up when you are at Penn and you see people getting jobs at well-known companies. You may think, “That is success”, and then try to chase after someone else’s achievements. However, I believe it is very important for each of us to define success individually for ourselves.


Stop fearing failure. Stop comparing yourself to others. Take risks and succeed in your own way.”

Rajiv’s emphasis on individually defining what success means is a valuable suggestion. Many students on Penn’s campus speak of Penn’s pre-professional culture, which may proliferate forms of unhealthy competition and generalizes what it means to be successful. By understanding what your goals and aspirations are, you will be able to better enjoy your college and post-college years sans the critical comparison.