Tekion Coding Questions and Answers
Tekion Coding Questions with Solutions
In this page, you will find out Tekion Coding Questions and Answers asked in Online Assessments and Technical Interviews involved in the Recruitment Process of the Company. Apart from that you will get more Insights Company’s Job Profile, Job Location, CTC Offered, Steps involved in the recruitment process, etc.
About Tekion
Tekion was co-founded by Jayaprakash Vijayan and Guru Sankararaman in 2016.
It is a startup that is creating a cloud-native Automobile Retail SaaS platform solution. It connects OEMs (Original Equipment Manufacturers), dealers, and consumers by implementing machine learning, artificial intelligence, and human-computer interaction (voice, touch, vision, sensors, and IoT) capabilities.
About Tekion Recruitment Process
Tekion Recruitment Process consists of the following steps :
- Online Assessment
- Technical Interview
- HR Interview
We have mentioned further details of the Tekion Recruitment Process in the following Tabular Form
Tekion | Related Information |
---|---|
Position : | Associate Software Engineer / Intern |
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Tekion’s CTC Breakdown : |
|
Selection Process : |
|
Joining Location : |
|
Tekion Job Description
Associate Software Engineer / Intern
This Job Role requires :
- Strong competencies in Programming Languages with Data Structures, Algorithms, Software Design, and Distributed System Applications.
- Familiar with project management tools like JIRAetc.
- Experience of working with Git
- Understanding of basic Rest Principles.
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Sample Tekion Coding Questions and Answers
Question 1 : Biggest Meatball
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:
Name | Type | Description |
N | Integer | How many people are participating in the hiring process. |
D | Integer | Day’s quantity, how many grams of meatball is being sold to every packet. |
Array[ ] | Integer array | Array 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.
#include<bits/stdc++.h> using namespace std; int main() { int n,x,a,m=0,maxPos=0; cin>>n; vector v(n); cin>>x; for(int i=0;i<n;i++){ cin>>v[i]; } for(int i=0;i<n;i++){ v[i]=(v[i]-1)/x; } for(int i=0;i<n;i++){ if(v[i]>=m){ m=v[i]; maxPos=i; } } cout<<maxPos+1; }
n=int(input()) m=0 mxPos=0 v=[0]*n x=int(input()) for i in range(n): v[i]=int(input()) for i in range(n): v[i]=(v[i]-1)//x for i in range(n): if v[i]>=m: m=v[i] mxPos=i print(mxPos+1)
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner (System.in); int n=sc.nextInt(); int v[]= new int[n]; int x=sc.nextInt(); for(int i=0; i<n; i++) v[i]=sc.nextInt(); for(int i=0;i<n;i++){ v[i]=(v[i]-1)/x; } int m=0, maxPos=0; for(int i=0;i<n;i++){ if(v[i]>=m){ m=v[i]; maxPos=i; } } System.out.println(maxPos+1); } }
Question 2 : 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+int(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 3 :
How will we represent a binary tree? We can use a bracket structure for all of the edges, like (Parentnode , Childnode). Now if we use a node in child node more than once, the tree can not be valid. Same for the parent node, a node can not be taken more than twice in a graph as a parent node.
Suppose we see this one graph
(P,Q)(P,R)(Q,T)(R,W)(U,V)(Q,S)(R,U)(U,Z)(S,I)(W,Y)
A tree with those edges may be illustrated in many ways.Here are two:
P P
/ \ / \
Q R Q R
/ \ / \ / \ / \
S T U W S T U W
\ / \ \ / / \ \
I V Z Y I Z V Y
The following is a recursive definition for the S-expression of a tree.
S-exp(node)=(node->val(S-exp(node->first_child))(S-exp(node->second_child))),if node
!NULL=””,node= =NULL
Where first_child->valval(first_child->val is lexicographically than second_child->val)
This tree can be represented in S-expression in multiple ways.The lexicographically smallest way of expressing it as follows:
P(Q(S(I))(T))(R(U(V)(Z))(W(Y))))
Translate the node-pair representation into its lexicographically smallest S-expression or report any errors that do not conform to the definition of the binary tree.
The List of errors with their codes is as follows:
Error Reason
Code Stopped1 More than 2 children
Code Stopped2 Duplicate Edges
Code Stopped3 Cycle Present(node is direct descendant of more than one node)
Code Stopped4 Multiple Roots
Code Stopped5 Any other error
Constraints:
- All node names are single characters in the range ascii[A-Z].
- The maximum node count is 26.
- There is no specific order to the input (parent,child) pairs.
>Input Format for Custom Testing
>Sample Case 0
Sample Input 0
- (B,D) (D,E) (A,B) (C,F) (E,G) (A,C)
Sample output 0
- (A(B(D(E(G))))(C(F)))
Explanation 0
A representation of tree is as follows:
A
/ \
B C
/ \
D F
/
E
/
G
>Sample Case 1
Input:
- (C,E)(D,F)(A,B)(A,C)(B,K)
Output:
- A(B(K))(C(E)))D(F))
#include<bits/stdc++.h> using namespace std; string s, ans = ""; unordered_map < char, int > root, child, flag; //rootOf,childOf map < pair < char, char > , int > duplicateedgecheck; //Duplicate edge check unordered_map < char, char > par, ch[2], monitor; char find(char c) { if (monitor[c]) return monitor[c]; if (root[c] == 0) return monitor[c] = c; return monitor[c] = find(par[c]); } void makeans(char c) { if (flag[c] == 0) { ans += c; flag[c]++; if (child[c] == 2) { ans += '('; makeans(min(ch[0][c], ch[1][c])); ans += '('; makeans(max(ch[0][c], ch[1][c])); } else for (int i = 0; i < child[c]; i++) { ans += '('; makeans(ch[i][c]); } ans += ')'; } } int main() { getline(cin, s); for (int i = 0; i < 26; i++) { root['A' + i] = -5; } for (int i = 0; i < s.length(); i++) if (s[i] == '(') { child[s[i + 1]]++; root[s[i + 3]] = root[s[i + 3]] == -5 ? 1 : root[s[i + 3]]++; duplicateedgecheck[{ min(s[i + 1], s[i + 3]), max(s[i + 1], s[i + 3]) }]++; root[s[i + 1]] == -5 ? root[s[i + 1]] = 0 : 1; ch[0][s[i + 1]] == '\0' ? ch[0][s[i + 1]] = s[i + 3] : ch[1][s[i + 1]] = s[i + 3]; par[s[i + 3]] = s[i + 1]; if (child[s[i + 1]] > 2) { cout << "Code Stopped1"; return 0; } if (duplicateedgecheck[{ min(s[i + 1], s[i + 3]), max(s[i + 1], s[i + 3]) }] > 1) { cout << "Code Stopped2"; return 0; } if (find(s[i + 1]) == find(s[i + 3]) && s[i + 1] != par[s[i + 3]]) { cout << "Code Stopped3"; return 0; } if (root[s[i + 3]] > 1) { cout << "Code Stopped4"; return 0; } if (s[i + 4] != ')' || s[i + 2] != ',') { cout << "Code Stopped5"; return 0; } //i+=5; } for (int i = 0; i < 26; i++) { if (root['A' + i] == 0) makeans('A' + i); } cout << ans; }
Question 4
Karan got bored, so he invented a game to be played on paper. He writes n integers a1, a2, …, an. Each of those integers can be either 0 or 1. He’s allowed to do exactly one move: he chooses two indices i and j (1 ≤ i ≤ j ≤ n) and flips all values ak for which their positions are in range [i, j] (that is i ≤ k ≤ j). Flip the value of x means to apply operation x = 1 – x.
The goal of the game is that after exactly one move to obtain the maximum number of ones. Write a program to solve the little game of Iahub.
Input
- The first line of the input contains an integer n (1 ≤ n ≤ 100). In the second line of the input there are n integers: a1, a2, …, an. It is guaranteed that each of those n values is either 0 or 1.
Output
- Print an integer — the maximal number of 1s that can be obtained after exactly one move.
Examples
- Input
5
1 0 0 1 0 - Output
4
- Input
4
1 0 0 1 - Output
4
Note
- In the first case, flip the segment from 2 to 5 (i = 2, j = 5). That flip changes the sequence, it becomes: [1 1 1 0 1]. So, it contains four ones. There is no way to make the whole sequence equal to [1 1 1 1 1].
- In the second case, flipping only the second and the third element (i = 2, j = 3) will turn all numbers into 1.
n = int(input()) arr = list(map(int,input().split())) ones =0 for i in range(n): if arr[i] == 1: ones += 1 arr[i] = -1 else : arr[i] = 1 if ones == n: print(n-1) else : max_sum = 0 curr_sum =0 for i in range(n): curr_sum += arr[i] max_sum = max(max_sum, curr_sum) if curr_sum < 0 : curr_sum =0 print(ones + max_sum)
import java.util.*; public class Main { public static void main (String[]args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt (); int countZero = 0, countOne = 0, max = -1; while (n-- > 0) { int temp = sc.nextInt (); if (temp == 1) { countOne++; if (countZero > 0) countZero = countZero - 1; } else { countZero++; if (countZero > max) max = countZero; } } System.out.println (countOne + max); } }
#include<bits/stdc++.h> using namespace std; int main () { int n; cin >> n; int ones = 0; int a[n]; for (int i = 0; i < n; i++){ cin >> a[i]; if (a[i] == 1){ ones++; a[i] = -1; } else a[i] = 1; } if(ones == n) { cout << n - 1; } else { int max_sum = 0, curr_sum = 0; for (int i = 0; i < n; i++) { curr_sum += a[i]; max_sum = max (max_sum, curr_sum); if (curr_sum < 0) curr_sum = 0; } cout << ones + max_sum; } return 0; }
Question 5 :
Anirudh is attending an astronomy lecture. His professor who is very strict asks students to
Write a program to print the trapezium pattern using stars and dots as shown below . Since Anirudh is not good in astronomy can you help him?
Sample Input:
N = 3
Output:
**.**
*…*
…..
*…*
**.**
#include<stdio.h> int main() { int i, j, n; scanf("%d", & n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (j < n - i - 1) printf("*"); else printf("."); } for (j = 0; j < n - 1; j++) { if (j < i) printf("."); else printf("*"); } printf("\n"); } for (i = 2; i <= n; i++) { for (j = 0; j < n; j++) { if (j < i - 1) printf("*"); else printf("."); } for (j = 0; j < n - 1; j++) { if (j < n - i) printf("."); else printf("*"); } printf("\n"); } return 0; }
FAQs related to Tekion Coding Questions
Question 1: How much time does Tekion Recruiting Team takes for starting On boarding process?
Tekion generally takes 9 – 10 days to On board freshers after completion of Interview process.
Question 2: What are the Perks and Benefits does Tekion offers to there employees?
2000 ESOPs [ Employee Stock Ownership Plan ] which is Company’s Stocks and Life Insurance Of ₹ 5 Lakhs is provided along with the salary to the employee.
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