Consolidated Statements of Cash Flows - USD ($)
$ in Thousands
12 Months Ended
Mar. 31, 2021
Mar. 31, 2020
Mar. 31, 2019
Cash flows from operating activities:      
Net loss $ (183,619) $ (250,863) $ (183,533)
Adjustments to reconcile net loss to net cash used in operating activities:      
Depreciation and amortization 18,078 22,249 9,901
Amortization and impairment of internal-use software 2,168 1,040  
Stock-based compensation expense 88,425 44,838 37,491
Gain on sale of property and equipment 57 6  
Gain on lease termination (876)    
Impairment of long-lived assets 0 33,213 0
Changes in operating assets and liabilities:      
Accounts receivable (related party amounts of $0, $2,000 and $(2,000) for the years ended March 31, 2021, 2020 and 2019, respectively) 3,912 4,207 (3,889)
Inventories 7,884 (440) 12,524
Deferred cost of revenue 1,163 7,184 5,720
Prepaid expenses and other current assets 2,126 3,379 (2,397)
Operating lease right-of-use assets 10,288 14,557 6,317
Other assets 573 480 330
Accounts payable (related party amounts of $191, $4,231 and $0 for the years ended March 31, 2021, 2020 and 2019, respectively) 137 (29,809) 5,329
Accrued expenses and other current liabilities (related party amounts of $3,517, $(2,599) and $6,147 for the years ended March 31, 2021, 2020 and 2019, respectively) 82 4,916 2,999
Deferred revenue (related party amounts of $(14,917), $251 and $44,805 for the years ended March 31, 2021, 2020 and 2019, respectively) (16,210) (35,333) 15,461
Operating lease liabilities (8,528) (5,431) (4,370)
Other liabilities 88 41  
Net cash used in operating activities (74,252) (185,766) (98,117)
Cash flows from investing activities:      
Purchases of property and equipment (4,054) (68,371) (27,400)
Proceeds from sale of property and equipment 838 765  
Capitalized internal-use software costs (3,320) (5,217) (440)
Net cash used in investing activities (6,536) (72,823) (27,840)
Cash flows from financing activities:      
Proceeds from issuance of redeemable convertible preferred stock (related party amounts of $0, $0 and $272,680 for the year ended March 31, 2021, 2020 and 2019, respectively) 82,500   272,680
Payments for issuance costs of redeemable convertible preferred stock (232)   (394)
Proceeds from exercise of stock options (related party amounts of $67,359, $0 and $67,850 for the years ended March 31, 2021, 2020 and 2019, respectively) 76,151 8,830 72,162
Payments of deferred offering costs (3,084)    
Net cash provided by financing activities 155,335 8,830 344,448
Net increase (decrease) in cash and restricted cash 74,547 (249,759) 218,491
Cash and restricted cash—beginning of period 216,315 466,074 247,583
Cash and restricted cash—end of period 290,862 216,315 466,074
Supplemental disclosures of non-cash investing and financing activities:      
Purchases of property and equipment during the period included in accounts payable and accrued expenses 535 3,221 8,644
Stock-based compensation capitalized for internal-use software costs 637 792 70
Vesting of related party early exercised stock options 91,046 16,962 5,654
Deferred offering costs during the period included in accounts payable and accrued expenses 887    
Reconciliation of cash and restricted cash within the consolidated balance sheets to the amounts shown in the consolidated statements of cash flows above:      
Cash 282,489 207,942 452,747
Restricted cash, current 1,399 1,399 6,353
Restricted cash, noncurrent 6,974 6,974 6,974
Total cash and restricted cash $ 290,862 $ 216,315 $ 466,074