Fifteen people were killed in and around the southeastern port city of Chittagong while others were killed inland in an area known as the Chittagong Hill Tracts.
"Several more people are feared trapped in hillside homes buried under heaps of mud. Rescue operations are continuing," a government official in the area said.
The rain over the past five days had flooded large areas in Chittagong and cut roads to the Hill Tracts, bordering India and Myanmar, police said.
Disaster control officials said about 150,000 people had been marooned by the floods and hundreds of homes washed away, mostly in Chittagong, Bandarban in the Hill Tracts and the Cox's Bazar area on the coast near the Myanmar border.
"We are having the worst rainfall in many years," said Jainul Bari, district commissioner for Cox's Bazar.
Most rail links between Chittagong and the rest of the country were suspended late on Tuesday while Chittagong airport was closed after water inundated part of the runway.
Authorities have moved about 300 families from their shanty homes on slopes and have told others to leave quickly.
Weather officials said more heavy rain was expected in the next few days and the flooding might get worse.
Flash floods also hit parts of the country's north and northeast, a police officer in northern Gaibandha district said.