NVIDIA Interview Question for Software Engineer / Developers


Country: United States




Comment hidden because of low score. Click to expand.
11
of 11 vote

private static BinaryTreeNode convertToMirror(BinaryTreeNode root) {
		BinaryTreeNode temp;
		if (root != null) {
			convertToMirror(root.getLeft());
			convertToMirror(root.getRight());

			temp = root.getLeft();
			root.setLeft(root.getRight());
			root.setRight(temp);
		}
		return root;
	}

- Vir Pratap Uttam May 04, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
5
of 5 vote

void mirror(struct node* node) 
{
  if (node==NULL) 
    return;  
  else 
  {
    struct node* temp;
    
    /* do the subtrees */
    mirror(node->left);
    mirror(node->right);

    /* swap the pointers in this node */
    temp        = node->left;
    node->left  = node->right;
    node->right = temp;
  }
}

- Stupid Developer November 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

These few Anonymous people ruining the careercup. I don't even log into algos account when I post because of them. I'm going to report to Gayle.

-Guest DS

- algos November 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Not just anonymous.

Even people like you (and Urik), with a 'holier than thou' attitude, and arguing your mistakes over and over again...

- Subbu. November 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Lol my mistake was posting 0 fake or real interview questions since coming here?... And calling out trolls whose existence was obvious to me because of similar patterns in their trolling...? I use a fake alias but the admins know my real name. I've yelled at u on chat also for spamming. Neways go ahead and ruin this place as most ppl are too blind to even care. I for one openly recommend any half decent programmer or algorist to seek other forums better than careerc... As this place is garbage.

You aren't even the subbu troll. Ur pretending to be him. Ur some next idiot who fails technical debates often (even though you take long breaks to go study up and iterate ur argument until its nearly airtight. ...often interleaved with other fake aliases that ask for clarification/help.. Then u study and post some nonsense... Finally u post something that's half intelligent...Then claim "haha u guys suck I always meant this and this always been obvious to me".. Then u hold a grudge). U have some serious insecurities that ur trying to pacify with this game of stroking ur ego with fake aliases putting down other fake aliases on a random website like careerc.

U can search and find me upvoting and appreciating many ppl including claiming ppls ideas as better than mine. While ur a dumb fuck pretending to be a dumber fuck.

Neways I've emailed careerc. Support three fucking times in last few weeks to close my account and they still haven't responded. I don't even was a totally fake alias of mine associated with "recursive trollers" like u.

And I don't think algos(Guest DS) above is the real algos. I've seen him chat and they sound different. It is alll some messed up game. I don't see the point. Just increases chatter on this website for no reason.

Anyone using their real name on here should seriously reconsider. Toodles.

Two more observations on u:
1) Ur getting jealous of ppl who post solutions better or before u (obvious)
2) Ur prolly an extreme loner with no access to other ppl to bounce ideas off or get help from. And thus u need to monopolize careerc. With this huge game to praactice coding or get homework/tech help. I wonder what % of the questions being posted recently are from ur fake aliases? Accounts that are created fresh with 0 rep should not be allowed to post all these dumb questions.

And dumbass... Ud have friends if u weren't such a psychopathic weirdo :P. Good riddance and bye. Keep spamming -thumbs up-

- u November 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

LOL.

To bring your technical prowess into picture, let me remind you of some of your gems:

- "It is not as obvious as changing f to T"
- "Ha O(1), O(n) are meaningless"

Dipshit. Try learning and understanding things before acting like the arrogant know-it-all.

FWIW, it was your egotistical comments in the Fibonacci thread which started the downhill comments. Instead of trying to understand what was being said there, you make comments like "Oh, so you end with giving me advice?" and such crap.

Good Riddance, moron.

- Subbu. November 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I haven't test it yet. Hope this could work:

struct Node{
    int value;
    Node* left;
    Node* right;
    Node(int v):value(v), left(NULL), right(NULL){}
};
Node* getMirror(Node* p)
{
    if(p == NULL) return NULL;
    Node* root = new Node(p->value);
    root->left = getMirror(p->right);
    root->right = getMirror(p->left);
    return root;
}

- uuuouou November 30, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think you need to first save the left node's address before you call
root-Left = getmirror(p->right). Isn't it?

- Anonymous December 05, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

node *mirror(node *T)
{
node *p;
if(T!=NULL)
{
p=T->left;
p->left=mirror(t->right);
p->right=p;
}
}

- Anonymous December 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

missed a return statements scroll down for complete

- Anonymous December 19, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

node *mirror(node *T)
{
node *p;
if(T!=NULL)
{
p=T->left;
p->left=mirror(t->right);
p->right=p;
}
return T;
}

- Anonymous December 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Stupid Developer being stupid again.

Better to do it preorder buddy to help with multi-threading on the tree.

- Anonymous November 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

please elaborate, how

- ami November 22, 2013 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

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.

Learn More

Resume Review

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.

Learn More

Mock Interviews

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.

Learn More