Sniper. Didnt put any points into melee at all. I just am not good at it, and I dont see how it can be effective against bosses, although some say melee Zero is a really powerful build.
Although I have a lot of high level characters, I dont consider myself a really good player, as I am older and the eyes and reflexes are not what they were. So some may be able to handle UVHM solo without much problem. I also did not have particularly good gear when I started the UVHM playthrough. I switched to playing some of the DLC and did some different classes rather than just keep beating my head against the wall in UVHM mode. I do intend to go back or try it with Zero again or with another class at some point, and as I said, some with better gear or more skill may find it not so difficult.
I played a sniper Zero through VHM and TVHM without a problem. Once I hit UVHM though I kept dying left and right. Enemies just did too much damage and it was getting frustrating.
Then I discovered melee Zero. Who would have thought a skinny guy was such a tank! With the right equipment, UVHM becomes doable without dying all the time. Here is the equipment I recommend:
Solo
Love Thumper shield
Moxxi's Rubi (evisceration is best, +50% melee damage)
Legendary Hunter mod
Slag Rapier (from pirate DLC) +200% melee damage
Cooldown/Melee relic
Stormfront grenade mod (or another grenade that has a 0 sec fuse time and does enough damage to fully deplete your shield)
Co-op
Same as solo except switch the Love Thumper for the Hide of Terramorphous Shield (burn resistant is best IMO). The Love Thumper is much easier to manage but it is one of only a few items in the game that will damage your teammates (spike damage in this case). Learned that the hard way.
Do a Google search for "Zero Melee Build" and you'll get a good list of the skills you want to have in your tree. IIRC, it's almost all the skills in your melee tree minus Grim. Plus you'll want a few in the middle tree.
With the gear above, you deplete your shield to zero which activates all of your shield's roid damage (easiest way is throwing a grenade at your feet). You can then start meleeing with the Rapier and switch out with the Rubi when health gets low (the Rubi gives you ~17% of the damage you do back in health).
You can use Deception to great effect as well which is why the Cooldown bonuses help. Jump into Deception, throw your kunai, and hit the enemy from behind for max damage which will hopefully kill it and restart your Deception. Restarting Deception will allow you to throw your kunai again and begin the process over again.
With your shield fully depleted and meleeing from behind with the Rapier, continuous Deception is devastating. I was seriously floored how much more powerful I was vs a sniper build in UVHM. Even if you can't quit kill your opponent in one hit, you can hit it a few times with Rubi until Deception becomes available again.
A melee build works well with bosses although there is more strategy involved and I suggest watching some Youtube videos to get some good tips.
Hope that helps.