Senior C Developer Interview Questions | Glassdoor

# Senior C Developer Interview Questions

22

Senior c developer interview questions shared by candidates

## Top Interview Questions

Sort: Relevance Popular Date

May 3, 2011
 Sequence of numbers in random order and 1 of them is missing how to find that out... 5 Answers N(N+1)/2 - sum of the input = missing number It isn't stated that sequence starts from 1. The sequence could be 8,9,5,6! If the sequence is guaranteed to contain only positive integers, it can be done like so: Read in the sequence, noting the MIN and MAX numbers. The sum IF it started from 1 would be MAX(MAX-1)/2. The sum of the 'missing' numbers (from 1 up to where the sequence actually starts) is (MIN-1)*MIN/2. The missing number is given by taking the difference between the two: X = [MAX*(MAX-1) - (MIN-1)*MIN]/2. Show More Responses Oops, in addition to what I put above there is a final step to get the actual answer. The missing number is equal to X minus the sum of the numbers given. You can graph them similar to a convex hull question. If all nodes were there the sequence would be increasing on some percentile or relative like amount. The missing node will yield an abnormality in the changes in slopes between each node. The only assumption you would have to make, which in all honesty just has to be accepted is that its not the first or the last element that's missing.

May 3, 2011
 5 adjacent parking spots. whats the probability 2 cars next to each other 2 Answers 40% Assuming the situation is that 2 cars park in these spots, what is the probably that they park next to one another, then the answer is indeed 40%. There are 20 different possible scenarios (5 spots for the first car to park in, times 4 for the second car). If the first car parks on either end (2/5 chance), then there is a 1/4 chance that the second car will park next to the first. If the first car parks in the middle 3 spots (3/5 chance), there is a 2/4 chance that the second car will park next to the first. The combined probability for the cars parking next to each other is (2/5 * 1/4 + 3/5 * 2/4 = 8/20 = 40%).

### Senior C++ Developer at Bloomberg L.P. was asked...

Dec 11, 2009
 how does a reference counting smart pointger work? 1 Answer I remeber the smart pointer is a class with a pointer member which points to the actual object and a counter member to record how many pointers point to the object. If the number of the counter is 0, then call the destructor function to delete the object. This smart pointer is to provent dangle pointer.

### Senior Software Developer C++ at Bloomberg L.P. was asked...

Aug 11, 2014
 well all questions are expected, string reverse without reversing words for example " this is sentence" => "sentence is this", write c++ code to do so 2 Answers use pointer solution to mark start, end of each word, do not use any additional memory 1) first reverse the entire string in place, which results in the spaces and words being in the right place for the final result, but each word is backwards 2) scan thru the string again and reverse each word in place.

### C++ Senior Software Developer at Solomon-Page Group was asked...

Oct 16, 2012
 What is the best case lookup time for a hash table? 1 Answer Constant-time.

### C++ Senior Software Developer at Solomon-Page Group was asked...

Oct 16, 2012
 How can you make a program print out "Hello World" before entering the main() function? 1 Answer declare the printout in the constructor of a "const" object

### Senior C++ Developer at STEVENS CAPITAL MANAGEMENT LP was asked...

Apr 6, 2017
 Very simply question of inserting latest 5000 records in container along with timestamp and retrieve them as needed and discard which are older then 5000. 1 Answer The code was successfully written in HackerRank, which successfully compiled, passed 2/3 test cases and still they rejected candidate with Master Degree in Computer Engineering from US University and 20 years of proven record of writing the same code for many other Wall St. Clients.

### C++ Senior Software Developer at Solomon-Page Group was asked...

Oct 16, 2012
 What 4 functions are automatically generated for a class by the c++ compiler? 1 Answer constructor, destructor, assignment operator, copy constructor

### C++ Senior Software Developer at Solomon-Page Group was asked...

Oct 16, 2012
 What is 40>>2 1 Answer 10

### C++ Senior Software Developer at Solomon-Page Group was asked...

Oct 16, 2012
 When is Bubblesort faster than Quicksort 2 Answers When the array is already sorted. when input is sorted
110 of 22 Interview Questions

More