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

Sorting Programs in C

    1 / 6

    Write a program to compute the quicksort for the given input array

    Input : NA


    Output : NA

    View Answer |  Sorting |  Practice Program | Add to Reading List To Reading List | Asked In |  Fresher
    Please Login to view the answer

    Tags:No Tags on this question yet!

    2 / 6

    Write a program to compute the bubble sort for the given input array

    Input : NA


    Output : NA

    View Answer |  Sorting |  Practice Program | Add to Reading List To Reading List | Asked In |  Fresher
    Please Login to view the answer

    Tags:No Tags on this question yet!

    3 / 6

    Write a program to sort an array containing only 0's and 1's in random order.

    Input : 1 0 1 1 0 1 0 1 0 0 0 1 0 1


    Output :

    Please Login to view the answer

    Tags:Aricent Paytm

    4 / 6

    Car parking problem. An array given represents the actual order of cars need to be parked. Like for example order is 4,6,5,1,7,3,2,empty. If cars are parked in some order like empty,1,2,3,7,6,4,2. Some person needs to get them into the correct order, list out all instructions to the person to get in the correct order with least number of swaps.

    Input : NA


    Output : NA

    View Answer |  Sorting |  Practice Program | Add to Reading List To Reading List | Asked In AmazonHackerRank |  Experience, Fresher
    Please Login to view the answer

    Tags:Amazon

    5 / 6

    There are many cars parked in the parking lot. The parking is a straight very long line and a parking slot for every single meter. There are cars parked currently and you want to cover them from the rain by building a roof. The requirement is that at least k cars are covered by the roof. What's the minimum length of the roof that would cover k cars?

    The function has the following parameters:
    cars: integer array of length denoting the parking slots where cars are parked
    k: integer denoting the number of cars that have to be covered by the roof

    Example:
    Input:
    cars: [2, 10, 8, 17]
    k: 3
    output: 9
    Explanation: you can build a roof of length 9 covering all parking slots from the 2nd one to the 10th one, so covering 3 cars at slots 2, 10, 8, there are no shorter roof that can cover 3 cars, so the answer is 9

    Note:
    1 <= n <= 10^5
    1 <= k <= n
    1 <= cars[i] <= 10^14
    All slots token by cars are unique

    Input : cars: [2, 10, 8, 17]
    k: 3


    Output :

    View Answer |  Sorting |  Practice Program | Add to Reading List To Reading List | Asked In AmazonHackerRank |  Experience, Fresher
    Please Login to view the answer

    Tags:Amazon

    6 / 6

    Given a boolean 2D array, where each row is sorted. Write a program to find the row with the maximum number of 1s.

    Input : Input matrix
    0 1 1 1
    0 0 1 1
    1 1 1 1
    0 0 0 0


    Output :

    View Answer |  Sorting |  Practice Program | Add to Reading List To Reading List | Asked In Paytm |  Experience
    Please Login to view the answer

    Tags:Paytm




You can practice here all the basics and standard Sorting program asked at freshers or experienced level job interview. Practice our hand-picked Sorting coding interview questions asked in coding round of various it companies and exams. You can programed these given question in any language, you can post your answer and same time you can review other users answer. It is always recommanded to write your own Sorting coding questions answer first and then refer others answers. At this page we have covers all the Sorting coding questions in 2020 and previously asked in their Interview round or coding rounds.