Ridesharing platforms such as Didi, Lyft, Ola and Uber are increasingly important components of the transportation infrastructure. However, our understanding of their design and operations, and their effect on society at large, is not yet well understood. From an academic perspective, these platforms present challenges in large-scale learning, real-time stochastic control, and market design. Their popularity has led to a growing body of academic work across several disciplines, with researchers addressing similar questions with vastly different tools and models. Our aim in this chapter is to outline the main challenges in ridesharing, and to present an approach to modeling, optimizing, and reasoning about such platforms. We describe how rigorous analysis has been used with great success in designing efficient algorithms for real-time decision making, in informing the market design aspects of these platforms, and in understanding the impact of these platforms in their larger societal context.