Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Hackerrank Questions

    11 / 29

    Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element on the right side of x in the array. Elements for which no greater element exist, consider next greater element as -1.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    12 / 29

    Given a binary tree and at any moment of time, a given node starts to fire, after one-second fire reaches to all the nodes which are directly connected with given node so the fire cycle continues as same. You need to find minimum time at which whole tree will be burnt.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    13 / 29

    Given an array with n elements and a sum x, need to count all pairs of elements in the array whose sum is equal to x. Told two approaches one using binary search and other using two pointers.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    14 / 29

    Given an array and integer K, find the number of pairs such that a[i]+K=a[j]

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    15 / 29

    Given a string. Find the number of substrings which consists of vowels only and contain all vowels at least once.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    16 / 29

    Write a function to check whether two given strings are an anagram of each other or not.

    Hint:An anagram of a string is another string that contains same characters, only the order of characters can be different.

    Example: "abcd" and "dabc" are anagram of each other.

    Input : LISTEN


    Output :

    Please Login to view the answer

    Tags:SAP Labs

    17 / 29

    Write a recursive program to reverse a string without using any extra variable.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    18 / 29

    Write a program to implement queue using linked list and array.

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

    19 / 29

    Password Creation

    A password manager wants to create a new password using two strings given by the user, then combined to create a harder-to-guess combination. Given two strings, interleave the characters of the strings to create a new string. Beginning with an empty string, alternately append a character from string a and from string b. If one of the strings is exhausted before the other, append the remaining letters from the other string all at once. The result is the new password.

    Example:
    If a = saplab and b = q4interview ,the result is sqa4pilnatberview.


    Function Description
    Complete the function newPassword in the editor below
    newPassword has the following parameter(s):
    string a the first string
    string b the second string

    Input : a = saplab
    b = q4interview


    Output :

    Please Login to view the answer

    Tags:SAP Labs

    20 / 29

    Build the Subsequences

    A subsequence of a string is obtained by deleting zero or more characters from the string while maintaining order. Given a string, generate an array of all subsequences sorted alphabetically ascending, omitting the empty string.

    Example
    For example, the subsequences of string s = "xyz", not including the empty string, are "x", "xy", "xz", "xyz", "y", "yz", and "z"

    Function Description:
    Complete the function builds sequences in the editor below.

    buildSubsequences has the following parameter(s)
    str s: the string to process

    Returns:
    str[]: An array of strings comprising all the subsequences of the given string sorted alphabetically, ascending.

    constraints:
    1 < length of s <16
    s is a string of distinct lowercase English alphabetic letter ascii[a-z]

    Input : NA


    Output : NA

    Please Login to view the answer

    Tags:SAP Labs

If you are looking for the Hacker Rank Coding Questions Answers 2020-2021 for practice the you are at right place and right website to practice, All the listed hacker rank coding question are same level. At this page you can find sceciton wise HackerRank Coding Papers along with Answers, you can post your answers and even you can review other answers too. Also, the given Papers are in pdf format. If you are about to start your peparation for the companies askeing hacker rank coding question, then you can practice all the listed question here. You can practice the given Questions along with Solutions from this post. At this page you can find out the entire pdf link to download all the questions with answers to refer it as offline. HackerRank mainly focus on the competitive programming challenges for both business and consumers.