How does R's garbage collection work and when would you call gc()?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how garbage collection works in R and when a manual gc() call is worth making. Tests whether you understand reachability, the generational mark-and-sweep collector, what an explicit call changes, and better ways to control memory use in R code.