Dummy Interview Question

How to allocate assets on a portfolio efficiently using Python?