CNNs Versus Transformers Under Data and Latency Limits

MediumDeep Learning

Reported in interviews at Snap

Problem statement

How would you choose between a CNN and a transformer for image moderation on phones? Labeled photos are limited, predictions must be fast, and pretrained checkpoints are available. A small CNN and a small hybrid fit the time limit, while the larger CNN and transformer do not.

Compare the architectures and choose a practical phone model.

Show hint

Ask what each architecture assumes about images or sequences before it sees any data, and what that implies for how much data it needs.

Relevant roles: ML Engineer, Deep Learning Engineer and Applied Scientist.

Related free problems