If you are using fresh pumpkin or squash, begin by peeling it, removing the seeds and core, and cutting the flesh into thin ½-inch slices. Steam for 10 minutes, microwave for 7-8 minutes, or use an electric pressure cooker for 10 minutes until the pumpkin is soft and can be pierced with a fork. Scrape the cooked flesh from the peel, drain any excess water, and mash or blend until smooth. If you are using canned pumpkin purée, you can skip the cooking and mashing steps. Add the sugar to the purée, stirring and tasting until you reach your preferred sweetness.
Gradually add mochiko or glutinous rice flour to the sweetened pumpkin purée, mixing in increments until the mixture forms a soft, putty-like dough that holds its shape when squeezed. If the dough is too sticky or wet, add a bit more rice flour as needed.
Divide the dough into portions weighing about 40 grams each (about the size of a golf ball) and roll into balls. Flatten each dough ball into a ½-inch thick disc. For red bean–filled cakes, take about 30g of red bean paste and roll into balls. Indent the center of the dough disc, place the red bean ball in the center, fold the dough around it to enclose, and shape into a ball, then flatten into a disc. For extra flavor and texture, dip both sides of the formed cakes into a plate of toasted sesame seeds, pressing gently to adhere. I like to press firmly so loads of seeds stick on—they get so nutty and aromatic after frying.
To deep-fry, heat about 2 cups of neutral-flavored oil in a deep pot or wok to 320°F/160°C. Carefully slide the cakes into the oil and fry until crispy and golden brown on both sides, flipping as needed, about 3 minutes total. Drain on a paper towel. To pan-fry, use about ¼ cup oil in a nonstick or cast iron pan, and cook the cakes over medium heat in a single layer until golden and crisp on both sides. I like to pan-fry in smaller batches for better control and less splatter.