v3.19.3.a.u2
Consolidated Statements of Cash Flows - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2019
Dec. 31, 2018
Dec. 31, 2017
Cash flows from operating activities      
Net loss $ (1,033,660) $ (1,255,911) $ (3,445,066)
Adjustments to reconcile net loss to net cash used in operating activities:      
Depreciation and amortization 87,245 91,648 61,288
Stock-based compensation 686,013 538,211 2,639,895
Deferred income taxes (491) (383) (17,490)
Gain on divestiture (39,883) 0 0
Amortization of debt discount and issuance costs 17,797 0 0
Lease exit charges 0 33,033 0
Excess inventory reserve and related asset impairment 0 0 21,997
Other (28,575) (903) (6,356)
Change in operating assets and liabilities, net of effect of acquisitions:      
Accounts receivable, net of allowance (147,862) (77,506) (104,357)
Prepaid expenses and other current assets (9,849) 1,594 (39,783)
Operating lease right-of-use assets 58,199 0 0
Other assets 1,169 21,785 (4,771)
Accounts payable 20,674 (33,532) 49,696
Accrued expenses and other current liabilities 146,063 (14,325) 100,988
Operating lease liabilities (60,844) 0 0
Other liabilities (954) 6,365 9,292
Net cash used in operating activities (304,958) (689,924) (734,667)
Cash flows from investing activities      
Purchases of property and equipment (36,478) (120,242) (84,518)
Sales of property and equipment 0 11,276 0
Proceeds from divestiture, net 73,796 0 0
Cash paid for acquisitions, net of cash acquired (77,119) (815) (386,011)
Non-marketable investments (5,481) (22,495) (10,030)
Purchases of marketable securities (2,477,388) (1,653,918) (3,862,637)
Sales of marketable securities 184,179 45,007 511,068
Maturities of marketable securities 1,608,854 2,438,206 2,483,225
Other 1,029 (2,565) (8,107)
Net cash provided by (used in) investing activities (728,608) 694,454 (1,357,010)
Cash flows from financing activities      
Proceeds from issuance of convertible notes, net of issuance costs 1,251,411 0 0
Purchase of capped calls (102,086) 0 0
Proceeds from the exercise of stock options 16,527 47,988 11,379
Stock repurchases from employees for tax withholdings 0 (551) (394,156)
Proceeds from issuance of Class A common stock in initial public offering, net of underwriting commissions 0 0 2,657,797
Payments of deferred offering costs 0 0 (9,672)
Net cash provided by financing activities 1,165,852 47,437 2,265,348
Change in cash, cash equivalents, and restricted cash 132,286 51,967 173,671
Cash, cash equivalents, and restricted cash, beginning of period 388,974 337,007 163,336
Cash, cash equivalents, and restricted cash, end of period 521,260 388,974 337,007
Supplemental disclosures      
Cash paid for income taxes, net 156 3,598 6,226
Supplemental disclosures of non-cash activities      
Net change in accounts payable and accrued expenses and other current liabilities related to property and equipment additions $ (6,027) $ (7,764) $ 13,139