The literary device used in the sentence "He did not realize that his last chance was walking out the door" is:
B. Human traits are applied to an abstraction or nonhuman object.
In this sentence, the "last chance" is personified as if it can "walk out the door," attributing human behavior to an abstract concept.