[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Placement Questions & Answers :: SAP Labs

11. Which of the function operator cannot be over loaded

Answer: ?:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Cisco SAP Labs 

12. If no exception is thrown, then

Answer: any catch blocks coded will be by passed.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

SAP Labs 

13. Assume single linked list pseudo code as follows?

struct Node {
data
next
}
record List {
Node firstNode
}

function1(List list) {
obsoleteNode = list.firstNode; list.firstNode = list.firstNode.next; free obsoleteNode;
}

function2(node node) {
obsoleteNode = node.next; node.next= node.next.next; free obsoleteNode;
}

function3(Node node,Node newNode) {
newNode.next = node.next;node.next= newNode
}

function4(List list, Node newNode) {
newNode.next = list.firstNode; list.firstNode = newNode;
}

Answer: function3 inserts newNode after node

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Commvault Societe Generale SAP Labs Capgemini 

14. The time required to delete a node x from a doubly linked list having n nodes is

Answer: O(1)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Sopra Steria SAP Labs 

15. Given 10,8,6,7,9
swap the above numbers such that finally you got 6,7,8,9,10
so now reverse 10
9,7,6,8,10
now reverse 9
8,6,7,9,10
7,6,8,9,10
6,7,8,9,10
at this point 6 is ahead so no more reversing can be done so stop.
To implement above algorithm which datastructure is better and why ?

Answer:

Explanation:

XOR linked lists are used to reduce the memory by storing the XOR values of address instead of actual address in pointers.

Workspace

Tags:

SAP Labs 

16. What are implicit and explicit implementations of freelists?

Answer:

Explanation:

Gc and new most widely known.

Workspace

Tags:

SAP Labs 

17. Which of the following data structure is preferred to have lesser search time when the list size is small?

Answer:

Explanation:

Self-organizing list is easy and simple to implement than search tree and it requires no additional space. So using self organizing list is preferred when list size is small.

Workspace

Tags:

SAP Labs 

18. A full binary tree with 2n+1 nodes contain

Answer: n non-leaf nodes

Explanation:

Here is no explanation for this answer

Workspace

Tags:

SAP Labs Capgemini 

19. A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as

Answer: full binary tree.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

SAP Labs 

20. What is a full binary tree?

Answer:

Explanation:

A full binary tree is a tree in which each node has exactly 0 or 2 children.

Workspace

Tags:

SAP Labs