In this article the inverse heat conduction problem and the inverse Stefan problem with the third kind of boundary condition are solved by applying the immune algorithm. This method has been introduced in recent years and belongs to the group of optimization algorithms inspired by natural processes. In this case the applied algorithm is based on the rules of immune system functioning in vertebrate bodies. It is used for minimizing a functional playing a crucial role in the solution of the problem posed. The algorithm considered is investigated with respect to the parameters which should be chosen in order to provide the most efficient algorithm performance.