Across tech and apparel, companies are looking to solve a puzzle that has long perplexed retailers and customers.