MediaTek Interview Question

How to prevent buffer overflow attacks?