Technical Interview

Home
Technical Interview
Interview Process
Introduction Questions
Quantitative Problems
Google & Microsoft
Algorithms
C/C++ Questions
Java Questions
Data Structures
Fundamental Questions
Puzzles
Resume Tips
Added Recently
Links
Contact Us
Submit Question/Answer

Show a code fragment to prevent a dynamically allocated array from being leaked in the event of a fault

short *pa = null;
try
{
pa = new short[16];
...
}
catch(...)
{
}
if (pa != null)
delete[] pa;