Two recent lawsuits involving tech giants Uber Technologies Inc., Alphabet Inc. and Facebook Inc. underscore the risk that companies may face when an employee walks out the door with trade secrets.

Both lawsuits highlight the question: How can in-house lawyers best protect trade secrets when employees leave?