Zscaler Coding Questions and Answers
About Coding Questions of Zscaler
In this page you will find out all the details related Zscaler Coding Questions and Aptitude Questions asked in online assessment of Hiring Process. Apart from that here you will also find out the insights on Specific JobProfile, Interview Process, Eligibility Criteria, various steps in selection process and Offered CTC.
About Zscaler
Zscaler is the cloud services oriented company founded in 2007 by Jay Chaudhary and K. Kailash. It provides the best Cyber Security services and solutions through Cloud Services.
Regardless of the device, location, or network, it delivers a cloud-based, SAAS security platform that includes web and mobile security, threat protection, cloud application visibility, and networking solutions. It also enables rapid, secure connections between users and their applications or softwares.
About Zscaler Recruitment Process
The Online Assessment consists of 2 sections :
- Online Coding Assessment
- Pre-Placement Talk
- Technical Interview [ 2 – 3 Rounds ]
- HR Round
We have even tabulated some more information for your reference and understanding.
Zscaler | Related Informations |
---|---|
Position : |
|
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Cost to Company (CTC) |
|
Salary Breakdown : |
|
Selection Process: |
|
Important details of JobRoles Offered :
Specific programming skills are required according to different JobRoles like –
- Dev Roles – Developer ( C Programming )
- DevTest for C / C++, Java Programming
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Sample Zscaler Coding Questions and Answers
Question 1 :Devil Groups (R->Easy)
Problem statement :
There are some groups of devils and they splitted into people to kill them. Devils make People to them left as their group and at last the group with maximum length will be killed. Two types of devils are there namely “@” and “$”
People is represented as a string “P”
Input Format:
First line with the string for input
Output Format:
Number of groups that can be formed.
Constraints:
2<=Length of string<=10^9
Input string
PPPPPP@PPP@PP$PP
Output
7
Explanation
4 groups can be formed
PPPPPP@
PPP@
PP$
PP
Most people in the group lie in group 1 with 7 members.
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a = 0, mx = 0; for (int i = 0; i < s.length(); i++) { a++; if (s[i] == '@' || s[i] == '
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); str = str.replace("@", " "); str = str.replace("$", " "); String arr[] = str.split(" "); int max = 0; for (int i = 0; i < arr.length; i++) max = Math.max(max, arr[i].length()); System.out.println(max + 1); } }
s = input() s = s.replace("@", " ").replace("$", " ") s = s.split() ans = [] for i in s: ans.append(len(i) + 1) ans[-1] -= 1 print(max(ans))
Question 2 : Coin Game
Raman was playing a game, he starts with x coins. Now in every step, he wins and loses and he has to get the money or pay the money as needed. He came in contact with a psychic who can see the future and the Psychic predicted the outcomes after each step. Now Raman wants to start the game with the minimum wage where he doesn’t run out of money. Help Raman to find what money he should start with. The only rule to keep playing is not going in a credit situation.
Input Format:
- First line with n, number of steps in the game
- Next n lines, n integers denoting outcomes of every game. Positive means winning and negative means losing that money.
Output Format:
- One single integer denoting the minimum amount to start with
Constraints:
- Number of steps<=10^9
- -1000<=Money needed in each step<=1000
Sample Input:
4
2
-9
15
2
Sample Output:
7
Explanation:
If he starts with 7 rupees, then after steps : 7 ->9 -> 0-> 15 -> 17.
#include using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; int sum=0,ans=0; for(int i=0;i<n;i++) { sum+=a[i]; if(sum<1) { sum=-sum; ans+=sum; sum=0; } } 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 arr[]=new int[n]; for(int i=0;i<n;i++) arr[i]=sc.nextInt(); int sum=0,ans=0; for(int i=0;i<n;i++) { sum+=arr[i]; if(sum<1) { sum=-sum; ans+=sum+1; sum=1; } } System.out.println(ans); } }
n=int(input()) arr=[] for i in range(n): arr.append(int(input())) s,a=0,0 for i in arr: s=s+i if(s<1): a=a+(-1*s) s=0 print(a)
Question 3 : PrepInsta Name : Borrow Number
Problem statement : You have two numbers number1 and number2, your job is to check the number of borrow operations needed for subtraction of number1 from number2. If the subtraction is not possible
then return the string not possible.
Example :
- 754
- 658
Answer :
- 2
- 654
- 666
#include <bits/stdc++.h> using namespace std; int main() { string s1,s2; int c=0,f=0; cin>>s1>>s2; if(stoi(s1)< stoi(s2)) {cout<<"Impossible";} reverse(s1.begin(),s1.end()); reverse(s2.begin(),s2.end()); for(int i=0;i< s1.length();i++) if(s1[i]< s2[i]) {f=1;c++;} else if(s1[i]==s2[i]) { if(f==1) {c++;} f=0; } else f=0; cout<< c; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int number1=sc.nextInt(); int number2=sc.nextInt(); int count=0; if(number1< number2) { System.out.println("Not possible"); } else { boolean flag=false; while(number1!=0 && number2!=0) { int temp1=0; int temp2=number2%10; if(flag) temp1=number1%10-1; else temp1=number1%10; if(temp1< temp2) { count++; flag=true; } else flag=false; number1=number1/10; number2=number2/10; } System.out.println(count); } } }
number1=int(input()) number2=int(input()) count=0 if(number1< number2): print("Not possible") else: flag=0 while(number1!=0 and number2!=0): temp1=0 temp2=number2%10 if(flag): temp1=number1%10-1 else: temp1=number1%10 if(temp1< temp2): count+=1 flag=1 else: flag=0 number1=number1//10 number2=number2//10 print(count)
Question 4 : Coin Game (R->Medium)
Problem Statement :
Raman was playing a game, he starts with x coins. Now in every step, he wins and loses and he has to get the money or pay the money as needed. He came in contact with a psychic who can see the future and the Psychic predicted the outcomes after each step. Now Raman wants to start the game with the minimum wage where he doesn’t run out of money. Help Raman to find what money he should start with. The only rule to keep playing is not going in a credit situation.
Input Format:
First line with n, number of steps in the game
Next n lines, n integers denoting outcomes of every game. Positive means winning and negative means losing that money.
Output Format:
One single integer denoting the minimum amount to start with
Constraints:
Number of steps<=10^9
-1000<=Money needed in each step<=1000
Sample Input:
4
2
-9
15
2
Sample Output:
7
Explanation:
If he starts with 7 rupees, then after steps : 7 ->9 -> 0-> 15 -> 17.
#include using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int sum = 0, ans = 0; for (int i = 0; i < n; i++) { sum += a[i]; if (sum < 1) { sum = -sum; ans += sum; sum = 0; } } 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 arr[] = new int[n]; for (int i = 0; i < n; i++) arr[i] = sc.nextInt(); int sum = 0, ans = 0; for (int i = 0; i < n; i++) { sum += arr[i]; if (sum < 1) { sum = -sum; ans += sum + 1; sum = 1; } } System.out.println(ans); } }
n = int(input()) arr = [] for i in range(n): arr.append(int(input())) s, a = 0, 0 for i in arr: s = s + i if s < 1: a = a + (-1 * s) s = 0 print(a)
Question 5 :A Good Prime Number
Problem Statement :
A prime number is a number which is divisible by one and itself. Also a number is called a good prime number if the sum of its digits is a prime number. For example a number 23 is a good prime number because the sum of 2 and 3 ( 2+3=5) is 5 which is a prime number. You are given an integer K. Your task is to find the kth good prime number that is greater than a provided number N.
For example , 232 is a good prime number since the sum of all digits is 7 which is a prime number whereas 235 is not a good prime number.
Input format :
- The first line contains an integer N.
- The next line contains an integer K.
Output format :
A single integer which is a Kth good prime number that is greater than a provided number N.
Constraints :
- 1<=N<=10^5
- 1<=K<<=10^5
Sample Input 1:
4 4
Sample Output 1:
12
Explanation :
Good prime numbers starting from 4 are 5,7,11(1+1=2 which is prime number),12(1+2=3 which is prime number),14(1+4=5 which is a prime number) and so on. Because the sum of digits of an individual number is a prime number And 4 th good prime number is 12 in this series.Hence the output is 12.
Sample Input 2:
17 5
Sample Output 2:
29
Explanation :
Good prime numbers starting from 17 are 20,21,23,25,29…and the 5th prime number is 29.Hence the output is 29.
#include #include<bits/stdc++.h> using namespace std; bool isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i = i + 6) if ((n % i == 0) || (n % (i + 2) == 0)) return false; return true; } int solve(int n, int k) { int c = 0; vector < int > list; for (int i = n + 1; c < k; i++) { int temp = i; int sum = 0; while (temp != 0) { sum = sum + temp % 10; temp = temp / 10; } if (isPrime(sum)) { list.push_back(i); c++; } } return list[k - 1]; } int main() { int n; cin >> n; int k; cin >> k; cout << solve(n, k); return 0; }
import java.util.*; class Main { public static boolean isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i = i + 6) if ((n % i == 0) || (n % (i + 2) == 0)) return false; return true; } public static int solve(int n, int k) { int c = 0; ArrayList < Integer > list = new ArrayList < > (); for (int i = n + 1; c < k; i++) { int temp = i; int sum = 0; while (temp != 0) { sum = sum + temp % 10; temp = temp / 10; } if (isPrime(sum)) { list.add(i); c++; } } return list.get(k - 1); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); System.out.println(solve(n, k)); } }
import math def isPrime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == 0: return False for i in range(5, int(math.sqrt(n)) + 1, 6): if n % i == 0 or n % (i + 2) == 0: return False return True def solve(n, k): c = 0 list = [] for i in range(n + 1, 1000000000): temp = i sum = 0 while temp != 0: sum = sum + temp % 10 temp = temp // 10 if isPrime(sum): list.append(i) c += 1 if c == k: break return list[k - 1] n, k = map(int, input().split()) print(solve(n, k))
FAQs on Zcaler Motors Coding Questions
Question 1: What is the minimum qualification required to apply for a job at Zscaler?
Candidates with Minimum 60% or equivalent percentage throughout the academics can apply for the Yamaha Motors Recruitment Process.
Eligible courses are B.E / B.Tech – All streams or M.C.A.
Question 2: What kind of job positions are available at Zscaler in India?
Zscaler in India offers a wide range of job positions across different departments, including engineering, product development, sales, marketing, and customer support.
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