YMMV when it comes to bikes. About 3 years ago I bought a cheap bike from Canadian Tire, and on the first day riding it to work, both pedals broke off.
It's like most things, buy the literal cheapest item you can and it'll probably be shit. Buy something in the lower middle of the price range and it'll probably serve you well for most uses. With bikes, that's probably $300-600.
Did both pedals break off at the same time? If not, how did you keep riding with only one pedal? This sounds like the beginning of a great story!
One pedal broke off, then I tried riding with one foot on the crank arm, and the other on the pedal. A couple seconds later, the other pedal broke off.
Apparently it was a pretty common issue with the series of bikes.