Incedo Coding Questions and Answers

Sample Incedo Coding Questions with Solutions

On this page, you will get Sample Incedo Coding Questions and Answers asked in Technical Interview involved Incedo Recruitment Process.

Apart from this, at the end of this you will get Faq’s related to Job profiles, Salary Offered, and specific steps of the Recruitment Process of Incedo to hire freshers.

incedo-coding-questions

Sample Incedo Coding Questions and Answers - Set 1

Question 1 : Guess the word

Problem Statement : 

Kochouseph Chittilappilly went to Dhruv Zplanet , a gaming space, with his friends and played a game called “Guess the Word”.
Rules of games are –
Computer displays some strings on the screen and the player should pick one string / word if this word matches with the random word that the computer picks then the player is declared as Winner.
Kochouseph Chittilappilly’s friends played the game and no one won the game. This is Kochouseph Chittilappilly’s turn to play and he decided to must win the game.
What he observed from his friend’s game is that the computer is picking up the string whose length is odd and also that should be maximum. Due to system failure computers sometimes cannot generate odd length words. In such cases you will lose the game anyways and it displays “better luck next time”. He needs your help. Check below cases for better understand

Sample input 0:
5 → number of strings
Hello Good morning Welcome you
Sample output 0:
morning

Explanation:

Hello → 5
Good → 4
Morning → 7
Welcome → 7
You → 3
First word that is picked by computer is morning

Sample input 1:
3
Go to hell
Sample output 1:
Better luck next time
Explanation: 
Here no word with odd length so computer confuses and gives better luck next time

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Question 02: Array Subarray

Problem Statement: You are given an array, You have to choose a contiguous subarray of length ‘k’, and find the minimum of that segment, return the maximum of those minimums.

Sample input :

  • 1 → Length of segment x =1
  • 5 → size of space n = 5
  • 1 → space = [ 1,2,3,1,2]
  • 2
  • 3
  • 1
  • 2

Sample output :

  • 3

Explanation :

  • The subarrays of size x = 1 are [1],[2],[3],[1], and [2],Because each subarray only contains 1 element, each value is minimal with respect to the subarray it is in. The maximum of these values is 3. Therefore, the answer is 3

Question 3: Good Prime Number

Problem Statement  :

A prime number is a number which is divisible by one and itself. Also a number is called a good  prime number if the sum of its digits is a prime number. For example a number 23 is a good prime number because the sum of 2 and 3 ( 2+3=5) is 5 which is a prime number. You are given an integer K. Your task is to find the kth good prime number that is greater than a provided number N.

For example , 232 is a good prime number since the sum of all digits is 7 which is a prime number whereas 235 is not a good prime number.

Input format :

  • The first line contains an integer N.
  • The next line contains an integer K.

Output format :

A single integer which is a Kth good prime number that is greater than a provided number N.

Constraints :

  • 1<=N<=10^5
  • 1<=K<<=10^5

Sample Input 1:

4  4

Sample Output 1:

12

Explanation :

Good prime numbers starting from 4 are 5,7,11(1+1=2 which is prime number),12(1+2=3 which is prime number),14(1+4=5 which is a prime number) and so on. Because the sum of digits of an individual number is a prime number And 4 th good prime number is 12 in this series.Hence the output is 12. 

Sample Input 2:

17  5

Sample Output 2:

29

Explanation :

Good prime numbers starting from 17 are 20,21,23,25,29…and the 5th prime number is 29.Hence the output is 29.

Question 4 : Simple problem

Problem Statement :

Mr X is a teacher of maths. He came across a very simple problem. In the problem you have to arrange the numbers in an ascending order and calculate the total number of swaps required. The number of swaps must be minimum. But Mr X is busy with some other tasks and you being his favourite student , so he asks you to solve this problem.

Constraints:

1<=T<=100
1<=N<=100
1<=A[ ] <=1000
Examples

Input :
4
4 3 1 2
Output:
2
Explanation: Swap index 0 with 3 and 1 with 2 to form the sorted array {1, 2, 3, 4}.

Input :
5
1 5 4 3 2
Output :
2

Question 5 : Seating Arrangement in Exam Hall

 

Problem Statement  :

Semester exams are going on for university students. Examiners noticed that a group of people are trying to cheat. They marked students of that group as ‘1’ and students of another group ( who are not cheating ) as ‘0’ 

We can reduce cheating by not allowing students from group 1 to sit together, means no two students from group 1 can sit together. Seatings are marked using above conditions. Your task is to give the seating placement of nth possibility Possibility order from 1 to 10 is given below

[1  10  100  101  1000  1001  1010  10000  10001  10010]

Sample input :

3 → number of test cases

4

6

9

Sample output :

101

1001

10001

Explanation :

4th possibility is 101 

6th possibility is 1001

9th possibility is 10001

Sample Incedo Coding Questions and Answers - Set 2

Question 1 : Game Of Clicks [ R->Hard ]

Problem Statement  :

Sahil watches TV all day and gets bored. He started playing this dumb game of identifying minimum number of inputs needed to reach a channel. As his cousin, you have to help him, but you live far from his house. So you decide to write a code that will ask Sahil for some inputs and give outputs respectively.

Here are the problems you need to keep in mind :

  • There are 13 buttons on his remote: 10 buttons for the numbers (0-9) to form integers denoting respective channel index, “Up channel” button and “ Down channel” button for going i +1th channel and i-1th channel from i respectively, and a “Last viewed” button to see what’s the last channel before it.
  • The number buttons allow you to jump directly to a specific channel (Ex: to go to channel 172 by typing 1,7,2).
  • If the channel which you are in is ith and that is the max channel index possible, by Up channel, you will reach the first channel possible. Same goes for the down channel button. You can go to the highest channel possible if you go down from the lowest channel possible.
  • Sahil can get from one channel to the next in one of the two ways.
  • Sahil’s parents have set some parental control on some channels on Aniruth’s television. The “Up Channel “ and “Down buttons” buttons skip these channels as these channels are not viewable.
  • Given a list of channels to view, the lowest channel, the highest channel, and a list of blocked channels, your program should return the minimum number of clicks necessary to get through all the shows that Anirudh would like to match.

Input Format :

  • First line is the lowest Channel
  • Second-line is the highest Channel
  • Followed by a number of blocked channels B,
    and the next B lines contain the actual blocked channels.
  • Followed by the number of Channels to view V, and the next V lines contain the actual channels to view.

Constraints :

  • The lowest channel on the television will be greater than 0. and less than or equal to 10,000.
  • The highest channel on the television will be greater than or equal to the lowest channel. and less than or equal to 10.000.
  • The list of channels that are blocked on Anirudh’s television. All the channels in this list will be valid channels (greater than or equal to lowest channel, less than or equal 1 to highest channel). Duplicates may be Ignored. The blocked list can be a maximum of 40 channels.
  • The sequence that Sahil must view contains between 1 and 50 elements. inclusive. All channels in this sequence are not in the blocked list and are between lowest channel and highest channel. Inclusive.

Sample Input 0:
1
20
2
18
19
5
15
14
17
11
17
Sample output 0:
8

Question 2: Consecutive Prime Sum

Problem Description

Question -:  Some prime numbers can be expressed as a sum of other consecutive prime numbers.

  • For example
    • 5 = 2 + 3,
    • 17 = 2 + 3 + 5 + 7,
    • 41 = 2 + 3 + 5 + 7 + 11 + 13.
      Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2.

Write code to find out the number of prime numbers that satisfy the above-mentioned property in a given range.

Input Format: First line contains a number N

Output Format: Print the total number of all such prime numbers which are less than or equal to N.

Constraints: 2<N<=12,000,000,000

Question 3: Majority Element

The majority element in an array is defined as the element that appears more than ⌊n/2⌋ times, where n is the length of the array.
In other words, it is the element that occurs most frequently and makes up more than half of the array.

Given an array of integers, the task is to find the majority element and return it. If there is no majority element, If there is no majority element, the algorithm should indicate that.

Examples:

Example 1:
Input: [3, 3, 4, 2, 4, 4, 2, 4, 4]
Output: 4
Explanation:
In the given array, the number 4 appears 5 times, which is more than half of the array size (9/2 = 4.5). Therefore, 4 is the majority element.

Example 2:
Input: [1, 2, 3, 4, 4, 4, 4]
Output: 4
Explanation:
In this case, the number 4 appears 4 times, which is more than half of the array size (7/2 = 3.5). Thus, 4 is the majority element.

Example 3:
Input: [1, 2, 3, 4, 5]
Output: -1
Explanation:
There is no majority element in this array since no number appears more than half of the array size (5/2 = 2.5).

Example 4:
Input: [2, 2, 2, 3, 3, 4, 4, 4, 4]
Output: -1
Explanation:
In this case, although the number 4 appears 4 times, it does not occur more than half of the array size (9/2 = 4.5).
Hence, there is no majority element.

Question 4: Smallest window in a string containing all the characters of another string

Given two strings S and P, the task is to find the smallest window in string S that contains all the characters (including duplicates) of string P. If no such window exists, return “-1”. If there are multiple windows of the same length, return the one with the smallest starting index.
Note that all characters are lowercase alphabets.

Example 1:

Input:
S = “timetopractice”
P = “toc”
Output : toprac
Explanation: The smallest substring in S that contains “toc” is “toprac”.

Example 2:
Input:

S = “zoomlazapzo”
P = “oza”

Output:
apzo
Explanation:
The smallest substring in S that contains “oza” is “apzo”.

Question 5 : Spiral Matrix

Problem Statement :

You will be given a 2d matrix. Write the code to traverse the matrix in a spiral format. Check the input and output for better understanding.

Sample Input :
Input :
5 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20

Output :

[1, 2, 3, 4, 8, 12, 16, 20, 19, 18, 17, 13, 9, 5, 6, 7, 11, 15, 14, 10]

FAQs on Incedo Coding Questions and Answers

Question 1: Does Incedo asks Coding Questions in their Technical Interview ?

Yes, Incedo asks Data Structures and Algorithms based Coding Questions along with other Core CS Subjects based questions to test the Techical Knowledge of the Candidate.

Question 2: How many rounds of interview are there in Incedo?

In, Incedo Recruitment Process for Hiring Freshers includes 1 Technical Interview followed by HR Interview.

Question 3: What are steps involved in Incedo Recruitment Process?

Incedo Recruitment Process involves:

  1. Online Aptitude + Technical Assessment 
  2. Technical Interview
  3. HR Interview
Question 4: What is the salary of freshers in Incedo?

Salary offered by Incedo for the Job Profiles like Data Science Trainee or Software Development Trainee is Rs 4.5 LPA – Rs 12 LPA.

Question 5: What is the eligibility criteria for Incedo?

The eligibility criteria for Incedo Recruitment Process is:

  • Course : BE/B.Tech/ME/M.Tech/MCA
  • Batch : 2022/2023 Batch
  • Score : Minimum 65% or equivalent CGPA required throughout the academics. 

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription