LearnWorlds interview question

How can we avoid multiple insert/update db requests within a specific function.