C Interview Questions
- 0of 0 votes
AnswersTelephonic interview 1)
- The Hercules May 17, 2008
1) 2) Given a log file with user information select one Random winner from the users. You can use constant memory
2) Given 2 arrays of integers find the common elements of both arrays.
[Discussed different approach using Hashmap, Binary Search Trees, Sorting etc]
3) Discussed different approach to find unique element from a set of 2N numbers where only 1 number is unique
[Discussed different approach XOR, Sorting etc. Asked me to write sorting based approach & send him]| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C Coding Algorithm - 0of 0 votes
AnswersOnsite interview 1)
- The Hercules May 17, 2008
1) Represent a Tic Tac Toe game class.
2) Now write a function IsWinner which takes a player as input and returns whether the player has won or not.
3) Now write a funtion Play which plays the game| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C Coding - 1of 0 votes
AnswersPhone Interview:
- Carbon April 30, 2008
The guy who interviewed me is a project leader at Bloomberg. He was very arrogant and
his english was very poor.
First he asked me to explain what I have worked on at current company. So I explained him the distributed system I built at world's 3rd best research organization. The discussion went on for 30 minutes and at the end He laughed at it and claimed that its not a real distributed system!
He then asked following C++ questions:
1. Can you have private destructor and private constructor ? explain your answer.
2. Can you have virtual constructor ? explain your answer.
3. What design pattern is similar to virtual constructor ?
4. Can you have vector of auto_pointer ? explain your answer.
5. is this code valid:
auto_pointer<Object> a(new Object());
auto_pointer<Object> b(new Object());
a = b;
My Answer: Yes its valid ( I checked in the book later)
but he insisted that this is invalid code! what an idiot.
If he comes on the phone to interview you, just say "No Thanks!"| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C Terminology & Trivia - 0of 0 votes
AnswersA class that many libraries depend on. Now you need to modify the class for one application. When do you need to recompile other libraries.add a constructor? add a data member?change destructor into virtual? add an argument with default value to an existing member function? C++ question.
- RealFakeName April 24, 2008| Report Duplicate | Flag | PURGE
Agilent Technologies Analyst C - 0of 0 votes
AnswersAsked in 1st and 2nd interview at campus placement at IIIT Gwalior.
- Mohit Garg April 20, 2008
An 8 x 8 char array is provided with random letters. You have to tell if a given string occurs.
eg
String to find = "computer"
Array[] = {
b b b b b b b b
b b b c b b b b
b b o b b b b b
b b b m p b t b
b b b u b u b e
b b b t b b b r
b b b e b b b b
b b b r b b b b
}
Ans : Available| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C Algorithm - 0of 0 votes
AnswersConsider the following IDL interface:
- The Hercules April 04, 2008
interface Time_Server
{
// Return the time on the server
string get_timestamp();
};
Write a client that for each command line argument(1) queries the naming service to resolve an object with the name provided on the command-line, (2)uses the object obtained via the naming service to query the time and (3) repeats the process after 60 seconds. Your code should not leak resources, continue to work despite exceptions, print all successful results to standard output & report all errors to standard error.
[There is some supporting code from Automated Trader's desk under the same directory]| Report Duplicate | Flag | PURGE
Automated Traders Desk Software Engineer / Developer C Coding - 0of 0 votes
AnswersOnsite Interview (coding test) --
- The Hercules April 04, 2008
Q3) Now write a derived class Undo_Buffer that derives from Buffer. It will provide the ability to undo the last change to the buffer. It should have a member variable, last_buffer, which is a copy of the internal unsigned char array from the last change to the buffer. For example, if the buffer has "0123456" and undo_buffer[3] = 'z' is called, then the Undo_Buffer class holds the new change value of "012z456".
Undo_Buffer should provide a method undo() which will revert the buffer to the last saved buffer. There does not need to be any access to the last_buffer, except to provide the functionality of undo.| Report Duplicate | Flag | PURGE
Automated Traders Desk Software Engineer / Developer C Coding - 0of 0 votes
AnswersOnsite Interview --
- The Hercules April 04, 2008
Directions
1) Write compiling (& working) code on linux
2) 2 hours.
3) Total questions 6 Mandatory 4(but 3 oky)
Q2) Write a simple buffer class that provides a fixed length of unsigned char. While you should not use the STL to implement the class the class should be written in such a way that it can be used in an STL collection (i.e std::list<Buffer> should work). Instances of Buffer should be allowed to be instantiated with an initial buffer size. Provide a reqize(size_t) method that will shrink or grow the buffer. Provide access to individual elements of the buffer (i.e the ability to get/set the nth element of the buffer)| Report Duplicate | Flag | PURGE
Automated Traders Desk Software Engineer / Developer C Coding - 2of 0 votes
AnswersOnsite Interview --
- The Hercules April 04, 2008
Directions
1) Write compiling (& working) code on linux
2) 2 hours.
3) Total questions 6. Mandatory 4 (but 3 acceptable)
Q1) Write a recursive funciton "sum" that computes the sum of all integers between 0 & n. For example, presented the number 10, it would return -15. Next, write a "main" that will drive the function by calling it for each "valid" argument in the program's argument list. If an argument is not an integer then print out an error message, wiht the double quotation marks.For example calling the program with
a.out 23 -12 foo 7
should result in output like
Sum of all integers between 0 & 23 is 276
Sum of all integers between 0 & -12 is -78
"foo" is not a number
Sum of all integers between 0 & 7 is 28| Report Duplicate | Flag | PURGE
Automated Traders Desk Software Engineer / Developer C Coding - 0of 0 votes
Answers"hELLo wOrLd1"
- dal March 12, 2008
Reverse the characters, upper to lower,
lower to upper, etc...| Report Duplicate | Flag | PURGE
Microsoft Web Developer C - 0of 0 votes
AnswersWhats the difference between a pointer and a reference variable?
- Alfy July 31, 2006| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C Terminology & Trivia