While that is an extreme example, it is permissible. The IRS considers all money withheld from paychecks as meeting the requirements for timeliness, as long as in the end you make the safe harbors.
People change jobs during the year, they have kids during the year, they get married during the year. So your tax situation may change during the year.
A number of years back I sold a rental property and I knew I was going to owe Federal taxes, so I made sure that the last few checks had additional funds to make sure that I meet the 110% safe harbor. The additional amount wasn't as extreme as your example, but it did increase my withhold by $500 a paycheck.
There are limits to this system. The number of allowances don't have to equal the number of kids, or the number of people in the household or any other rule-of-thumb. But if you try and set the number a huge number to drive your withholding to zero, the IRS may take notice:
If an employee claims more than 10 allowances on their Form
W-4, does the employer have to report this to the IRS?
No, this requirement has been eliminated. However, Forms W-4,
Employee's Withholding Allowance Certificate, are still subject to
review. Employers may be directed (in a written notice or in future
published guidance) to send certain Forms W-4 to the IRS. The IRS will
also continue to review employee withholding compliance. The IRS may
send you a letter (commonly called a lock-in-letter) specifying the
withholding rate and allowances to use to calculate the amount of tax
to withhold from wages paid to a specific employee.
Publication 15 (Circular E), Employer's Tax Guide
Tax Topic 753 - Form W-4 - Employee's Withholding Allowance Certificate