Typically this is not done intentionally. If the shell inlet nozzle has a different diameter than the shell outlet nozzle, or if you have an impingement plate, the number of tubes that need to be removed from the inlet area will be different from the number of tubes removed for the outlet area. It's easier to manufacture a heat exchanger with the pass partition baffle right on the horizontal centerline than slightly offset from centerline, so you end up with a slightly different tube count in each pass.
Thank you so much for the reply Mr. Christine !!
We have got a heat exchanger with more than 30 % variation in no of tubes in two passes. Inlet/ outlet sizes are different and there is one impingement plate installed for the shell inlet. 5-10% variation in tubes seems reasonable, but will 30% variation not be quite away from the best efficiency we could achieve with similar exchanger having equal number of tubes..
In your case it was almost certainly done deliberately, possibly in order to have more surface area in the countercurrent pass than the cocurrent pass in order to get better heat transfer. It also could have been designed that way because there's a phase change inside the tubes or because you have a very big change in the tube-side viscosity that requires more flow area on the low-temperature pass to keep the pressure drop down.
A common requirement for shell and tube heat exchangers is that the number of tubes in any tube pass must be within +/- 10% of the average number of tubes per pass.
To answer your question think of the mass continuity of the fluid traveling from one pass to another pass and of the head loss entering and leaving the 1st, 2nd 3rd, etc...pass. As the fluid enters and leave each pass it will either loose temperature( such as in firetube boilers) or gain temperature( such as in a hot water heat exchangers). The designers of these systems will then apportion a certain number of tubes for each pass based the mass rate thru each pass which will remain the same as there will be a change in temperature which changes the density of the fluid decreasing or increasing the volumetric rates of these fluids. In fire tube boilers and hot water heat exchangers the head losses thru each pass will also be nearly the same in each pass. Do hand calculations for the system in your OP to verify.