Developer C/C++ Interview Questions | Glassdoor

Developer C/C++ Interview Questions

5

Developer c/c++ interview questions shared by candidates

Top Interview Questions

Sort: Relevance Popular Date

Regarding the STL in C++, what is the difference between a Vector and a List?

1 Answer

A Vector stores items in contiguous memory and has constant time lookup and retrieval of information but O(n) time insertion and deletion while the List doesn't necessarily use contiguous memory and has constant time insertion and deletion but O(n) time lookup and retrieval.

Q: Check if a number is a power of 2. Q: Write code for pair-sum(a version of subset sum where the sum of two number is equal to the expected sum, rather than optimization problem, it is decision problem) problem. How to solve it in O(n lg n) and O(n) time. Q: What is the difference of pointer and reference in C++. When to use those ?

2 Answers

I don't do a lot of operator overloading but they asked me to create a complex numbers class. It was pretty straight forward and I had practiced something like it a few days earlier. Overall, the interviewers were very helpful without giving you answers.

1) Write a program that prints fizz at multiples of 3 and buzz at multiples of 5, print fizzbuzz at multiples of 3 and 5. 2) Write a program that solves magic squares problem. no need to be efficient, do it any way you want, fastest way to finish the program. -He recommended using brute force algorithm.

15 of 5 Interview Questions