Octro Inc. Coding Questions and Answers
Coding Questions asked in Octro Inc.
The Octro Inc. Coding Questions on this page will help you comprehend the coding element of the Octro Inc. recruitment campaign.Discover everything about Octro Inc. hiring procedures and coding questions on this website. You’ll discover comprehensive information on the Octro Inc. hiring procedure, qualification standards, and salary scale.
About Octro Inc.
Octro Inc. was established in 2006 with the goal of developing mobile productivity tools. OctroTalk, one of the earliest mobile Voice-over-IP infrastructures, was developed by the company before it began developing mobile gaming platforms.
The Octro games Teen Patti and Indian Rummy currently dominate charts on Apple iOS, Google Play, and Windows Phone 8 platforms, making the company one of the most rapidly expanding mobile gaming firms in existence.
Recruitment Process at Octro Inc.
Below is a detailed description of the hiring procedure for the hiring of candidates at Octro Inc..
- Remote MCQ test
- Remote Coding test
- F2F technical interview 2-3 rounds of selected candidates
We have even tabulated some more information for your reference and understanding.
Bosch Global Software Technologies | Related Information |
---|---|
Batch | 2023 |
Course | B.Tech (CSE & IT) |
Role |
|
Type of Hiring | Internship+ FTE |
Internship Duration | 6 – 8 months |
Required Skillset |
|
Stipend | Rs. 25,000/- per month |
CTC | 8 – 15 LPA |
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Sample Octro.Inc Coding Questions and Answers
Question 1 : Capitalize/Decapitalize
Problem Statement :
You’re given a function that accepts the following, a string1, its length and a character c. Your job is to replace all the occurrences of character c in string1 and capitalize it or decapitalize it based on the character c.
Input :
hello world
l
Output :
heLLo worLd
Input :
prepinsta
p
Output :
PrePinsta
#include <bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); char k; cin >> k; for (auto i: s) if (i == k) { if (i > 95) cout << char(i - 32); else cout << char(i + 32); } else cout << i; }
import java.util.Scanner; public class Main { public static void change(String str, char c, int len) { char[] ch = str.toCharArray(); for (int i = 0; i < ch.length; i++) { if (c == ch[i]) { if (Character.isUpperCase(ch[i])) { ch[i] = Character.toLowerCase(ch[i]); } else if (Character.isLowerCase(ch[i])) { ch[i] = Character.toUpperCase(ch[i]); } } } System.out.print(new String(ch)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); char c = sc.next().charAt(0); int len = str.length(); change(str, c, len); } }
ss = input() k = input() if k.isupper(): s = s.replace(k, chr(ord(k) + 32)) else: s = s.replace(k, chr(ord(k) - 32)) print(s)
Question 2 : Loki’s Mind Stone
Problem Statement :
Loki, the God of mischief can brainwash any living person by touching him/her with his Mind stone, and has decided to break the avengers (a warrior group) to face into each other, so that they can turn against each other and make Loki’s evil plans easier. Now all the avengers have some amount of strength that is denoted in integers. Loki wants to brainwash the least amount of people possible, because he is lazy. But he wants his team of avengers to win the battle. What is the number of avengers Loki will get brainwashed.
Input Format:
First line contains an integer n, denoting the number of total avengers
the next line contains n space separated integers denoting the power of each avenger.
Output Format:
One line denoting the total number of avengers brainwashed by Loki’s Mind stone.
Constraints:
2<=n<=10^6
Test case:
Sample Input:
6
9 3 1 2 4 2
Sample Output:
2
Output Specifications:
Loki can brainwash the avengers with power 9 and 3, or with 9 and 2, or with 9,4, and the rest will be losing cause cumulative power of rest avengers is less than the brainwashed total power by Loki.
#include <bits/stdc++.h> using namespace std; map < int, int > m; int main() { int n, sum = 0, sum2 = 0, ans = 0; cin >> n; vector < int > v(n); for (int i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } sort(v.begin(), v.end(), greater < int > ()); sum /= 2; while (sum2 <= sum && ans < n) { sum2 += v[ans]; ans++; } cout << ans; }
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]; int sum = 0; for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); sum = sum + arr[i]; } Arrays.sort(arr); int sum1 = 0, count = 0; for (int i = arr.length - 1; i >= 0; i--) { sum1 = sum1 + arr[i]; sum = sum - arr[i]; count++; if (sum1 > sum) break; } System.out.println(count); } }
n = int(input()) arr = list(map(int, input().split())) s = sum(arr) arr.sort(reverse=True) dup, sum1, ans = 0, 0, 0 for i in arr: dup += i sum1 = s - dup ans += 1 if sum1 < dup: break print(ans)
Question 3: Trapezium pattern
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 at 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; }
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int i,j; for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(j<n-i-1) System.out.print("*"); else System.out.print("."); } for(j=0;j<n-1;j++){ if(j<i) System.out.print("."); else System.out.print("*"); } System.out.println(); } for(i=2;i<=n;i++){ for(j=0;j<n;j++){ if(j<i-1) System.out.print("*"); else System.out.print("."); } for(j=0;j<n-1;j++){ if(j<n-i) System.out.print("."); else System.out.print("*"); } System.out.println(); } } }
n=int(input()) for i in range(n): print("*"*(n-1-i)+"."*(2*i+1)+"*"*(n-1-i)) for i in range(n-1): print("*"*(i+1)+"."*(2*(n-2-i)+1)+"*"*(i+1))
Question 4 : Formatting large Products
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 5 : Minimizing a string
Problem Statement :
Given a string, obtain the alphabetically smallest string possible by swapping either
adjacent ‘a’ and ‘b’ characters or adjacent ‘b’ and ‘c’ characters, any number of times.
Note: A string x is alphabetically smaller
than a string y if, for the first index i where x
and y differs, x[i] <y[i].
Example :
s=”abaacbac”
The alphabetically smallest possible string is
obtained by applying the following
operations:
‘c’at index 5 is swapped with ‘b’at index 6. So “abaacbac” becomes “abaabcac”
Then,’b’at index 2 is swapped with ‘a’at index 3. So “abaabcac” becomes “aababcac”.
Finally, ‘b’at index 3 is swapped with ‘a’at index 4 to obtain the final.
answer: “aaabbcac”.
Function Description :
Complete the function smallestString in the
editor below.
smallestString has the following
parameter(s):
string s: the given string
Returns:
string: the lexicographically smallest string obtained after swapping
Constraints :
1 <_ length of s<_ 10^5 s only contains the characters ‘a’, ‘b’, and ‘c’.
#include <bits/stdc++.h> using namespace std; //a is the smaller char b is the bigger void f(string & s, char a, char b) { int n = s.length(); bool fg = false; int st = -1; for (int i = n; i >= 0; i--) { if (s[i] == b) { if (fg) { swap(s[i], s[st]); st--; } else { continue; } } else if (s[i] == a) { if (fg) { continue; } else { fg = true; st = i; } } else { fg = false; } } } int main() { string s; cin >> s; int n = s.length(); f(s, 'b', 'c'); f(s, 'a', 'b'); cout << s << endl; return 0; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); char arr[] = str.toCharArray(); int count = 0; for (int i = 0; i < arr.length; i++) { count = 0; for (int j = 0; j < arr.length - 1; j++) { if ((arr[j] - arr[j + 1]) == 1) { char temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; count++; } } if (count == 0) break; } System.out.println(new String(arr)); } }
s = list(input()) n = len(s) af = False fi = n + 1 for i in range(n - 1, -1, -1): if s[i] == "c": if af: s[i], s[fi] = s[fi], s[i] fi -= 1 af = False elif s[i] == "b": if af: continue else: fi = i af = True else: af = False af = False fi = n + 1 for i in range(n - 1, -1, -1): if s[i] == "b": if af: s[i], s[fi] = s[fi], s[i] fi -= 1 af = False elif s[i] == "a": if af: continue else: fi = i af = True else: af = False print(*s, sep="")
FAQs on Octro.Inc. Coding Questions
Question 1: Does Octro.Inc asks coding questions during their Hiring Process ?
Yes, in Online Coding Test and Technical Interview Octro.Inc asks the coding questions. We have mentioned some Sample Coding Questions in this page.
Question 2: What are the Skillset Octro.Inc usually demands from the freshers ?
They wants their employees to be aware of latest technologies like C/C++, Python, Java, JavaScript and Cloud Computing Platform like AWS, Azure,etc.
Question 3: What are the field in which Octro.Inc usually operates?
They primarily operates in the field of Software Development, App Development and Software Support System.
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