Rivian Interview Question

how and why to use templates in c++?