The sharing economy has helped to transform many aspects of our day-to-day lives, leveraging the IT revolution in increasingly novel ways. At the same time, the sharing economy presents new computational challenges to provide tools to support the operations of these emerging industries. Although perhaps not quite as visible in impact as Uber and Airbnb (and their competitors), bike-sharing systems have fundamentally changed the urban landscape as well. Even in a city as notoriously inhospitable to cycling as New York, Citibike has emerged as a significant player in the city’s transportation network, supporting more than 1.5 million rides per month for a subscriber base of roughly 100,000 individuals. We have been working with Citibike to develop analytics and optimization models and algorithms to help manage this system. The key challenge is to cope with huge rush-hour usage that simultaneously creates stark shortages of bikes in some neighborhoods, and surpluses of bikes (and consequently, shortages of parking docks) elsewhere. We will explain how mathematical models can be used to answer questions such as, how should we position the fleet of bikes at the start of a rush hour, and how should we mitigate the imbalances that develop? Since a fundamental aspect of the behavior of these systems is the fluctuation in traffic patterns that vary over time, the resulting mathematical questions fall in the domain of stochastic optimization, where we develop a probabilistic model of the demand, and then optimize the expected performance of the system over a planning horizon. We will also describe some of the algorithmic challenges that these models pose, and highlight the computational tools developed to address them.