Prolifics Coding Questions and Answers
Prolifics Coding Questions with Solutions
Prolifics Coding Questions and Answers are discussed on this page, which were asked in Coding assessments and Technical Interviews of the company. Here we have also mentioned other details related to Prolifics recruitment processes like Job Profile, CTC offered, Job Location, and Steps involved in Prolifics Recruitment Process.
About Prolifics
Prolifics is a digital engineering and consulting organization that delivers expert consulting, engineering, and managed services for digital transformation. They provide architectural advice, design, development, deployment, and testing of BPM, integration, security, content, and collaboration, among other services.
Prolifics is currently working on industry-specific expertise in cloud, DevOps, data analytics, digital business, and testing/quality assurance. Prolifics specializes in test and business automation, as well as cybersecurity and other sectors.
About Prolifics Recruitment Process
The Prolifics Recruitment Process consists of the following steps :
- Online Assessment [ Aptitude + Coding Test ]
- Technical Interview
- HR Interview
We have mentioned further details of the Prolifics Recruitment Process in the following Tabular Form
Prolifics | Related Information |
---|---|
Position : | Trainee |
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Prolifics CTC Breakdown : |
|
Selection Process : |
|
Joining Location : |
|
Prolifics Job Description
We have discussed those Job Profile further on this page for better understanding.
Engineer Trainee
This Job Role requires :
- Good knowledge in Full stack development, and Programming Languages like JAVA / Python / Node JS / C++ / C# / Dot Net with Logical and analytical thinking abilities.
- Familiar with executing full software development life cycle (SDLC).
- Able to Code, test, and troubleshoot programs using an appropriate framework, database, and programming technology.
- Perform unit testing and participate in the design and code-review process.
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Prolifics Coding Questions with Solutions
Question 1 : Bank Compare Problem
Problem Description
Question – : There are two banks – Bank A and Bank B. Their interest rates vary. You have received offers from both banks in terms of the annual rate of interest, tenure, and variations of the rate of interest over the entire tenure.You have to choose the offer which costs you least interest and reject the other. Do the computation and make a wise choice.
The loan repayment happens at a monthly frequency and Equated Monthly Installment (EMI) is calculated using the formula given below :
EMI = loanAmount * monthlyInterestRate / ( 1 – 1 / (1 + monthlyInterestRate)^(numberOfYears * 12))
Constraints:
- 1 <= P <= 1000000
- 1 <=T <= 50
- 1<= N1 <= 30
- 1<= N2 <= 30
Input Format:
- First line: P principal (Loan Amount)
- Second line: T Total Tenure (in years).
- Third Line: N1 is the number of slabs of interest rates for a given period by Bank A. First slab starts from the first year and the second slab starts from the end of the first slab and so on.
- Next N1 line will contain the interest rate and their period.
- After N1 lines we will receive N2 viz. the number of slabs offered by the second bank.
- Next N2 lines are the number of slabs of interest rates for a given period by Bank B. The first slab starts from the first year and the second slab starts from the end of the first slab and so on.
- The period and rate will be delimited by single white space.
Output Format: Your decision either Bank A or Bank B.
Explanation:
- Example 1
- Input
- 10000
- 20
- 3
- 5 9.5
- 10 9.6
- 5 8.5
- 3
- 10 6.9
- 5 8.5
- 5 7.9
- Output: Bank B
- Example 2
- Input
- 500000
- 26
- 3
- 13 9.5
- 3 6.9
- 10 5.6
- 3
- 14 8.5
- 6 7.4
- 6 9.6
- Output: Bank A
#include <stdio.h> #include <math.h> int main() { double p,s,mi,sum,emi,bank[5],sq; int y,n,k,i,yrs,l=0; scanf(" %lf",&p); scanf(" %d",&y); for(k=0;k<2;k++) { scanf(" %d",&n); sum=0; for(i=0;i<n;i++) { scanf(" %d",&yrs); scanf(" %lf",&s); mi=0; sq=pow((1+s),yrs*12); emi= (p*(s))/(1-1/sq); sum= sum + emi; }bank[l++]=sum; } if(bank[0]<bank[1]) printf(" Bank A "); else printf(" Bank B "); return 0; }
Output 10000 20 3 5 9.5 10 9.6 5 8.5 3 10 6.9 5 8.5 5 7.9 Bank B
#include <iostream> #include <cmath> using namespace std; int main() { double p,s,mi,sum,emi,bank[5],sq; int y,n,k,i,yrs,l=0; cin>>p; cin>>y; for(k=0;k<2;k++) { cin>>n; sum=0; for(i=0;i<n;i++) { cin>>yrs; cin>>s; mi=0; sq=pow((1+s),yrs*12); emi= (p*(s))/(1-1/sq); sum= sum + emi; } bank[l++]=sum; } if(bank[0]<bank[1]) cout<<("Bank A"); else cout<<("Bank B"); return 0; }
Output 10000 20 3 5 9.5 10 9.6 5 8.5 3 10 6.9 5 8.5 5 7.9 Bank B
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); double p,s,mi,sum,emi,sq; int y,n,k,yrs,l=0; double[] bank = new double[5]; System.out.println("Enter the principal amount"); p = sc.nextDouble(); System.out.println("Enter tenature year"); y = sc.nextInt(); for (k = 0; k < 2; k++) { System.out.println("Enter the no of slabs"); n = sc.nextInt(); sum=0; for (int i = 0; i < n; i++) { System.out.println("Enter the period :"); yrs = sc.nextInt(); System.out.println("Enter the interest :"); s = sc.nextDouble(); mi=0; sq=Math.pow((1+s), yrs*12); emi=(p*(s))/(1-1/sq); sum=sum+emi; } bank[l++]=sum; } if(bank[0]<bank[1]) System.out.println("Bank A"); else System.out.println("Bank B"); } }
Output 10000 20 3 5 9.5 10 9.6 5 8.5 3 10 6.9 5 8.5 5 7.9 Bank B
bank = [] principal = int(input()) year = input() for i in range(0, 2): # 2 Banks installments = int(input()) sum = 0 for i in range(0, installments): time, roi = [float(i) for i in input().split()] square = pow((1+roi), time*12) emi = (principal*(roi)/(1-1/square)) sum = sum + emi bank.append(sum) if bank[0] < bank[1]: print("Bank A") else: print("Bank B")
Output 10000 20 3 5 9.5 10 9.6 5 8.5 3 10 6.9 5 8.5 5 7.9 Bank B
Question 2 : Minimum Number of Clicks
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
1
17
Sample output 0:
7
#include<bits/stdc++.h> using namespace std; unordered_mapm; int l,u; int util(int a,int b) { if(a==b) return 0; if(m[a]) return util(a+1,b); return 1+util(a+1,b); } int func(int b,int prev) { if(b >l>>u; int bn,b; cin>>bn; while(bn--){ cin>>b;m[b]++; } cin>>bn; while(bn--) { cin>>b; if(b>9 && flag==0) {ans+=2;flag++;prev=b;} else if(flag==0) {ans+=1;flag++;prev=b;} else if(prev2==b) {prev2=prev;prev=b;ans++;} else { ans+=min(b>9?2:1,func(prev,b));prev2=prev;prev=b; } } cout<< ans; }
import java.util.*; public class GameOfClicks { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int l=sc.nextInt(); int h=sc.nextInt(); int b=sc.nextInt(); Listbl=new ArrayList<>(); for(int i=0;i<b;i++){ bl.add(sc.nextInt()); } int v=sc.nextInt(); Listvl=new ArrayList<>(); for(int i=0;i<v;i++){ vl.add(sc.nextInt()); } Setsl=new HashSet<>(); int res=0; for(Integer i:vl){ if(bl.contains(i)) continue; sl.add(i); } for(Integer i:sl){ String s=i+""; res+=s.length(); } System.out.println(res); } }
def prev(now,l,h,blocked): if now!=l: if (now-1) not in blocked: return (now-1) else: return prev(now-1,l,h,blocked) else: if h not in blocked: return h else: return prev(h,l,h,blocked) def next(now,l,h,blocked): if now!=h: if (now+1) not in blocked: return (now+1) else: return next(now+1,l,h,blocked) else: if l not in blocked: return l else: return next(l,l,h,blocked) def digits(n): count=0 while n>0: n=n//10 count+=1 return count for i in range(2): if i==0: l=int(input()) else: h=int(input()) b=int(input()) blocked=[] for i in range(b): blocked.append(int(input())) back=-1 now=-1 c=int(input()) k=0 for i in range(c): n=int(input()) n1=digits(n) if now==-1: now=n k+=n1 continue if back==n: k+=1 back,now=now,back continue pf=0 pb=0 now1=now prev1=now for j in range(n1): if j==(n1-1): pf=n1 pb=n1 break else: now1=next(now1, l, h, blocked) pf+=1 prev1=prev(prev1, l, h, blocked) pb+=1 if now1==n: break if prev1==n: break k+=pf back=now now=n print(k)
Question 3 : Treasure Hunt
Rohan and his team are participating in the Treasure Hunt event of college in which in each step they have to solve one problem to get a clue of Treasure location . Rohan’s team has performed very well and reached the final step where they have to provide a code of a problem to get a final clue about treasure .
Given a string s, they need to find the longest palindromic subsequence’s length in s.
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
The string contains only lowercase letters.
Write a program to help Rohan’s team that takes in input as String x and returns the length of the longest palindromic subsequence of x.
Input Specification:
input1: string input
Output Specification:
Return the length of the longest palindromic subsequence
Example 1:
Input: s = “bbbab”
Output: 4
Explanation: One possible longest palindromic subsequence is “bbbb”.
Example 2:
Input: s = “cbbd”
Output: 2
Explanation: One possible longest palindromic subsequence is “bb”.
int max (int x, int y) { return (x > y) ? x : y; } int lps (char *str) { int n = strlen (str); int i, j, cl; int L[n][n]; for (i = 0; i < n; i++) L[i][i] = 1; for (cl = 2; cl <= n; cl++) { for (i = 0; i < n - cl + 1; i++) { j = i + cl - 1; if (str[i] == str[j] && cl == 2) L[i][j] = 2; else if (str[i] == str[j]) L[i][j] = L[i + 1][j - 1] + 2; else L[i][j] = max (L[i][j - 1], L[i + 1][j]); } } return L[0][n - 1]; } int main () { char seq[]; cin >> seq int n = strlen (seq); printf ("", lps (seq)); getchar (); return 0; }
import java.util.*; public class Main { static int max (int x, int y) { return (x > y) ? x : y; } static int lps (String seq) { int n = seq.length (); int i, j, cl; int L[][] = new int[n][n]; for (i = 0; i < n; i++) L[i][i] = 1; for (cl = 2; cl <= n; cl++) { for (i = 0; i < n - cl + 1; i++) { j = i + cl - 1; if (seq.charAt (i) == seq.charAt (j) && cl == 2) L[i][j] = 2; else if (seq.charAt (i) == seq.charAt (j)) L[i][j] = L[i + 1][j - 1] + 2; else L[i][j] = max (L[i][j - 1], L[i + 1][j]); } } return L[0][n - 1]; } public static void main (String args[]) { Scanner sc = new Scanner (System.in); String seq = sc.next (); int n = seq.length (); System.out.println ("" + lps (seq)); } }
s=input() n=len(s) rev = s[::-1] dp = [[0 for _ in range(n+1)] for _ in range(n+1)] for i in range(1, n+1): for j in range(1, n+1): if s[i-1] == rev[j-1]: dp[i][j] = 1 + dp[i-1][j-1] else: dp[i][j] = max(dp[i-1][j], dp[i][j-1]) print(dp[n][n])
Question 4 : Coin Distribution Problem
Problem Statement
Find the minimum number of coins required to form any value between 1 to N,both inclusive.Cumulative value of coins should not exceed N. Coin denominations are 1 Rupee, 2 Rupee and 5 Rupee.Let’s Understand the problem using the following example. Consider the value of N is 13, then the minimum number of coins required to formulate any value between 1 and 13, is 6. One 5 Rupee, three 2 Rupee and two 1 Rupee coins are required to realize any value between 1 and 13. Hence this is the answer.However, if one takes two 5 Rupee coins, one 2 rupee coin and two 1 rupee coin, then too all values between 1 and 13 are achieved. But since the cumulative value of all coins equals 14, i.e., exceeds 13, this is not the answer.
- Input Format:
- A single integer value.
- Output Format:
- Four space separated integer values.
- 1st – Total number of coins.
- 2nd – number of 5 Rupee coins.
- 3rd – number of 2 Rupee coins.
- 4th – number of 1 Rupee coins.
- Four space separated integer values.
- Constraints:
- 0 < n < 1000
Refer the sample output for formatting
Sample Input
13
Sample Output
6 1 3 2
Explanation
- The minimum number of coins required is 6 with in it:
- minimum number of 5 Rupee coins = 1
- minimum number of 2 Rupee coins = 3
- minimum number of 1 Rupee coins = 2
Using these coins, we can form any value with in the given value and itself, like below:
Here the given value is 13
- For 1 = one 1 Rupee coin
- For 2 = one 2 Rupee coin
- For 3 = one 1 Rupee coin and one 2 Rupee coins
- For 4 = two 2 Rupee coins
- For 5 = one 5 Rupee coin
- For 6 = one 5 Rupee and one 1 Rupee coins
- For 7 = one 5 Rupee and one 2 Rupee coins
- For 8 = one 5 Rupee, one 2 Rupee and one 1 Rupee coins
- For 9 = one 5 Rupee and two 2 Rupee coins
- For 10 = one 5 Rupee, two 2 Rupee and one 1 Rupee coins
- For 11 = one 5 Rupee, two 2 Rupee and two 1 Rupee coins
- For 12 = one 5 Rupee, three 2 Rupee and one 1 Rupee coins
- For 13 = one 5 Rupee, three 2 Rupee and two 1 Rupee coins
number = int (input ()) five = int ((number - 4) / 5) if ((number - 5 * five) % 2)== 0: one = 2 else: one = 1 two = (number - 5 * five - one) //2 print (one + two + five, five, two, one)
import java.util.*; public class Main { public static void main (String[]args) { System.out.println ("Enter the Number"); Scanner s = new Scanner (System.in); int number = s.nextInt (); int one = 0, two = 0; int five = (number - 4) / 5; if (((number - 5 * five) % 2) == 0) { one = 2; } else { one = 1; } two = (number - 5 * five - one) / 2; System.out.println (one + two + five); System.out.println (five); System.out.println (two); System.out.println (one); } }
Question 5 : Permutations
Williamson is an analyst he needs to analyse a particular topic for performing analysis for that he needs to find a permutation of a given object.He don’t know how to find permutation so for simplifying his work he is hiring one software developer who can code for him and find a permutation and combination of a given object.
Consider you are giving an interview to williamson for working with him. Find a permutation of given input to proof that you are fit for his requirement.
Input Specification:
nCr where n and r are numbers given by Williamson to you
nCr is defined as n! / (r! x (n-r)!)
Here, n! denotes the factorial of a number. Also, you have to calculate this number as modulo
Input Specification:
- input1: The number n.
- Input2: The number r.
- Input3: The number m,
.
Output specification:
- The value of nCr%m.
Example 1:
Input1: 3
Input2: 2
Input3: 10000000009
Output:3
Explanation:
n=3.r=2,m=100 So, n!=3!=6, r!=2!=2, (n-1)!= 1!=1.
So, nCr = (6/(2*1))%1000000009= 3.
Example 2:
input1: 5
input2: 2
input3: 1000000009
Output: 10
Explanation:
n=5,r=2, m=100 So, n!=5!=120, r!=2=2, (n-1)!= 3!=6.
So, nCr = (120/(2*6))%1000000009= 10.
import java.util.*; public class Main { static int fact (int number) { int f = 1; int j = 1; while (j & lt; = number) { f = f * j; j++; } return f; } public static void main (String args[]) { Scanner sc = new Scanner (System.in); int n = sc.nextInt (); int r = sc.nextInt (); long m = sc.nextLong (); int result = fact (n) / (fact (r) * fact (n - r)); long finalresult = (long) result % m; System.out.println ("" + result); } }
import math n = int (input ()) r = int (input ()) m = int (input ()) #nCr= (n!)/((n-r)!)*(r!) numerator=(math.factorial(n)) denominator=(math.factorial(n-r))*math.factorial(r) ncr=numerator //denominator print(ncr%m)
FAQs related to Prolifics Coding Questions
Question 1: How many rounds are their in Prolifics Hiring Process?
After, 1st Round (i.e. Online Assessment including both Aptitude and Coding Questions) 2nd Rounds is Technical Interview and followed by H.R Interview.
Question 2: Is Coding questions asked in Prolifics Hiring Process?
Yes, In Online Assessment and Technical Interviews Coding Questions are included.
Question 3: What is the Eligibility Criteria for the Prolifics Hiring Process?
Minimum 60% or Equivalent C.G.P.A. is required throughout the academics. B.E / B.Tech in any stream or M.C.A is acceptable in this Company’s Hiring Process.
Question 4: In which field Prolifics works?
Prolifics is a multinational IT services and solutions company that provides a wide range of digital transformation services, including application development, data analytics, cloud computing, cybersecurity, and business process automation.
Prolifics is known for its expertise in IBM technologies, including IBM WebSphere, IBM MQ, IBM DataPower, and IBM Cloud Pak.
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
Login/Signup to comment