Top 50 Coding questions for Placement Interviews

Aktuhelper Presesnting Top 50 Coding Questions for Placement Interviews asked by Various Service Based Companies such as TCS,TechMahindra,Coznizant,Infosys,Wipro.Refer to this coding questions,it will give you insight about Pattern of Programming Questions asked in Coding Round.




TCS NQT

Given an array of integers where every element appears even number of times except one element which appears odd number of times, write a program to find that odd occurring element in O(log n) time. The equal elements must appear in pairs in the array but there cannot be more than two consecutive occurrences of an element. s

Show Answer
TCS NQT

Print array after it is right rotated K times

Show Answer
TCS NQT

Equilibrium index of an array

Show Answer
TCS NQT

Find whether an array is subset of another array

Show Answer
TCS NQT

Find first non-repeating element in a given Array of integers

Show Answer
TCS NQT

Given an array of pairs, find all symmetric pairs in it

Show Answer
TCS NQT

Program for Mean and median of an unsorted array

Show Answer
TCS NQT

Find maximum possible stolen value from houses (House Robber)

Show Answer
TCS NQT

Program to count vowels, consonant, digits and special characters in string.

Show Answer
TCS NQT

Count prime numbers that can be expressed as sum of consecutive prime numbers

Show Answer
Wipro

You are given a binary number as a string (S), which is N size. Convert this binary number into its integer decimal equivalent and then print it.

Show Answer
Wipro

Check whether two Strings are anagram of each other

Show Answer
Wipro

Position of rightmost set bit

Show Answer
Wipro

Remove all characters other than alphabets from string

Show Answer
Wipro

Find Majority Element in an array which appears more than n/2 times.(n is size of array)

Show Answer
Wipro

Program to validate an IP address

Show Answer
Wipro

Maximum profit by buying and selling a share at most k times

Show Answer
Wipro

Number of subarrays having product less than K

Show Answer
Wipro

Check if the sum of digits of N is palindrome

Show Answer
Wipro

Pythagorean Triplet in an array

Show Answer
Infosys

Given a string find the next permutation of the given string in C++.

Show Answer
Infosys

Write a program to find the area of the incircle of a right angles triangle.

Show Answer
Infosys

Write a program that will find the missing characters that are needed to make the string a panagram.

Show Answer
Infosys

Write a program that converts the given temperature of Fahrenheit into celsius.

Show Answer
Infosys

Write a program to count the number of unique characters in a given string.

Show Answer
Infosys

Write a program to make the largest number from the digits of the array.

Show Answer
Infosys

Given an array form a triangle such that the last row of the triangle contains all the elements of the array and the row above it will contain the sum of two elements below it.

Show Answer
Infosys

Given the price of the stock on each day find the maximum profit you can earn by selling them.

Show Answer
Infosys

You are given a matrix that contains only 0 and 1 find the maximum size of a rectangle that contains only 1.

Show Answer
Infosys

Given the coordinates of the endpoints of two rectangles find whether they overlap each other or not.

Show Answer
Tech Mahindra

Write a program to return the difference between the count of odd numbers and even numbers.

Show Answer
Tech Mahindra

Write a program to calculate and return the sum of absolute difference between the adjacent number in an array of positive integers from the position entered by the user.

Show Answer
Tech Mahindra

Write a program to find the difference between the elements at odd index and even index.

Show Answer
Tech Mahindra

A Cloth merchant has some pieces of cloth of different lengths. He has an order of curtains of length of 12 feet. He has to find how many curtains can be made from these pieces. Length of pieces of cloth is recorded in feet.

Show Answer
Tech Mahindra

Find a pair with the maximum product in an array of Integers.

Show Answer
Tech Mahindra

Write a program for Decimal to Binary Conversion.

Show Answer
Tech Mahindra

Write a program to calculate the total bill tax amount for a list of billing amounts passed as an array of long integers.

Show Answer
Tech Mahindra

Write a program to reverse a given string without using built-in library functions.

Show Answer
Tech Mahindra

Write a program to calculate and return the sum of absolute differences between the adjacent numbers in an array.

Show Answer
Tech Mahindra

Given an array of integers representing measurements in inches, write a program to calculate the total of measurements in feet. Ignore the measurements that are less than a foot (eg. 10).

Show Answer
Cognizant

https://www.skillvertex.com/blog/tech-mahindra-coding-questions/

Show Answer
Cognizant

Median of two sorted arrays of same size

Show Answer
Cognizant

https://www.geeksforgeeks.org/median-of-two-sorted-arrays/

Show Answer
Cognizant

Program to find Smallest and Largest Word in a String

Show Answer
Cognizant

Converting Roman Numerals to Integer

Show Answer
Cognizant

Count of substrings that start and end with 1 in given Binary String

Show Answer
Cognizant

Program for sum of geometric series

Show Answer
Cognizant

Check whether the number is an Automorphic number or not.

Show Answer
Cognizant

Program to convert a given number to words

Show Answer
Cognizant

Program for average of an array (Iterative and Recursive)

Show Answer