Phenom interview question

Problems based on algorithms