Hi quest ,  welcome  |  sign in  |  registered now  |  need help ?

C C++ Technical Interview Questions and Tips

Written By RAM on Wednesday, February 9, 2011 | 6:20 PM


  1. Mutable keyword? 
    1. keyword is the key to make exceptions to const
    2. mutable data member is allowed to change during a const member function
    3. mutable data member is never const even when it is a member of a const object
    4. a const member function may change a mutable member
  2. Something you can do in C but not in C++?C++ applications generally slower at runtime and compilation - input/output
  3. Difference between calloc and malloc? 
    1. malloc: allocate s bytes
    2. calloc: allocate n times s bytes initialized to 0
  4. What will happen if I allocate memory using new & free memory using free? WRONG 
  5. Difference between printf and sprintf?
  6. sprintf: a function that puts together a string, output goes to an array of char instead of stdout printf: prints to stdout 
  7. map in STL? 
    1. used to store key - value pairs, value retrieved using the key 
    2. store data indexed by keys of any type desire instead of integers as with arrays 
    3. maps are fast 0(log(n)) insertion and lookup time 
    4. std::map<key_type, data_type>EX:Std::map<string, char> grade_list //grade_list["john"] = b 
  8. When will we use multiple inheritance? 
    1. use it judiciously class 
    2. when MI enters the design scope it becomes possible to inherit the same name (function/typedef) from more than one base class == ambiguity 
    3. C++first identifies the function thats the best match for the call 
    4. C++resolves calls to overload before accessibility, therefore the accessibility of Elec_Gadget() checkout is never evaluated because both are good matches == ERROR 
    5. resolve ambiguity mp.Borrowable_Item::checkOut(); mp.Elec_Gadget::checkOut(); //error because trying to access private 
    6. deadly MI diamond: anytime you have an inheritance hierarchy w/ more than one path between a base class and a derived classEX:FileInput File Output FileIOFile//File and IOFile both have paths through InputFile and OutputFile 
  9. Multithreading - C++does not have a notion of multithreading, no notion of concurrency 
  10. Why is the pre-increment operator faster than the post-increment operator? pre is more efficient that post because for post the object must increment itself and then return a temporary containing its old value. True for even built in types 
  11. What is a hash and what would you use it for? 
  12. What is a dot product and what is a cross product - what would you use them for? 
  13. What is 2 ^ 101? 

5 comments:

Unknown said...

Hi There,


Great piece on
C C++ Technical Interview Questions and Tips I’m a fan of the ‘flowery’ style Looking forward to more long form articles ??

I am using one dll in my application for including the functionality provided by that dll . This dll I am getting after installing one msi . But in my application I have a requirement like if the user has not installed that msi then we have to show one warning message(e.g msi has not installed , code for this I have implemented in the main() of my application ) and have to exit from the application .


I look forward to see your next updates.


Gracias,
Vinay

Anonymous said...

3. Hi Bru,


Such vivid info on the #topic! Flabbergasted! Thank you for making the read a smooth sail!




The Make Public function in S3 is perfectly working these past few months and years I should say.
Just last week, we are experiencing failure in the "Make Public" function. Once I successfully upload a folder (with multiple files) then Make Public the uploaded files, the notification below shows Failure

Anyways great write up, your efforts are much appreciated.


MuchasGracias,

Unknown said...

Greetings Mate,


Such vivid info on the C C++ Technical Interview Questions and Tips Flabbergasted! Thank you for making the read a smooth sail!

Hello, is it possible to move to a payment model to include Electronic bank transfer? We would like to see AWS supporting a payment method by bank transfer. We use another cloud systems and we are invoiced and pay amont the due, charging monthly for resources used. AWS Training USA






Follow my new blog if you interested in just tag along me in any social media platforms!


Thanks and Regards
Ajeeth

Unknown said...

Sain Bainuu,


Thanks for highlighting this and indicating about C C++ Technical Interview Questions and Tips where more study and thought is necessary.



If I buy a Route 53 domain name, can I create an email address and use it with gmail? If so, how?
I do not want to use Workmail, or SES or an EC2 instance.
All I want is a username, password, and SMTP and whatever else is needed to link my route 53 email to gmail. AWS Training USA




Very useful article, if I run into challenges along the way, I will share them here.


Cheers,
Ajeeth

Unknown said...

SelamatPetang,

Thanks for highlighting this and indicating about C C++ Technical Interview Questions and Tips where more study and thought is necessary. AWS Training

We are currently developing a product that we hope to sell hosted in AWS. We need to understand the cost of operating it and have been attempting some cost modelling. This is difficult since it is quite hard to predict the exact mix of resources that will be consumed, so we have adopted the strategy of running some simulations with computers on our premises pretending to be customers. My problem is the Free Tier services - though I am also extremely grateful for them! As far as I can see, the cost explorer and billing reports simply mark Free Tier services as zero cost - which, of course, they are - during our first 12 months, at least... What I would like is a report which says, in effect, "If you were to run this load without any special offers including the initial 12 months Free Tier, it would have cost you this much..."


I read multiple articles and watched many videos about how to use this tool - and was still confused! Your instructions were easy to understand and made the process simple.

Kind Regards,
Radhey

Post a Comment