[ Latest ] Viasat Technical Interview Questions and Answers.
Practice List of Paytm Coding Questions !!!
Take 30+ FREE!! Online Arithmetic Aptitude Mock test to crack any Exams.

TCS Ninja Coding Questions

    1 / 4

    Every character in the input string is followed by its frequency.
    Write a function to decrypt the string and find the nth character of the decrypted string. If no character exists at that positionthen then return "-1".
    For eg:- If the input string is "a2b3" the decrypted string is "aabbb".
    Note: The frequency of encrypted string cannot be greater than a single digit i.e.<10.

    Explanation:

    The decrypted string is "abccc", hence the 5th character in the decrypted string is "c".

    Input : Input Specification:
    Input1: A string.
    Input2:5


    Output :

    Please Login to view the answer

    2 / 4

    Write an efficient program to find the sum of contiguous sub-array within a one-dimensional array of numbers which has the largest sum.

    Input : {-2, -3, 3, -1, -2, 1, 5, -3}


    Output :

    Please Login to view the answer

    3 / 4

    Given an expression string exp. Examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[“,”]” are correct in exp.
    For example, the program should print 'balanced' for exp = “[()]{}{[()()]()}” and 'not balanced' for exp = “[(])”

    Input : The first line of input contains an integer T denoting the number of test cases. Each test case consists of a string of expression, in a separate line.


    Output :

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

    4 / 4

    Given an array Arr of N positive integers and another number X. Determine whether or not there exist two elements in Arr whose sum is exactly X.

    Explanation: Arr[3] + Arr[4] = 6 + 10 = 16

    Input : N = 6, X = 16
    Arr[] = {1, 4, 45, 6, 10, 8}


    Output :

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




TCS Ninja Coding round is one of tricky round of whole TCS Coding process, for this round You need to master in TCS Ninja coding questions, you need not only have any coding language (C/C++/Java/Perl/ Python 2.7) knowledge, even you need to have strong logical thinking, to code the questions in given time. To make your TCS Ninja coding round preparation easy, we have listed here TCS Ninja coding questions, you can practice all the given questions, and try to write program in given time. After practicing these questions, you will be in a place to code most of the TCS Ninja coding questions in given 20 minutes time in your any of the 5 prefered programming languages i.e C/C++/Java/Perl/ Python 2.7.