Axeno Consulting Coding Questions and Answers
Axeno Consulting Coding Questions with Solutions
This page will help you to get Axeno Consulting Coding Questions and Answers asked in the Recruitment Process of the company. Other than that you will find Insights on Online Assessments, Technical Assessment – Interview, Eligibility Criteria, CTC Offered, Job Profiles offered by the company.
For getting details, please go through this page where we have mentioned the details of Software Engineer Job profile that Axeno is offering with the package of 4.5 LPA.
Details on Axeno Consulting Hiring Process
This Recruitment process consists of the following steps :
- Online Aptitude Test
- Online Coding Test
- Technical Interview
- HR Interview
We have mentioned further details of the Axeno Consulting Hiring Process 2023 in the following Tabular Form:
Axeno Consulting | Related Information |
---|---|
Position : | Software Engineer |
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Cost to Company (CTC) |
|
Selection Process : |
|
Joining Location : |
|
During Internship, Company will train the Selected Interns for 6 months before converting into full time employee. They will be giving the Training on following technologies:
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Axeno Consulting Coding Questions with Solutions
Question 1 : Network Stream
Problem Statement :
A stream of n data packets arrives at a server. This server can only process packets that are exactly 2^n units long for some non-negative integer value of n (0<=n).
All packets are repackaged in order to the 1 largest possible value of 2^n units. The remaining portion of the packet is added to the next arriving packet before it is repackaged. Find the size of the largest repackaged packet in the given stream.
Example arriving Packets = [12, 25, 10, 7, 8]
The first packet has 12 units. The maximum value of 2^n that can be made has 2^n = 2^3 = 8 units because the next size up is 2^n = 2^4 = 16 (16 is greater than 12).
12 – 8 = 4 units are added to the next packet. There are 4 + 25 = 29 units to repackage, 2^n = 2^4 = 16 is the new size leaving 9 units (29-16 = 9)
Next packet is 9 + 10 = 29 unists & the maximum units(in 2^n) is 16 leaving 3 units.
3 + 7 = 10 , the max units is 8 Leaving 2 units, and so on.
The maximum repackaged size is 16 units.
Returns:
Long : the size of the largest packet that is streamed
Constraints :
1<=n<=10^5
1<=arriving Packets[i] size<=10^9
Sample case 0 :
Sample input 0:
5 → number of packets=5
13→ size of packets=[13,25,12,2,8]
25
10
2
8
Sample output 0:
16
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[] = new int[n]; for (int i = 0; i < n; i++) arr[i] = sc.nextInt(); int temp = 1, max = Integer.MIN_VALUE; for (int i = 0; i < n - 1; i++) { temp = 1; while (2 * temp <= arr[i]) temp = temp * 2; max = Math.max(temp, max); arr[i + 1] += arr[i] - temp; } temp = 1; while (2 * temp <= arr[n - 1]) temp = temp * 2; max = Math.max(temp, max); System.out.println(max); } }
def largeRepackagedPacket(arr): twoP = [int(2**i) for i in range(31)] x = 0 ans = 0 for i in arr: i = i + x for j in range(31): if i < twoP[j]: break x = i - twoP[j - 1] if ans <= twoP[j - 1]: ans = twoP[j - 1] return ans Packets = [] for i in range(int(input())): Packets.append(int(input())) print(largeRepackagedPacket(Packets))
Question 2 : Share Holder (R -> Hard)
Problem statement :
Ratan is a crazy rich person. And he is blessed with luck, so he always made the best profit possible with the shares he bought. That means he bought a share at a low price and sold it at a high price to maximize his profit. Now you are an income tax officer and you need to calculate the profit he made with the given values of stock prices each day. You have to calculate only the maximum profit Ratan earned.
Note that:
Ratan never goes into loss.
Example 1 :
Price=[1,6,2]
Ratan buys it on the first day and sells it on the second.
Example 2 :
Price=[9,8,6]
The Price always went down, Ratan never bought it.
Input Format:
First line with an integer n, denoting the number days with the value of the stack
Next n days, telling the price of the stock on that very day.
Output Format:
Maximum profit done by Ratan in a single line.
Constraints:
Number of days <=10^8
Sample Input for Custom Testing
STDIN
———–
7
1
9
2
11
1
9
2
Sample Output
10
Explanation
The maximum profit possible is when Ratan buys it in 1 rupees and sells it in 11.
#include <bits/stdc++.h> using namespace std; int solve(vector < int > v) { int n = v.size(); if (n == 0) return 0; int mx = v[0]; for (int i = 1; i < n; i++) mx = max(mx, v[i]); if (mx <= 0) return 0; int mxSum = 0; int cSum = 0; for (int i = 0; i < n; i++) { cSum += v[i]; if (cSum < 0) cSum = 0; mxSum = max(mxSum, cSum); } return mxSum; } int main() { int n; cin >> n; int price[n]; for (int i = 0; i < n; i++) cin >> price[i]; vector < int > diff; for (int i = n - 2; i >= 0; i--) diff.push_back(price[i + 1] - price[i]); int ans = solve(diff); if (ans < 0) cout << 0 << endl; else cout << ans << endl; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int price[] = new int[n]; for (int i = 0; i < n; i++) { price[i] = sc.nextInt(); } Vector < Integer > diff = new Vector < > (); for (int i = n - 2; i >= 0; i--) { diff.add(price[i + 1] - price[i]); } int ans = solve(diff); if (ans < 0) { System.out.println(0); } else { System.out.println(ans); } } private static int solve(Vector < Integer > v) { int n = v.size(); if (n == 0) { return 0; } int mx = v.get(0); for (int i = 1; i < n; i++) { mx = Math.max(mx, v.get(i)); } if (mx <= 0) { return 0; } int mxSum = 0, csum = 0; for (int i = 0; i < n; i++) { csum += v.get(i); if (csum < 0) csum = 0; mxSum = Math.max(csum, mxSum); } return mxSum; } }
def func(diff): n=len(diff) if n==0: return 0 mx=max(diff) if mx <= 0: return 0 mxS=0 cS=0 for i in diff: cS+=i if cS <= 0: cS=0 mxS=max(cS,mxS) return mxS n=int(input()) arr=[] diff=[] ans=[0] for i in range(n): arr.append(int(input())) for i in range(n-1): diff.append(arr[i+1]-arr[i]) ans=func(diff) if ans < 0: print("0") else: print(ans)
Question 03: Formatting large Products
Problem Statement: Rohan is weak in mathematics.He is giving mathematics Olympiad , but he got stuck in one of the question .Help rohan to solve the question.In Question there are two positive integer A and B. You have to find the product of all integer between A and B which is represented in the form C=D*10^E , where C is the product of numbers , D and E are non-negative integers and the last digit of D is non-zero.
Function Description
- Complete the function formatProducts in the editor below, formatProduct must return a string that represents C in the above described form.
- Function has the following parameters
- A: an integer
- B: an integer
Constraints
- A will between 1 and 1,000,000 . Inclusive.
- B will be between A and 1,000,000. Inclusive.
Sample Input 0
- 1
- 5
Sample Output 0
- 12 * 10^1
Explanation
- 1*2*3*4*5=120 = 12 * 10^1
Sample Input 1
- 3
- 10
Sample Output 1
- 18144 * 10^2
Explanation
- 3*4*….*10=1814400 =18144 * 10^2
import java.util.*; public class Main { public static String formatProducts (int a, int b) { int result = 1; for (int i = a; i <= b; i++) result = result * i; int temp = result; int power = 0; while ((result % 10) == 0) { power = power + 1; result = result / 10; } return result + " * 10^" + power; } public static void main (String[]args) { Scanner sc = new Scanner (System.in); int a = sc.nextInt (); int b = sc.nextInt (); System.out.println (formatProducts (a, b)); } }
def formatProducts(L,H): a=1 for i in range(L,H+1): a=a*i c=0 while(True): if a%10!=0: break else: c+=1 a=a//10 return (str(a)+" * 10^"+str(c)) L=int(input()) H=int(input()) print(formatProducts(L,H))
Question 4 : Last student’s ID (R->Medium+)
Problem Statement :
There is an id code that is supposed to be given to all the aspirants of an exam. It is actually a substring of a given string. That means, the authority takes a string and then assigns all the unique substrings to all the students. Suppose there is a string “abcde”, so the ids of the students will be “a”,”b”,”c”,”d”,”e”,’ab”,”abc”,”abcd”,”abcde”,”bc”,”bcd”,”bcde”,”cd”,”cde”,”de”.
The students are standing in a line according to the lexicographic order of their given ids. You have to find out the id of the last student for the given input string from which the ids are generated.
Input Format:
Single line with the id generating string
Output format:
The last id as per lexicographical order
Constraints:
Number of characters in the string<=10^9
Sample Input:
abdc
Sample output:
dc
Explanation:
The last student will be with the id dc. The order will be
abdc
a
ab
abd
abdc
b
bd
bdc
c
d
dc
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; vector < string > v; for (int i = 0; i < s.length(); i++) { v.push_back(s.substr(i, s.length() - i)); //cout<<v[i]<<endl; } sort(v.begin(), v.end(), greater < string > ()); cout << v[0]; }
import java.util.*; public class Main { public static String maxString(char set[]) { int n = set.length; String temp = ""; TreeSet < String > list = new TreeSet < > (); for (int i = 0; i < n; i++) { temp = ""; for (int j = i; j < n; j++) { temp = temp + set[j]; list.add(temp); } } return list.last(); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); char arr[] = str.toCharArray(); System.out.println(maxString(arr)); } }
s = input() j = 1 c = 0 while j < len(s): if ord(s[c]) < ord(s[j]): c = j j += 1 print(s[c:])
Question 5: Momentum LinkedList
Problem Statement :
Ratul made a linked list, a list made of n nodes, where every node has two variables, the velocity and the mass of a particle.
Since all the particles have the velocity in the same direction, find the total momentum of the entity made by the particles from the linked list.
Constraints :
1<=n<=10000
1<=m,v<=100
Input format:
First line containing n, number of nodes
Then n lines containing the mass and the velocity space separated.
Output Format:
Single integer denoting the momentum
Sample Input:
4
1 3
2 4
2 3
4 5
Sample Output:
37
#include <bits/stdc++.h> using namespace std; int main() { int n, s = 0, m, v; cin >> n; for (int i = 0; i < n; i++) { cin >> m >> v; s += (m * v); } cout << s; }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int s = 0; for (int i = 0; i < n; i++) { int m = sc.nextInt(); int v = sc.nextInt(); s += (m * v); } System.out.println(s); } }
n = int(input()) s = 0 for i in range(n): m, v = map(int, input().split()) s += m * v print(s)
FAQs related to Axeno Coding Questions
Question 1: What is the salary of software engineer in Axeno consulting?
Average Axeno Software Engineer salary in India is ₹ 8.2 Lakhs for experience between 1 years to 5 years.
And for freshers, the salary ranges between ₹ 4.3 Lakhs to ₹ 14.3 Lakhs.
Question 2: Does Axeno asks coding questions in its Hiring Process?
Yes, Axeno asks coding questions in there Online Coding Test and Technical Interview.
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