Couchsurfing and airbnb are of your help - where you can find accommodation free of charge or at a reasonable price.
Hostels in the old quarter, near Hoan Kiem Lake, quite low and can be paid only 4-6 dollars for a bed and you'll find yourself in a very clean and decent hostel. Some give visitors free beer.
Overall, for little money the client receives a very high level of service and the hotel itself or hostel in Hanoi.