ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 


 

Company >> Goldman Sachs >> Goldman Sachs Questions
 
 Goldman Sachs interview questions  Goldman-Sachs Interview Questions (11)  Goldman Sachs aptitude test questions  Goldman-Sachs Aptitute Test Questions (1)
 
Back to Questions Page
Question   why you need store procedure ? where do we use it in a Java project? can you get the code for as store procedure using in Java? Rank Answer Posted By  
 Interview Question Submitted By :: Krishna
I also faced this Question!!   © ALL Interview .com
Answer
Stored procedure nothing but the set of SQLs which is
executed an controlled by database itself.Its useful when
you want to use the data from tables to be access
frequently.yes, we can get the same SQLs in java code as
well. Infact using Callable , stored procedures can be called.
 
0 Guest
 
 
Question   GoldMansachs Interview process.... Rank Answer Posted By  
 Interview Question Submitted By :: Raghu
I also faced this Question!!   © ALL Interview .com
Answer
Written test followed by Interview
Written Test: 1 hour 20 minutes Duration 
15 questions on java, SQL,C++ total 45 Q
you need to pick up 2 sections , i choose Java and C++
total 30 q + 15 q on Analytical its mandatory
all together 45 questions
there is one  Subjective questions on java, SQL,C++ 
you need to pick 2 out of 3 
So all of them need to be answered in 1 hr 20 min ....


after 2 hours results are announced
i cleared  Written test 
then interview : asked about singleton model , som basics of 
java and 10! recursion .. later genral questions...

 
3 Raghu
 
 
Question   what will happen if ac power supply is given to the rotor of an alternator Rank Answer Posted By  
 Interview Question Submitted By :: Sharif
I also faced this Question!!   © ALL Interview .com
Answer
Actually the type of flux produced in the rotor after 
giving excitation (dc current)is constant.then the rotot 
will be rotated by a Motor or turbine will cause emf 
induced inthe rotor. if we give ac current to the rotor the 
flux is variabe and cause emf induced in the stator and 
start it will act as a motor. but we are forcely rotating 
roator by turbine the rate of change of flux will be 
zero.so that there is no emf will induce.
 
0 Rajesh
 
 
 
Question   What is PBDIT? Rank Answer Posted By  
 Interview Question Submitted By :: H.k.tripathi
I also faced this Question!!   © ALL Interview .com
Answer
PROFIT BEFORE TAX
 
1 Pawan Shrivas
 
 
Answer
Its PROFIT BEFORE DEPRECIATION INTEREST AND TAX
 
5 Asha
 
 
Answer
profit before deduction of interest & tax
 
0 Madhavi
 
 
Answer
PBDIT = Profit before DEP+INT+PROFIT/Net Sales

This is in the case of Proprietorship
 
0 Ambuj Shekhar
 
 
Answer
profit befor depresation intrest & tax
 
0 Sravan Kumar Yerram
 
 
Answer
profit before depreciation interest & tax
 
3 Tarun Kumar
 
 
Answer
PBDIT Means Profit befor depresation, interest, and tax
 
5 Mohan Saini
 
 
Answer
it is profit before depreciation interest and taxes. pls 
luk link of dictionary meaning of it  
http://en.wikipedia.org/wiki/PBDIT
 
0 Karma
 
 
Answer
PBDIT IS profit before depriciation intrest tax
 
0 Pawan
 
 
Question   A company given a party in order promote the company to its customer in a hotel then hotel provide some food & services to the customers of the company. should TDS deducted on payment made to hotel's bill? if payment is near about 35000/-. Rank Answer Posted By  
 Interview Question Submitted By :: Aamirdeba
I also faced this Question!!   © ALL Interview .com
Answer
You can bifercate the bill.  You can avoid TDS on Meals & 
Bufate expenses.  you can deduct TDS on Room Rent services 
and other services.  If the room rent and other serives 
total exceed Rs.20,000/- you can deduct TDS on the 
applicabled amount @ 2% (no edu. cess).  If the room rent 
and other services below Rs.20,000/- no need to deduct TDS.
 
0 Ch.v. Apparao
 
 
Answer
only room rent above 180,000.00 than you deducted TDS @10%
 
0 Chetan Singh
 
 
Question   What is the difference between Indian GAAP and Accounting Standards. Rank Answer Posted By  
 Interview Question Submitted By :: Roberto Salgado
I also faced this Question!!   © ALL Interview .com
Answer
GAAP Stands for Generally Accepted Accounting Principles.
Accounting Standardards are issued by the Institute of 
Chartered Accountants of India (ICAI).  This is the largest 
accounting body in the country. Now the Accounting 
Standards are 29.Accounting Standards are prepared by 
export persons.Generally Accepted Accounting Principles 
means just like Accounting Concept which means every person 
can accept this principles.
 
2 M.kishore Kumar
 
 
Answer
Canadian GAAP consists of some changes with respect to the
one in India
 
3 H|l
 
 
Question   Given three sides of a triangle. Write the Program to determine whether the triangle is : 1) Invalid 2) Right Angled 3) Isoscales 4) Equilateral 5) Not Special An Isoscales right angled triangle should be taken as a Right Angled Triangle Rank Answer Posted By  
 Interview Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
if a, b and c are the three sides of a triangle, then a + b > c
if this is not satisfied, then its not a valid triangle.

To check for right angle, use Pythagoras theorem. Assume
that the longest side is the hypotenuse.

Issosless and Equilateral can be found by simply comparing
the sides.
 
5 Sunil
 
 
Answer
One should check for valid sides also. Side values dhould 
be greated than ZERO.

Here is the correct routine: 
	public static String checkTriangle(int[] 
triangleSide){
		boolean validTriangle = false;
		boolean validSides	= true;
		String result = "NOT VALID TRIANGLE";

		for(int side: triangleSide)
			if(side <= 0)
				validSides	= false;
		
		if(validSides){
			for(int count= 0; count< 3 ; 
count++){
				if(((triangleSide[count%3] 
+ triangleSide[(count+1)%3]) > triangleSide[(count+2)%3]))
					validTriangle = 
true;
			}
	
			if(validTriangle){
				if( triangleSide[0] == 
triangleSide[1] && triangleSide[2] == triangleSide[1])
					result 
= "EQUILATERAL";
				else{
					for(int count= 0; 
count< 3 ; count++){
						
						if( ( 
triangleSide[count%3] * triangleSide[count%3] + triangleSide
[(count+1)%3] * triangleSide[(count+1)%3]) == (triangleSide
[(count+2)%3] * triangleSide[(count+2)%3])){
						
	result = "RIGHANGLED";
						
	break;
						}else
							if
((triangleSide[count%3] == triangleSide[(count+1)%3]))
							
	result = "ISOSCALAUS";
					}
				}
				if("NOT VALID 
TRIANGLE".equals(result))
					result = "NOT 
SPECIAL";
					
			}
		}
		
		System.out.println(result);
		return result;
	}
 
2 Giri
 
 
Answer
I believe, this is more efficient one. solves all the cases.. comments please. Written in java

public static Map validateTriange(int a,int b,int c)
{
	Map props = new HashMap();
	boolean isValidTriangle;
	
	int bigSide = a;
	if(bigSide<b){bigSide = b;}
	if(bigSide<c){bigSide = c;}
	
	boolean isSpecial = false;
	
	if((a+b+c-bigSide)>bigSide)
	{
		props.put("VALID","YES");
	}
	else
	{
		props.put("VALID","NO");
		return props;
	}
	
	if(a == b||b==c||c == a)
	{
		props.put("ISOSCELES","YES");
		isSpecial = true;
	}
	
	if(a == b && b == c)
	{
		props.put("EQUALATERAL","YES");
		isSpecial = true;
	}
	
	
	if(((a*a+b*b+c*c)-bigSide*bigSide) == bigSide*bigSide)
	{
		props.put("RIGHT_ANGLED","YES");
		isSpecial = true;
	}

	return props;
}
 
0 Ganesh Bhat
 
 
Question   Write a Pseudo Code to fins the LCM of two given numbers Rank Answer Posted By  
 Interview Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
#include <iostream>
using namespace std;
int main()
{
	int x,y,z;
	cout<<"Enter First Integer:";
	cin>>x;
	cout<<"\nEnter Second Integer:";
	cin>>y;
	z=1;
	while(x/z==1 && y/z==1)
	{
		z=x/y;
		cout<<"The LCM of Both Numbers is:"<<z;
	}
	return 0;
}
 
0 Shailendra
 
 
Answer
#include<iostream>
using namespace std;
int LCM(int a,int b);
int main()
{
    int a,b;
    cout<<" ENTER TWO NUMBER : ";
    cin>>a>>b;   
    cout<<"\n\n LCM : "<<LCM(a,b);
    system("pause");
    return 0;
}
int LCM(int a,int b)
  {
    int n;
   for(n=1;;n++)
    {
  	if(n%a == 0 && n%b == 0)
  	  return n;
     }
}
 
3 Zain
 
 
Answer
int gcd(int a, int b)
{
if (a==0 && b==0) return -1;
if (b==0) return a;
return gcd(b,a%b);
}


int lcm (int a, int b)
{
return (int) (a*b)/gcd(a,b);
}
 
0 Sudhir
 
 
Answer
public class LCM {

	public static void main(String a[]){
		test(0,9);
	}

	static void test(int a,int b){
		if(a==0 || b==0){
			return;
		}
		int n;
		int increment;
		if(a>b){
			n = a;
			increment = a;
		}else{
			n = b;
			increment = b;
		}
		
		while(true){
			if(n%a == 0 && n%b == 0){
				break;
			}else if(n > (a*b)){
				n = a*b;
				break;
			}else{
				n = n+increment;
			}
		}
		
		System.out.println("LCM for "+a+" and "+b+" is "+n);
	}
	
}
 
0 Khadanga
 
 
Answer
#include <stdio.h>


main()
{
int a,b,n=2,res=1;
printf("Enter two integers : ");
scanf("%d %d",&a,&b);
while((a!=1)||(b!=1))
{
    if((a%n==0)&&(b%n==0))
    {
        a/=n;
        b/=n;
        res*=n;
    }

    else if((a%n==0)&&(b%n!=0))
    {
        a/=n;
        res*=n;

    }

     else if((a%n!=0)&&(b%n==0))
    {
        b/=n;
        res*=n;

    }

    else if((a%n!=0)&&(b%n!=0))
    {
        n++;
    }

}
printf("\n LCM of a and b is %d",res);

}
 
0 Mohit
 
 
Question   Write a Pseudo Code to find the angle between two hands of a clock for a given time. Rank Answer Posted By  
 Interview Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
#include<stdio.h>
int main()
{
	
int angle,hour,minute;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);
 
if(hour > 12) // In case of 24 hour clock 
{
	(int)angle = hour * 30 - minute * 6; 

if(angle > 180) 
angle = 360 - angle;
printf("%d\n", angle);
}
else
printf("bye\n");

return 0; 
}
 
0 Mamun
 
 
Answer
#include<stdio.h>
int main()
{
	
int angle,hour,minute;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);
if(hour < 12) // In case of 24 hour clock
hour=hour+12;//to make the hour in 24 hour format;
{
	(int)angle = hour * 30 - minute * 6; 

if(angle > 180) 
angle = 360 - angle;
printf("The angle between the two handle is: ");
printf("%d\n", angle);
}

return 0; 
}
 
0 Spacious Mamun
 
 
Answer
#include<stdio.h>
int main()
{
	
int angle,hour,minute;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);
 
if(hour > 12) // In case of 24 hour clock 
{
	(int)angle = hour * 30 + minute / 2 - minute * 6; 

if(angle > 180) 
angle = 360 - angle;
printf("%d\n", angle);
}
else
printf("bye\n");

return 0; 
}
 
0 Samer El-haj-mahmoud
 
 
Answer
#include<stdio.h>

main()
{

        int hr,min;
        double angle;
        printf("Enter hour and minute in 24 hr format\n");
        scanf("%d %d",&hr,&min);
        angle=30*hr+(double)min/2-min*6;
        if(angle<0) angle*=-1;
        while(angle>180) angle-=180;

        printf("%.2f\n",angle);
        return 0;
}
 
0 Fanatic
 
 
Answer
le angle;
        printf("Enter hour and minute in 24 hr format\n");
        scanf("%d %d",&hr,&min);
        angle=30*hr+(double)min/2-min*6;
        if(angle<0) angle*=-1;
        while(angle>180) angle-=180;

        printf("%.2
 
0 Thsghdth
 
 
Answer
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int hour,minute;
float angle;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);
if(hour>12)
{
hour = hour-12;
}
    angle = hour * 30 + minute*0.5 - minute * 6;
    if(angle>180)
    {
       angle = 360 - angle;
    }
if (angle < 0 )
{
    angle = angle * (-1);
}
printf("%f \n", angle);
return 0;
}
 
0 Batchu
 
 
Question   Memory is not a constraint. In a single iteration(NOTE: you can't go back), how will you find out the 10th last node/item in a linked list. Rank Answer Posted By  
 Interview Question Submitted By :: Ashutosh
I also faced this Question!!   © ALL Interview .com
Answer
	List *nodes[10]; //asked 10th last, so, only 10 items
	int pos = 0;

	List *ptr = &FirstNode

	while(ptr)
	{
		nodes[(pos%10)] = ptr;
		pos++;
		ptr = ptr->next;
	}
	if(pos>=10)
	{
		printf("Tenth last element is %d",nodes[(pos-10)%10]->data);
	}
	else
	{
		printf("There doesn't exist any 1oth last element");
	}
 
0 Ashutosh
 
 
Answer
Ashutosh,

Can you explain how your answer sync with the question?
 
0 Mms Zubeir
 
 
Answer
simple,

in case the list has say 90 elements, then for every 10
elements, he is writing to the array. though the array size
is 10, this is done by saying pos%10.
thus when the list is iterated he just substracts 10 from
the pos and then does %10 since he has to factor in, that
array starts from 0 and not from 1 :)
 
0 Ravindra
 
 
Answer
Assume the list is a circular one (implemented by pos%10).
So, when you are iterating, you are going round and round in
a circle. When you reach the end, you just have to go back
exactly 10 items. By going back here means accessing the
element 10 position prior to the current one, which is
implemented by (pos-10)%10

Since, it's a circular array as assumed, you have always
access it by doing pos%10 or (pos-10)%10.

NOTE: The value of pos has always been incremented and never
decremented or set to zero.
 
0 Ashutosh
 
 
Answer
I got it, thank you.

but one suggestion, instead of using

printf("Tenth last element is %d",nodes[(pos-10)%10]->data);

you can simply give,
printf("Tenth last element is %d",nodes[pos%10]->data);
 
0 Mms Zubeir
 
 
Answer
NO, it won't work.

because, after the wile loop, pos is pointing to the last
element NOT 10th last. So, you have to go back 10 elements.
 
0 Ashutosh
 
 
Answer
ListNodePtr* tenthListNodePtr = NULL; //Holds 10th last node

ListNodePtr* tempListNodePtr = firstNode;

int counter = 1;

//Advance the tempListNodePtr to 10th node from first //node.
while( (counter < 10) && (tempListNodePtr) )
{

     tempListNodePtr = tempListNodePtr->nextNode;

     ++counter;
}

tenthListNodePtr  = firstNode;

//Advance both the pointers. also check for cycle. 
// Since two ptrs differ by 10, when last node is reached
//the result will be there.
while( (tempListNodePtr) && (tempListNodePtr != firstNode) )
{

tenthListNodePtr = tenthListNodePtr->nextNode;

tempListNodePtr = tempListNodePtr->nextNode;

}
 
0 Vivek
 
 
Answer
ahutosh ,the kid is right pos% 10 will do fine,,are u
nuts,work on basic maths
 
0 Dg
 
 
Answer
suppose list is already created having some elements 
poninted by start ......
node* start;
node*p[10];
node* ptr;
int n=0;
ptr=start;
while(ptr->next==null)
{
p[(n++)%10]=ptr;

}
if(n<10) printf("there r unsufficient elements");
else { ptr=p[n%10]}
 
0 Atul Bodke
 
 
Answer
correction in prev answer ...
i saw it after posting ... :)
correction in while loop ...
while(ptr!=null)
{
p[(n++)%10]=ptr;
ptr=ptr->next;
}
................................
 
0 Atul Bodke
 
 
Answer
Cant we simply check it using 10 dereferencing.

ptr -> ptr -> ptr -> ptr -> ->ptr and so on...

This could be generalized for n, as we could generate this
command string on the fly  and execute the command ..
 
0 Aaptuster
 
 
Answer
The approach is to have 2 ptrs ,ptr1 and ptr2.Where ptr1
would start at the first node of the linked list and ptr2
would be at the kth position from ptr1.In this case k=10.

From there on until ptr2->next!=null keep moving ptr1 and
ptr2 by one each.When ptr2 reached the last element of the
linked list.Ptr1 would be pointing to the 10th (kth) last
element.

Example:

1->2->3->4->5->6->7->8->9->10->11->12. In this case 10th
last element would be 3.

Start with ptr1 at node 1 and ptr2 at node 10.
Now till ptr2->next!=null ptr1=ptr1->next and ptr2=ptr2->next.

This way when ptr2 reaches 12 ptr1 would be at 3,which is
the 10th last element.
 
0 Ranjani
 
 
Answer
it can be just done tis way!!
temp=first;
while(temp->link->link->link->link->link->link->link->link-
>link!=NULL)
{
temp=temp->link;
}
printf("%d",temp->data);
 
0 Rohith
 
 
Answer
Have two pointers p1 and p2.p1 points to the first node in the linked list.p2 to the tenth node.Now move both the pointer togther till p2->link = NULL.P1 is pointing to the 10th node from the last
 
0 Anon
 
 
Answer
Maintain a queue with ten elements. As u encounter a new
element in the linked list dequeue one element and enqueue
this new element. When the link list is fully scanned the
first element of the queue would be the 10th last element.
 
0 Mayank Pathak
 
 
Answer
1-TAKE TWO POINTERS
2-ITERATE 1 POINTER IN THE LIST UP TO THE 10th POSITION FROM STARTING 
3-INITIALLY----2nd POINTER IS AT THE HEAD NODE .
4-NOW INCREEMENT both POINTER TO THE NEXT POTISION SUCH THAT THE 
1st pointer reaches end .
5--2ND POINTER IS THE REQUIRED NODE
 
0 Dark Knight
 
 
Question   what is the difference between SAX Parser and DOM Parser?? Rank Answer Posted By  
 Interview Question Submitted By :: Sandya
I also faced this Question!!   © ALL Interview .com
Answer
1. sax is an event based parser and raise and event, while 
dom is not 
2. sax is forward only where as dom can acess both was 
forward as well as backwards.
3. sax parses the file as it reads where as the dom loads 
the file into memory to parse the file.
4. Sax does not have memory constraints where as the dom 
has momory constraints as xml file is loaded into the 
momory to parse the file.
5. sax is read only , dom is read and write both.
6. if you have to parse and use the content only once , 
consider using sax if the xml file and content are used 
extensively then consider using dom
 
3 Guest
 
 
Answer
Both SAX and DOM are used to parse the XML document. Both
has advantages and disadvantages and can be used in our
programming depending on the situation
SAX:
1. Parses node by node
2. Doesnt store the XML in memory
3. We cant insert or delete a node
4. Top to bottom traversing
DOM
1. Stores the entire XML document into memory before processing
2. Occupies more memory
3. We can insert or delete nodes
4. Traverse in any direction.
If we need to find a node and doesnt need to insert or
delete we can go with SAX itself otherwise DOM provided we
have more memory.
 
4 Penchala
 
 
Answer
hii Penchala..

U r Explination is pretty good..
 
0 Chaithanya
 
 
Answer
Cant we insert or delete a node in SAX????
 
0 Simi
 
 
Answer
very nice explaination
 
0 Venkateswarlu
 
 
Answer
It  really nice Explanation by penchala the  more  about XML

SAX :
---
SAX Parser is the one which is developed to run the java 
programs especially. 

DOM:
---
DOM is developed by w3c consortium so that it is an open 
standard. 
In DOM the xml file is arranged as a tree and backward and 
forward search is possible for searching the tags and 
evaluating the data which it holds. 
It depends upon the application and ease of data 
accessiblity.
 If we want to extract the data from a xml file once we 
have to move to SAX which is one time top to bottom read 
approach and if we want ot randomly pick the data in an xml 
file then the tree reperesentation of DOM model is to be 
put into use. Thats all !
 
4 Shyam Miyatra
 
 
Answer
very good explanation 

Thank you.
 
0 Madhu
 
 
Answer
Thank you..it helped us a lot :)
 
0 Natasha,ashwni,smita,prajakta
 
 
Answer
sax is simple api for xml
it read the first xml data and get outputed backward is not
possible,
dom is doccument object model
through dom we  can create a xml data as a tree and it is
loaded in memory so we can easily access the data
 
0 Chaitheesh
 
 
Answer
DOM
1. Tree of nodes
2. Memory: Occupies more memory, preffered for small XML
documents
3. Slower at runtime
4. Stored as objects
5. Programmatically easy
6. Ease of navigation
SAX
1. Sequence of events
2. Doesn't use any memory preferred for large documents
3. Faster at runtime
4. Objects are to be created
5. Need to write code for creating objects
6. Backward navigation is not possible as it sequentially
processes the document
 
0 Ashish
 
 
Answer
1. s->does not store xml in memory
   d->store the entire xml document in memory

2. s->top to bottom traversing
   d->traverse in any direction

3. s->insert or delete node is possible
   d->insert or delete node is not possible

4. s->especially for java
   d->not only for java

5. s->event driven,fast & lightweight
   d->tree structure,heavy weight to load & store

6. s->parse the document while reading
   d->load the document in memory to parse
 
0 Rajendra
 
 
Answer
Thank you to all to give the feedback about the differences 
between the sax and dom.
 
0 Prem
 
 
Answer
SAX 
•	Parses node by node 
•	Doesn’t store the XML in memory 
•	We cant insert or delete a node 
•	SAX is an event based parser 
•	SAX is a Simple API for XML 
•	doesn’t preserve comments 
•	SAX generally runs a little faster than DOM 

DOM 
•	Stores the entire XML document into memory before processing 
•	Occupies more memory 
•	We can insert or delete nodes 
•	Traverse in any direction. 
•	DOM is a tree model parser 
•	Document Object Model (DOM) API 
•	Preserves comments 
•	SAX generally runs a little faster than DOM 

-raju
 
0 Raju
 
 
Answer
good explanation......
  Thank you.
 
0 Jayaprakash
 
 
 
Back to Questions Page
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com