Multilevel paging works by dividing the virtual address in a number of index pits and a page offset.
For a 2-level paging system, we partition the virtual address (logical address) as follows:
It is given that page size is $2^{12}$ bytes. So, the offset should be of 12 bits.
The virtual address is given of 32 bits, and first 8 bits serve as the index into the first level page table.
so, offset = 12 bits, $p_1$ = 8 bits and total address is 32 bits. Asked $p_2$ = ?
32 = 8 + ? + 12
=> ? = 12
So, answer should be 12 bits.