Question d’entretien chez Amazon

How would you write a garbage collection algorithm for Java?