If the hesitation is when you accelarate, it could be bad spark plugs and/or wires/distributor cap and rotor.
My 97 did that and it turned out to be bad O2 sensors. If they check out o.k., then it may be the EGR valve.
my 94 maxima did that and the check engine light was on...stalled a lot from that reason, got it checked out and it turned out to be an O2 sensor, when the repair was complete the check engine light went off too.
My '96 Maxima used to hesitate when I was idling, I used carburetor cleaner in the throttle valve (I think that is what it is called), and it is the point after the air in take and after the air filter where it goes into a sliver valve. When spraying it remember to increase acceleration. The car might stall a few times, it says on the back of the cleaner it might stall as well, just start it back up and do again.
On my '92 Maxima, it turned out to be the timing was off.
I have a 99 Maxima (same car) and had this problem. My car stalled and even died on me at stop lights. I replaced the O2 sensor but the car continued to stall. I found out that the factory ignition coils was the problem. I replaced all 6 ignition coils and have not had a problem since.
FYI: If you go to the dealer for 6 ignition coils, they will kill you. it will cost about 800 and more. I had to change one, I got it from www.rockauto.com for 57$ + tx + shipping ended up costing about 80$ and changed it by my self.