Condensed Consolidated Statements of Redeemable Convertible Preferred Stock and Stockholders' Equity (Deficit) (Unaudited) - USD ($) shares in Thousands, $ in Thousands | Total | Common Stock | Additional Paid-In Capital | Accumulated Other Comprehensive Loss | Accumulated Deficit | Redeemable Convertible Preferred Stock |
Beginning balance (in shares) at Jan. 31, 2018 | | 35,700 | | | | |
Beginning balance at Jan. 31, 2018 | $ (338,648) | $ 4 | $ 160,265 | $ 3,403 | $ (502,320) | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | |
Exercise of stock options (in shares) | | 1,869 | | | | |
Exercise of stock options | 15,365 | | 15,365 | | | |
Employee stock-based compensation expense | 362,260 | | 362,260 | | | |
Non-employee stock-based compensation expense | 886 | | 886 | | | |
Accretion of preferred stock | (353) | | (353) | | | |
Issuance of common stock in connection with initial public offering, net of offering costs (in shares) | | 19,314 | | | | |
Issuance of common stock in connection with initial public offering, net of offering costs | 525,299 | $ 2 | 525,297 | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering (in shares) | | 100,350 | | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering | 547,854 | $ 10 | 547,844 | | | |
Conversion of preferred stock warrant to common stock warrant in connection with initial public offering | 848 | | 848 | | | |
Equity component of convertible senior notes | 131,331 | | 131,331 | | | |
Purchase of capped calls related to issuance of convertible senior notes | (67,563) | | (67,563) | | | |
Exercise of warrants (in shares) | | 22 | | | | |
Exercise of warrants | 0 | | | | | |
Net loss | (360,214) | | | | (360,214) | |
Other comprehensive income (loss), net | (6,896) | | | (6,896) | | |
Ending balance (in shares) at Oct. 31, 2018 | | 157,255 | | | | |
Ending balance at Oct. 31, 2018 | 810,169 | $ 16 | 1,676,180 | (3,493) | (862,534) | |
Beginning balance (in shares) at Jan. 31, 2018 | | | | | | 100,226 |
Beginning balance at Jan. 31, 2018 | | | | | | $ 547,501 |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | |
Accretion of preferred stock | (353) | | | | | $ 353 |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering (in shares) | | | | | | (100,226) |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering | | | | | | $ (547,854) |
Ending balance (in shares) at Oct. 31, 2018 | | | | | | 0 |
Ending balance at Oct. 31, 2018 | | | | | | $ 0 |
Beginning balance (in shares) at Jul. 31, 2018 | | 156,786 | | | | |
Beginning balance at Jul. 31, 2018 | 743,470 | $ 16 | 1,555,185 | (2,010) | (809,721) | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | |
Exercise of stock options (in shares) | | 469 | | | | |
Exercise of stock options | 5,048 | | 5,048 | | | |
Employee stock-based compensation expense | 52,126 | | 52,126 | | | |
Non-employee stock-based compensation expense | 53 | | 53 | | | |
Equity component of convertible senior notes | 131,331 | | 131,331 | | | |
Purchase of capped calls related to issuance of convertible senior notes | (67,563) | | (67,563) | | | |
Net loss | (52,813) | | | | (52,813) | |
Other comprehensive income (loss), net | (1,483) | | | (1,483) | | |
Ending balance (in shares) at Oct. 31, 2018 | | 157,255 | | | | |
Ending balance at Oct. 31, 2018 | 810,169 | $ 16 | 1,676,180 | (3,493) | (862,534) | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | |
Accretion of preferred stock | 0 | | | | | |
Ending balance (in shares) at Oct. 31, 2018 | | | | | | 0 |
Ending balance at Oct. 31, 2018 | | | | | | $ 0 |
Beginning balance (in shares) at Jan. 31, 2019 | | 169,303 | | | | |
Beginning balance at Jan. 31, 2019 | $ 614,362 | $ 17 | 1,545,088 | (1,965) | (928,778) | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | |
Exercise of stock options (in shares) | 5,746 | 5,746 | | | | |
Exercise of stock options | $ 62,263 | | 62,263 | | | |
Settlement of RSUs (in shares) | | 5,921 | | | | |
Settlement of RSUs | 0 | $ 1 | (1) | | | |
Tax withholding on RSU settlement (in shares) | | (2,226) | | | | |
Tax withholding on RSU settlement | (125,288) | | (125,288) | | | |
Employee stock purchase plan (in shares) | | 508 | | | | |
Employee stock purchase plan | 23,872 | | 23,872 | | | |
Employee stock-based compensation expense | 154,274 | | 154,274 | | | |
Non-employee stock-based compensation expense | 105 | | 105 | | | |
Net loss | (160,952) | | | | (160,952) | |
Other comprehensive income (loss), net | 774 | | | 774 | | |
Ending balance (in shares) at Oct. 31, 2019 | | 179,252 | | | | |
Ending balance at Oct. 31, 2019 | 569,362 | $ 18 | 1,660,313 | (1,191) | (1,089,778) | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | |
Accretion of preferred stock | 0 | | | | | |
Beginning balance (in shares) at Jul. 31, 2019 | | 175,953 | | | | |
Beginning balance at Jul. 31, 2019 | 566,679 | $ 18 | 1,612,786 | (2,945) | (1,043,180) | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | |
Exercise of stock options (in shares) | | 1,877 | | | | |
Exercise of stock options | 19,815 | | 19,815 | | | |
Settlement of RSUs (in shares) | | 1,777 | | | | |
Settlement of RSUs | 0 | | | | | |
Tax withholding on RSU settlement (in shares) | | (632) | | | | |
Tax withholding on RSU settlement | (39,310) | | (39,310) | | | |
Employee stock purchase plan (in shares) | | 277 | | | | |
Employee stock purchase plan | 13,309 | | 13,309 | | | |
Employee stock-based compensation expense | 53,677 | | 53,677 | | | |
Non-employee stock-based compensation expense | 36 | | 36 | | | |
Net loss | (46,598) | | | | (46,598) | |
Other comprehensive income (loss), net | 1,754 | | | 1,754 | | |
Ending balance (in shares) at Oct. 31, 2019 | | 179,252 | | | | |
Ending balance at Oct. 31, 2019 | 569,362 | $ 18 | $ 1,660,313 | $ (1,191) | $ (1,089,778) | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | |
Accretion of preferred stock | $ 0 | | | | | |