Describe techniques for optimizing R code performance and memory usage when working with large datasets.
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how to make R code faster and leaner on large datasets. Tests profiling, vectorization, preallocation and copy-on-modify, memory-efficient types and packages such as data.table, and options for data larger than memory such as arrow, duckdb and compiled code.