Goldman Sachs Interview Question
AnalystsUnbelievable easy questions!!!!!!Is that so easy to enter GS, or the difficulty is to get an interview?
Compare the questions composed by MS, or G, or A, these are just pieces of cake......
Unbelievable easy questions!!!!!!Is that so easy to enter GS, or the difficulty is to get an interview?
Compare the questions composed by MS, or G, or A, these are just pieces of cake......
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
#include<stdio.h>
- Anonymous January 26, 2011#include<malloc.h>
struct node
{
int value;
struct node *right;
struct node *left;
};
typedef struct node mynode;
mynode *root;
void add_node(int);
void levelOrderTraversal(mynode *);
int main(int argc, char* argv[])
{
root = NULL;
add_node(5);
add_node(1);
add_node(-20);
add_node(10);
add_node(23);
add_node(67);
add_node(13);
printf("\n\n\nLEVEL ORDER TRAVERSAL\n\n");
levelOrderTraversal(root);
}
// Function to add a new node...
void add_node(int value)
{
mynode *prev, *cur, *temp;
temp=(mynode *) malloc(sizeof(mynode));
temp->value = value;
temp->right = NULL;
temp->left = NULL;
if(root==NULL)
{
printf("\nCreating the root..\n");
root = temp;
return;
}
prev=NULL;
cur=root;
while(cur!=NULL)
{
prev=cur;
cur=(value<=root->value)?cur->left:cur->right;
}
if(value < prev->value)
prev->left=temp;
else
prev->right=temp;
}
// Level order traversal..
void levelOrderTraversal(mynode *root)
{
mynode *queue[100] = {(mynode *)0}; // Important to initialize!
int size = 0;
int queue_pointer = 0;
while(root)
{
printf("[%d] ", root->value);
if(root->left)
{
queue[size++] = root->left;
}
if(root->right)
{
queue[size++] = root->right;
}
root = queue[queue_pointer++];
}
}