Suppose you were the manager of a huge money market fund last year, and were smart enough to have foreseen the sharp drop in interest rates that has taken place. What would you have done?

You would, of course, have at least partially shifted your portfolio to long-term bonds of good quality, knowing that, as interest rates dropped, bond prices would soar--and your shareholders would have a neat capital gain, as the price of these bonds showed a big premium over par.

That is precisely what the World Bank did last year with a $12 billion portfolio, and in this case, the prospective beneficiaries are the less developed countries who borrow from the bank and its related agencies.

The World Bank is not allowed to invest its liquid funds in securities longer than five years. Therefore, Bank Treasurer Eugene Rotberg shifted funds into U.S. bonds of that maximum remaining maturity, and picked up a capital gain of $150 million in just the final six months of calendar 1982.

"It is an actively managed portfolio," Rotberg said in a telephone interview.

The bank announced yesterday that with this gain, total profits on bank operations were a record $448 million in that half-year period, compared with $321 million in the comparable six months in 1981.

How, you may ask, does the bank happen to have a $12 billion pool of money to play around with? Once the bank makes a lending commitment, which may take five or six years to disburse, it borrows part of the money to hold and invest. This "liquidity" may vary from $7 billion to $12 billion, Rotberg said, and the portfolio trades an aggregate volume of about $1 trillion a year. The objective is to earn the maximum amount, pending disbursement.

Another factor in the improved profits picture of the bank was the relatively low borrowing cost of new funds as market rates declined during the year. The average cost on about $8 billion in borrowings from July to December 1982 was 9.1 percent. The average cost of total funds available (borrowings plus equity) was 7.25 percent.

The average return on bank loans is about 9.2 percent, Rotberg said.

To help spread the benefit of more profitable operations among the less developed countries that borrow from the bank, the executive directors yesterday cut the bank's front-end fee for new loans from 0.75 percent to 0.25 percent. This is the second cut recently: on Dec. 7, 1982, the rate was sliced from 1.5 percent to 0.75 percent.

The new, lower fee will be applied to loans for which the negotiation process begins after March 1, 1983. The fee is a one-time charge, which, at the borrower's option, can be capitalized and added to the loan amount. Prior to January 1982, no such fees were charged.

In all probability, the bank also will further reduce its lending rate from the present 10.97 percent charge that was established on Jan. 1, down from 11.43 percent. A decision on this will come up July 1.

As a further reflection of the bank's favorable financial position, the prevailing sentiment of the management and some of the major shareholding countries is to transfer a substantial share of profits to the bank's soft-loan subsidiary, the International Development Association.