A Muslim is not permitted to engage in usury or pay interest to a bank if he claims it as "bank interest."
And buying an apartment is not a necessity that allows for forbidden behavior, as the need for housing can be met by renting, as many people do today.
Allah says in the Quran: "O you who believe! Fear Allah, and touch not what remains of riba, if you are truly believers. But if you do not, then know that Allah and His Messenger have declared war against you. But if you repent, then the property itself is yours. Do not wrong, and you will not be wronged." (Quran 2:278-279)