When would you prefer vectorisation over loops for performance in R?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: An R programming question on when vectorised code beats explicit loops for performance. It tests whether you understand interpreter overhead, which operations vectorise well, when a loop is still the right choice, and the habits that make R loops slow.