[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.

Companies

  •  Accenture
  •  Adobe
  •  Alcatel-Lucent
  •  Alten Calsoft Lab
  •  Amazon
  •  Amdocs
  •  Aricent
  •  Arris
  •  Broadcom Ltd
  •  Brocade
  •  CA Technologies
  •  Capgemini
  •  Cavium Networks
  •  CenturyLink
  •  Ciena
  •  Cisco
  •  Citrix
  •  Cognizant
  •  Comcast
  •  CSC (DXC Technology)
  •  Dell EMC
  •  Deloitte
  •  EFI
  •  Ericsson
  •  Extreme Network
  •  Genpact
  •  Gigamon
  •  Global Edge
  •  GlobalLogic
  •  Goldman Sachs
  •  Happiest Minds
  •  HCL Technologies
  •  Hewlett Packard Enterprise
  •  IDS Infotech
  •  Incedo
  •  Infinite C S
  •  IpInfusion
  •  J.P. Morgan
  •  Juniper Network
  •  L&T Technology Services
  •  MindTree
  •  MosChip Semiconductor
  •  NEC Technologies
  •  NIIT Technologies
  •  OLA
  •  One Access
  •  PayPal
  •  Paytm
  •  Qualcomm
  •  Radisys
  •  Redeem Software
  •  Reliance Jio
  •  Rolta India Limited
  •  Samsung
  •  Sasken
  •  Siemens
  •  Synopsys
  •  Tavant Technologies
  •  TCS
  •  Tech Mahindra
  •  Viasat
  •  Wipro
  •  XiLinx

Interview Questions and Answers :: Data Structure

    Answer:
    void GetNthFromLast(struct node* head, int n)
    {
    int len = n, i;
    struct node *temp = *temp1 = head;

    while (temp != NULL)
    {
    if (len > 0)
    {
    temp = temp->next;
    len--;
    continue;
    }

    temp = temp->next;
    temp1 = temp1->next;
    }


    if (len)
    {
    printf("\r\n Node in the given Linked list is not enough \r\n");
    return;
    }

    printf ("%d\n", temp1->data);

    return;
    }
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    int *p;
    p = (int *) malloc(2 * sizeof (int));

    When memory allocation is done, the actual heap space allocated is one word larger than the requested memory. The extra word is used to store the size of the allocation and is later used by free( )
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:

    1) Sort the array in ascending order.

    2) Initialize two index variables to find the 'S'

       elements in the sorted array.

           (a) Initialize first to the leftmost index: l = 0

           (b) Initialize second  the rightmost index:  r = ar_size-1

    3) Loop while l < r.

           (a) If (A[l] A[r] == S)  then return 1

           (b) Else if( A[l] A[r] <  sum )  then l

           (c) Else r--    

    4) No 'S' in whole array - return 0

    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    Answer:
    #include
    #include

    int main()
    {
    int row, col,i;
    int **arr ;
    printf ("Enter Row and Column\n");
    scanf("%d %d",&row,&col );
    printf("%d %d\n",row,col );
    **arr = (int **) malloc (sizeof (int)*row);
    for (i = 0; i < row; i++)
    {
    arr[i] = (int *) malloc(sizeof(int)*col);
    }
    return 0;
    }
    Please Login First :
    Tags:

    No Tags on this question yet!