Get Off-Campus Placement Jobs Info !!!
Programs asked in Mettl Coding Round
Click To Practce List of Programs asked in Nagarro !!!

Programming Questions in JAVA Asked at Experienced

    191 / 209

    Write a program to remove duplicates from a given string

    Input : qqq44inttttervvviiewwww


    Output :

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

    Tags:No Tags on this question yet!

    192 / 209

    Write an efficient program to remove characters from the first string which are present in the second string

    Input : str1 = q4interview.com
    mask = iewc


    Output :

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

    Tags:No Tags on this question yet!

    193 / 209

    Write an efficient program to toggle all the bits of a number except k-th bit.

    Input : n = 4294967295, k = 0


    Output :

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

    Tags:No Tags on this question yet!

    194 / 209

    Write an efficient program to set the rightmost unset bit.

    Input : 10


    Output :

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

    Tags:No Tags on this question yet!

    195 / 209

    Write an efficient program to toggle the bits in the given range

    Input : Number n = 17 range l = 2, r = 5


    Output :

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

    Tags:No Tags on this question yet!

    196 / 209

    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

    197 / 209

    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

    198 / 209

    Given an array of integers with repeating elements, find the sum of differences between positions of repeated elements and store them in an array of the same size.

    For e.g. given array {1, 2, 3, 1, 2, 1, 2} we shall have:
    For position 0: 1 is on positions 3&5 additional to position 0.
    Thus for position 0: |3-0| + |5-0| = 8.
    For position 1: 2 is on positions 4&6 additional to position 1.
    Thus for position 1: |4-1| + |6-1| = 8.

    Input : NA


    Output : NA

    View Answer |  Array |  Practice Program | Add to Reading List To Reading List | Asked In SAP LabsTCS NQT |  Experience, Fresher
    Please Login to view the answer

    199 / 209

    Finding palindromic substrings within a string

    For e.g. given string ‘banana’, palindromic substrings would be ‘aa’, ‘aaa’, ‘ana’, ‘anna’ and so on.

    Input : NA


    Output : NA

    View Answer |  Array |  Practice Program | Add to Reading List To Reading List | Asked In SAP LabsTCS NQT |  Experience, Fresher
    Please Login to view the answer

    200 / 209

    Find the count of prime numbers between l and r where 1 <= l, r <= 10 ^ 9 and those numbers whose digits are not even numbers and digits are less than 5

    Eg :- l = 1
    r = 10

    Input : NA


    Output : NA

    View Answer |  Basics |  Practice Program | Add to Reading List To Reading List | Asked In SAP LabsTCS NQT |  Experience, Fresher
    Please Login to view the answer




You at page 20 practice here all the basics and standard c, C++, JAVA, Python program asked at Experience level job interview or in coding round. Practice our hand-picked 20 coding round programming interview questions asked in coding round of various it companies and exams. You can practice all the given at this page 20 programed given C, C++, JAVA, Python 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 C, C++, JAVA, Python coding questions answer first and then refer others answers. At this page 20 we have covers all the coding questions in 2020-2021 and previously asked in their Interview round or coding rounds.