C developer Interview Questions

2K

C Developer interview questions shared by candidates

Top Interview Questions

Sort: Relevance|Popular|Date
Weta Digital
C++ Software Developer - Scene Description API/Tools was asked...August 31, 2015

How do you find the biggest number ?

4 Answers

Sort and use binary search.

If you sorted the list of numbers why would you have to binary search to pick it out? It should either be the first or last one in the list depending on what you past as your comparator. And sorting is slow for this kind of question, since you will be removing and inserting items to figure out which one is the biggest. What they probably wanted to hear is if they didn't want it optimized was a single for-loop with a comparator. This should get done in O(n). If they wanted it optimized, a divide and conquer strategy will find the answer in lesser number of comparisons. If you're looking for a STD solution it's "std::minmax_element(first, last);" Less

You are so right ! Now I can't remember whether the question was to find a target number, or the biggest. If the latter, then for sure that would be the killer reason I failed the interview! Thanks very much for the solution. Less

Show More Responses
STEVENS CAPITAL MANAGEMENT LP

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.

4 Answers

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. Less

Isn’t it true that you should pass 3/3?

They gave me the same test on HackerRank which I did successfully (it passed all test cases). Yet my candidacy was rejected. I used a map container. I couldn't find any container suitable for the job. There may be a better solution which I am was not able to figure out. After reading this post, I am also feeling that they are biased :( Less

Show More Responses
HPC Sphere

As the bond they asked me to submit them my original document (10th 12th and birth certificate) Also if i leave in probationary period i will have to submit 20K

4 Answers

if they caught me red handed babe then why did they called me for the third round??? he was just trying make him superior that's all Less

Are you sure that they asked for your birth certificate ? because no company asks for birth certificate.. I have to face an interview in next 2 days.. so please reply. Less

They asked for 4 documents fourth one I don't remember and even if they didn't ask for birth certificate, it is illegal to ask for any original document and never do submit at any cost. Less

Show More Responses
Bloomberg L.P.

Sequence of numbers in random order and 1 of them is missing how to find that out...

4 Answers

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. Less

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. Less

N(N+1)/2 - sum of the input = missing number

Show More Responses
OpsRamp
C++ Developer was asked...September 28, 2018

Q: Write a program for this: I/P: aaaccedddd O/P: 3a2c1e4d

3 Answers

string str; getline(cin,str) unordered_map charcountMap; for(int i=0;i

string str; getline(cin,str) unordered_map charcountMap; for(int i=0;i

string str; getline(cin,str) unordered_map charcountMap; for(int i=0;i

Crossover for Work

New shares report data on a minute to minute basis with additional information. Please describe how to perform this change without affecting old shares data

3 Answers

If you need help passing the CCAT (hardest part of the process in my opinon) I passed it by studying ruthlessly. I found this site that has the same CCAT as crossovers and just took that a bunch of times. crossoverccat[DOT]com I recommend this for anyone that has the proctored CCAT coming up. The salary is $15 / hr which is really good in my country. 40 hours a week min/max. Less

If you need help passing the CCAT (hardest part of the process in my opinion) I passed it by studying ruthlessly. I found this site that has EXACTLY the SAME CCAT as crossovers and just took that a bunch of times. CROSSOVERCCAT(dot)COM I recommend this for anyone that has the proctored CCAT coming up. It is the SAME test as CROSSOVER for WORK I woulden’t have been able to pass without it! Less

Hello, i have some questions regarding the writing code assessments for the software engineer position. It will be Data structure and Algorithms. would anyone give me advice about how to study for it? Less

Girmiti Software

basics oops questions

2 Answers

Inheritance polymorphism encapsulation abstraction

Inheritance=Inheritance allows use to define The class from which the new class in herits properties data memberand member function is called vase classs and the new created class is clled derived class syntax class derived classs accesss. // data member and member function of derived classs: Polymorphism In simple words we can define polmorpsism as the ability of a meesage to be displayed in more than one from polymorphism important and basic concept of oops. polymorphism in manily divided in to types 1= compile time polmorphism compile time 1 function overloading 2 opertor overloading template 2=rum time polymorphism 1 function overloading Encapsulation= it is one of the most important feature of oops that used to rapping the data and function in to a single unit. The data of class is not accessible to outside the class 4 =Abstraction is the one of the most important feature of oops which is showing only the essential information to the out side would and hiding the intend details abstraction Less

Girmiti Software

OOPS Concepts, Writing a program Code to print the sum of digits of a number

2 Answers

Search the answers in Google. Readily available there.

int k,num; int sum=0; k=num; while (k>0) { sum+=k%10; k/=10; } return sum; Less

Infinidat

Implement a data structure the support the following interface void push(Integer) - O(1) Integer pop() - O(1) - pop the last element that inserted Integer get_middle() - O(1) - get the middle element value get_k(k) - O(K) - get the first k elements values.

2 Answers

A linked list with next an prev pointers pointer to the head of the list , pointer to the tail of the list, and pointer to the middle. also keep a variable that has the size of the list. every push if the size is even move the middle pointer to the next node , otherwise do nothing. keep in mind to move the tail pointer also in every push or pop. Less

class Node { public: int val; Node* prev= nullptr; Node* next= nullptr; }; class LinkedList { Node* root; Node* last; Node* middle; int count = 0; public: void Push(int val) { Node * n= new Node; n->val = val; if (root == nullptr) { root = n; last = root; middle = root; } else { n->next = root; root->prev=n; root = n; if (count % 2 == 0) { middle = middle->prev; } } count++; } int pop() { if (root == nullptr) { return -1; } Node tmp = *root; root = root->next; //free(tmp); count--; if (count != 0 && count != 1 && count % 2 == 0) { middle = middle->next; } return tmp.val; } int Get_Middle() { return middle->val; } int Get_K(int k) { k = k > count ? count : k; Node * nk = last; for (int i = 0; i prev; } return nk->val; } }; Less

Bluebeam

Hacker Rank Test is pretty straightforward. It's a bunch of multiple choice questions, and a coding task. I did not spend the whole 2 hours like some of the other applicant suggested. I guess it really depends on how many years since you've graduated from a computer science program. The take home test is where I failed. They ask you to solve a maze (an image) with a start and goal for both orthogonal and non-orthogonal maze. They say they judge the code based on SOLID principles, performance and originality. They expect you to write this in C# and with visual studio. And if you fail their standards, they don't provide you with any information.

2 Answers

I was told that "We do not expect you to build everything from scratch". So I implemented a A* search algorithm to solve the maze based on pseudo I find on wikipedia. So I concede on that it is not original at all. And I did some unit tests for invalid inputs. The whole thing took me 8 hours. In terms of performance, my algorithm solved the most complicated example maze in matter of seconds. I suspect that they have a some sort of programming rule book that they used to judge your code. It's hardly about actually solving the problem at all. And I heard from the recruiter that they are not in any hurry to fill a position. So they get to be picky. It's not worth spending so much of your time to apply. Less

Do they give you maze in an image file? How did you read that image ? did you convert it in binary format somehow ? Less

Viewing 1 - 10 of 2,122 Interview Questions

See Interview Questions for Similar Jobs