Sensex rises 362 pts, Nifty ends near 23,900; IT stocks lead gains