27.10.2014 Views

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13 | C++<br />

13.1 Write a method to print <strong>the</strong> last K lines of an input file using C++.<br />

________________________________________________________________pg 215<br />

13.2 Compare <strong>and</strong> contrast a hash table vs. an STL map. How is a hash table implemented?<br />

If <strong>the</strong> number of inputs is small, what data structure options can be used instead of<br />

a hash table?<br />

________________________________________________________________pg 216<br />

13.3 How do virtual functions work in C++?<br />

________________________________________________________________pg 217<br />

13.4 What is <strong>the</strong> difference between deep copy <strong>and</strong> shallow copy? Explain how you<br />

would use each.<br />

________________________________________________________________pg 218<br />

13.5 What is <strong>the</strong> significance of <strong>the</strong> keyword “volatile” in C?<br />

________________________________________________________________pg 219<br />

13.6 What is name hiding in C++?<br />

________________________________________________________________pg 220<br />

13.7 Why does a destructor in base class need to be declared virtual?<br />

________________________________________________________________pg 221<br />

13.8 Write a method that takes a pointer to a Node structure as a parameter <strong>and</strong> returns<br />

a complete copy of <strong>the</strong> passed-in data structure. The Node structure contains two<br />

pointers to o<strong>the</strong>r Node structures.<br />

________________________________________________________________pg 223<br />

13.9 Write a smart pointer (smart_ptr) class.<br />

________________________________________________________________pg 224<br />

CareerCup.com<br />

7 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!