Cadence Coding Questions and Answers

Cadence Coding Questions with Solutions

Cadence Coding Questions and Answers page will help you to get sample Coding Questions asked in the Online Assessment and Technical Interviews of the Company.
Apart from that you will be getting details on Job Profile, Expected CTC, Job Location, etc. offered by the company.

cadence-coding-questions

About Cadence Recruitment Process

Here, in this section, you will find out the steps included in Cadence Recruitment Process for the Software Development Engineer job profile:

  1. Online Aptitude + Coding Assessment
  2. Technical Interview
  3. HR Interview

For your reference and understanding we have given further details of the Cadence Recruitment Process in the following tabular form :

CadenceImportant Information
Position :Software Development Engineer
Course :
  • B.E/B.Tech or M.E/M.Tech Any Stream
  • Eligible Batch – 2023
Eligibility Criteria / Academic Qualification Required :Minimum 65 % throughout 10th, 12th, and Graduation.
Cost to Company (CTC)₹3L – ₹9 L.P.A
Selection Process :
  • Online Aptitude + Coding Assessment
  • Technical Interview
  • HR Interview
Joining Location :Noida

Cadence Exam Pattern 2023

SectionNo. Of Questions/TopicsTime
Section 1 20 Aptitude MCQs 20 Min
Section 210 Core CS Subject MCQs10 Min
Section 33 – 4 Coding Questions60 Min

Prime Course Trailer

Related Banners

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

Practice Cadence Coding Questions and Answers

Question : 1

A taxi can take multiple passengers to the railway station at the same time.On the way back to the starting point,the taxi driver may pick up additional passengers for his next trip to the airport.A map of passenger location has been created,represented as a square matrix.

The Matrix is filled with cells,and each cell will have an initial value as follows:

  • A value greater than or equal to zero represents a path.
  • A value equal to 1 represents a passenger.
  • A value equal to -1 represents an obstruction.

The rules of motion of taxi are as follows:

  • The Taxi driver starts at (0,0) and the railway station is at (n-1,n-1).Movement towards the railway station is right or down,through valid path cells.
  • After reaching (n-1,n-1) the taxi driver travels back to (0,0) by travelling left or up through valid path cells.
  • When passing through a path cell containing a passenger,the passenger is picked up.once the rider is picked up the cell becomes an empty path cell.
  • If there is no valid path between (0,0) and (n-1,n-1),then no passenger can be picked.
  • The goal is to collect as many passengers as possible so that the driver can maximize his earnings.

For example consider the following grid,

0      1
-1     0

Start at top left corner.Move right one collecting a passenger. Move down one to the destination.Cell (1,0) is blocked,So the return path is the reverse of the path to the airport.All Paths have been explored and one passenger is collected.

Returns:

  • Int:maximum number of passengers that can be collected.

Sample Input 0

  • 4  -> size n = 4
  • 4 -> size m = 4
  • 0 0 0 1 -> mat
  • 1 0 0 0
  • 0 0 0 0
  • 0 0 0 0

Output 0

  • 2

Explanation 0

The driver can contain a maximum of 2 passengers by taking the following path
(0,0) → (0,1) → (0,2) → (0,3) → (1,3) → (2,3) → (3,3) → (3,2) → (3,1) → (3,0) → (2,0) → (1,0)  → (0,0)

Sample Input 1

STD IN                  Function

————              ————-

  •    3     →  size  n=3
  •    3    →  size m=3
  •    0 1 -1 → mat
  •    1 0 -1
  •    1 1 1

Sample Output 1

  • 5

Explanation 1

The driver can contain a maximum of 5 passengers by taking the following path
(0,0) → (0,1) → (1,1) → (2,1) → (2,2) → (2,1) → (2,0) → (1,0) → (0,0)

Question : 2

A company has a list of jobs to perform. Each job has a start time, end time and profit value. The manager has asked his employee Anirudh to pick jobs of his choice. Anirudh being greedy wants to select jobs for him in such a way that would maximize his earnings.  Given a list of jobs how many jobs and total earning are left for other employees once Anirudh picks jobs of his choice.

Note: Anirudh can perform only one job at a time.

Input format:

  • Each Job has 3 pieces of info – Start Time,End Time and Profit
  • The first line contains the number of Jobs for the day. Say ‘n’. So there will be ‘3n lines following as each job has 3 lines.
  • Each of the next ‘3n’ lines contains jobs in the following format:
    • start_time
    • end-time
    • Profit
    • start-time and end-time are in HHMM 24HRS format i.e. 9am is 0900 and 9PM is 2100

Constraints

  • The number of jobs in the day i.e’ is less.
  • than 10000
  • 0<_n<_10000
  • start-time is always less than end time.

Output format :-

  • Program should return an array of 2 integers where
  • 1st one is number of jobs left and earnings of other employees

Sample Input 1 :

  • 3
  • 0900
  • 1030
  • 100
  • 1000
  • 1200
  • 500
  • 53
  • 1100
  • 1200
  • 300

Sample Output 1:

  • 2
  • 400

Sample Explanation 1

Anirudh chooses 1000-1200 jobs. His earnings is 500. The 1st and 3rd jobs ie 0900-1030 and 1100-1200 respectively overlap with the 2nd jobs. But profit earned from them will be 400 only. Hence Anirudh chooses 2nd one. Remaining 2 Jobs & 400 cash for other employees

Sample Input 2:

  • 5
  • 0805
  • 0830
  • 100
  • 0835
  • 0900
  • 100
  • 0905
  • 0930
  • 100
  • 0935
  • 1000
  • 100
  • 1005
  • 1030
  • 100

Sample output 2:

  • 0
  • 0

Sample Explanation 2:

Anirudh can work on all appointments as there are none overlapping. Hence 0 appointments and 0 earnings for other employees.

Question : 3

You have a positive integer m and a non-negative integer s. Your task is to find the smallest and the largest of the numbers that have length m and sum of digits s. The required numbers should be non-negative integers written in the decimal base without leading zeroes.

Input

  • The single line of the input contains a pair of integers m, s (1 ≤ m ≤ 100, 0 ≤ s ≤ 900) — the length and the sum of the digits of the required numbers.

Output

  • In the output print the pair of the required non-negative integer numbers — first the minimum possible number, then — the maximum possible number. If no numbers satisfying conditions required exist, print the pair of numbers “-1 -1” (without the quotes).

Examples

  • Input 1
    2 15
  • Output 1
    69 96
  • Input 2
    3 0
  • Output 2
    -1 -1

Question : 4

Problem Description

Question – : Juan Marquinho is a geologist and he needs to count rock samples in order to send it to a chemical laboratory. He has a problem: The laboratory only accepts rock samples by a range of its size in ppm (parts per million).

Juan Marquinho receives the rock samples one by one and he classifies the rock samples according to the range of the laboratory. This process is very hard because the number of rock samples may be in millions.

Juan Marquinho needs your help, your task is to develop a program to get the number of rocks in each of the ranges accepted by the laboratory.

Input Format: An positive integer S (the number of rock samples) separated by a blank space, and a positive integer R (the number of ranges of the laboratory); A list of the sizes of S samples (in ppm), as positive integers separated by space R lines where the ith line containing two positive integers, space separated, indicating the minimum size and maximum size respectively of the ith range.

Output Format: R lines where the ith line contains a single non-negative integer indicating the number of the samples which lie in the ith range.

Constraints:

  • 10 <= S <= 10000
  • 1 <= R <= 1000000
  • 1<=size of Sample <= 1000

Example 1

  • Input: 10 2
  • 345 604 321 433 704 470 808 718 517 811
  • 300 350
  • 400 700

Output: 2 4

Explanation:

There are 10 samples (S) and 2 ranges ( R ). The samples are 345, 604,811. The ranges are 300-350 and 400-700. There are 2 samples in the first range (345 and 321) and 4 samples in the second range (604, 433, 470, 517). Hence the two lines of the output are 2 and 4

Example 2

  • Input: 20 3
  • 921 107 270 631 926 543 589 520 595 93 873 424 759 537 458 614 725 842 575 195
  • 1 100
  • 50 600
  • 1 1000

Output: 1 12 20

Explanation:

There are 20 samples and 3 ranges. The samples are 921, 107 195. The ranges are 1-100, 50-600 and 1-1000. Note that the ranges are overlapping. The number of samples in each of the three ranges are 1, 12 and 20 respectively. Hence the three lines of the output are 1, 12 and 20.

Question : 5

Problem Statement –

Bhojon is a restaurant company and has started a new wing in a city. They have every type of cook except the meatball artist. They had fired their last cook because the sale of meatballs in their restaurant is really great, and they can’t afford to make meatballs again and again every time their stock gets empty. They have arranged a hiring program, where you can apply with their meatball.
They will add the meatball in their seekh (a queue) and everytime they cut the meatball they take it and cut it on the day’s quantity and then re-add the meatball in the seekh. You are the hiring manager there and you are going to say who is gonna be hired.

Day’s quantity means, on that very day the company sells only that kg of meatballs to every packet.

If someone has less than a day’s quantity, it will be counted as a sell.

Function Description:

  • Complete the function with the following parameters:

Parameters:

NameTypeDescription
NIntegerHow many people are participating in the hiring process.
DIntegerDay’s quantity, how many grams of meatball is being sold    to every packet.
Array[ ]Integer arrayArray of integers, the weight of meatballs everyone came with.

Return:

  • The ith person whose meat is served at last.

Constraints:

  • 1 <= N <= 10^3
  • 1 <= D <= 10^3
  • 1 <= Array[i] <= 10^3

Input Format:

  • First line contains N.
  • Second line contains D.
  • After that N lines contain The ith person’s meatball weight.

Output Format: The 1 based index of the man whose meatball is served at the last.

Sample Input 1:

4

2

[7 8 9 3]

Sample Output 1:

3

Explanation:

The seekh or meatball queue has [7 8 9 3] this distribution. At the first serving they will cut 2 kgs of meatball from the first meatball and add it to the last of the seekh, so after 1st time it is:

[8 9 3 5]

Then, it is: [9 3 5 6],  [3 5 6 7], [5 6 7 1], [6 7 1 3], [7 1 3 4], [1 3 4 5], [3 4 5], [4 5 1], [5 1 2], [1 2 3], [2 3], [3], [1], [0]

So the last served meatball belongs to the 3rd person.

FAQs related to Cadence Coding Questions

Question 1: How many rounds are there in Cadence Recruitment Process?

After, 1st Round (i.e. Aptitude + Coding Assessments) 2 Rounds of Technical Interviews are conducted depending on the job profile (i.e. Technical Interview 1 involves discussion on Coding Questions Attempted in Online Assessment and Technical Interview 2 involves Advanced DSA based Questions Solving), followed by H.R Interview.

Question 2: Is Coding questions asked in Cadence Recruitment Process?

Yes, the 1st Round of Cadence Recruitment Process is conducted as Online Coding Test.

Question 3: What is the Eligibility Criteria for the Cadence Recruitment Process?

Minimum 65% or Equivalent C.G.P.A. is 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