Oribi interview question

Write an algorithm for saving different object in collection