← Questions

Aligned malloc and matching free in C

0
NvidiaCodingLast asked Oct 2026

A coding interview question asked in Nvidia's technical phone screen, last asked Oct 2026. It tests memory management, c++ and pointers.

Write an allocator in C that hands out memory starting at an address that is a multiple of a requested alignment, and the function that gives that memory back. You may use only the plain malloc and free underneath, not posix_memalign…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

memory management · c++ · pointers

Your code and the AI tutor open when you unlock this question.