Hat Yai can be a great destination for foodies, as just about every type of Thai, Malay and Chinese food can be found here. However, as with the hotel scene, you won't find much of anything that's very fancy. Most of the food options are food carts and street stalls, many of which are concentrated in a few areas around town.
With most of the food scene on the street, there are very few restaurants I can actually recommend. B's Sweet is a small café catty-corner to the Odeon Department store, about a block down from the Lee Gardens Mall. There are, as the name suggests, a case full of cakes as well as ice cream on offer, but the place also serves a menu of simple Thai dishes. Boat Bakery, down across from the old Kosit hotel also does some good, basic food.
For coffee or an afternoon snack, I would highly recommend E.P's Artisan Bakery on Nipathuthit 1 Road. It is by far the poshest place I found in town, and can be quite a comfortable spot to pass the time. The coffee is good, as are the cakes.
For fast food and the big Thai chains, your best option is the Lee Gardens Mall more or less in the center of the tourist area. You'll find the international chains like McDonald's and KFC as well as local operations like MK Suki.