MAGMA Interview Question for Software Engineer / Developers






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

What is the website to this company?

- Rayden February 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

magma-da.com

- siva.sai.2020 February 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

/* Iterative Single linked list reverse */
typedef struct node{
	int data;
	struct node *next;
}mynode;

/*
Input: Header node of the Single linked list 
OutPut: Header node of the Reversed Linked list 
*/

mynode * Reverse( mynode * head )
{
	if( head == NULL || head->next == NULL )
	{
		return head;
	}
	else
	{
		mynode *P, *Q, *R;
		
		P = head;
		Q = head->next;
		/* Head become tail node in Reverse list */ 
		P->next = NULL; 
		
		while( Q != NULL )
		{
			R = Q->next;
			Q->next = P;
			
			P = Q;
			Q = R;
		}  
		return P;
	}
}

I used 3 temporary variables P,Q and R, can we reduce temporary variables ?

- siva.sai.2020 February 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think you missed the while loop.

- S February 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I corrected the code . Now it is proper

- siva.sai.2020 February 17, 2011 | 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