Junglee Games Coding Questions and Answers
Junglee Games Coding Questions with Solutions
This page will help you to get Junglee Games Coding Questions and Answers asked in the Recruitment Process of the company. Other than that you will find Insights on Online Assessments, Steps involved in the Recruitment Process, Eligibility Criteria, CTC Offered, Interview Rounds, and Job Profiles offered.
Junglee Games offers various roles for freshers, to get more specific details please go through this page.
About Junglee Games
With almost 75 million players, Junglee Games is a market leader in the skill gaming industry. Junglee Games is the world’s fastest-growing skill-gaming business. It was founded in San Francisco in 2012 and is backed by elite Silicon Valley Venture Capitals. Their most popular titles are Howzat, Eatme.io, Junglee Teen Patti, Solitaire Gold, and Junglee Rummy.
Apart from that their teams have contributed to AAA worldwide games like Rio, Mech Conquest, Real Steel, Rio 2, Star Wars: The Old Republic, and Dueling Blades.
About Junglee Games Recruitment Process
This Recruitment process consists of the following steps :
- Online Assessment [Aptitude, Verbal and Technical Based ]
- Technical Interview
- HR Interview
We have mentioned further details of the Junglee Games Recruitment Process in the following Tabular Form
Junglee Games | Related Information |
---|---|
Position : | QA Engineer |
Course : |
|
Eligibility Criteria / Academic Qualification Required : |
|
Cost to Company (CTC) |
|
Selection Process : |
|
Joining Location : |
|
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Sample Junglee Games Coding Questions With Solutions
Question 1: Parallel Columbus
Problem Statement – Nobel Prize-winning Austrian-Irish physicist Erwin Schrödinger developed a machine and brought as many Christopher Columbus from as many parallel universes as he could. Actually, he was quite amused by the fact that Columbus tried to find India and got America. He planned to dig it further.
Though totally for research purposes, he made a grid of size n X m, and planted some people of America in a position (x,y) [in 1 based indexing of the grid], and then planted you with some of your friends in the (n,m) position of the grid. Now he gathered all the Columbus in 1,1 positions and started a race.
Given the values for n, m, x, y, you have to tell how many different Columbus(s) together will explore you as India for the first time.
Remember, the Columbus who will reach to the people of America, will be thinking that as India and hence wont come further.
Function Description:
Complete the markgame function in the editor below. It has the following parameter(s):
Parameters:
Name | Type | Description |
n | Integer | The number of rows in the grid. |
m | Integer | The number of columns in the grid. |
x | Integer | The American cell’s Row. |
y | Integer | The American cell’s Column. |
Constraints:
- 1 <= n <= 10^2
- 1 <= m <= 10^2
- 1 <= x <= n
- 1 <= y <= m
Input Format:
- The first line contains an integer, n, denoting the number of rows in the grid.
- The next line contains an integer m, denoting the number of columns in the grid.
- The next line contains an integer, x, denoting the American cell’s row.
- The next line contains an integer, y, denoting the American cell’s column.
Sample Cases
Sample Input 1
2
2
2
1
Sample Output 1
1
Explanation
The only way possible is (1,1) ->(2,1) -> (2,2), so the answer is 1.
#include<bits/stdc++.h> using namespace std; unordered_map<int,long long int> f; long long int Fact(int n) { if(f[n]) return f[n]; return f[n]=n*Fact(n-1); } int main() { int n,m,x,y; cin>>n>>m>>x>>y; n-=1;m-=1;x-=1;y-=1; f[0]=f[1]=1; int p=(Fact(m+n)/(Fact(m)*Fact(n))); int imp=((Fact(x+y)/(Fact(x)*Fact(y)))*(Fact(m-x+n-y)/(Fact(m-x)*Fact(n-y)))); cout<<p-imp; }
import math n=int(input())-1 m=int(input())-1 x=int(input())-1 y=int(input())-1 ans=math.factorial(n+m) ans=ans//(math.factorial(n)) ans=ans//(math.factorial(m)) ans1=math.factorial(x+y) ans1=ans1//(math.factorial(x)) ans1=ans1//(math.factorial(y)) x1=n-x y1=m-y ans2=math.factorial(x1+y1) ans2=ans2//(math.factorial(x1)) ans2=ans2//(math.factorial(y1)) print(ans-(ans1*ans2))
import java.util.*; class Main { static int f[] = new int[1000]; static int Fact(int n) { if(f[n]==1) return f[n]; return f[n]=n*Fact(n-1); } public static void main (String[]args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt (); int m = sc.nextInt (); int x = sc.nextInt (); int y = sc.nextInt (); n-=1;m-=1;x-=1;y-=1; f[0]=f[1]=1; int p=(Fact(m+n)/(Fact(m)*Fact(n))); int imp=((Fact(x+y)/(Fact(x)*Fact(y)))*(Fact(m-x+n-y)/(Fact(m-x)*Fact(n-y)))); System.out.println(p-imp); } }
Question 2: Consecutive Prime Sum
Problem Description
Question -: Some prime numbers can be expressed as a sum of other consecutive prime numbers.
- For example
- 5 = 2 + 3,
- 17 = 2 + 3 + 5 + 7,
- 41 = 2 + 3 + 5 + 7 + 11 + 13.
Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2.
Write code to find out the number of prime numbers that satisfy the above-mentioned property in a given range.
Input Format: First line contains a number N
Output Format: Print the total number of all such prime numbers which are less than or equal to N.
Constraints: 2<N<=12,000,000,000
#include<stdio.h> int prime(int b); int main() { int i,j,n,cnt,a[25],c,sum=0,count=0,k=0; printf("Enter a number : "); scanf("%d",&n); for(i=2;i<=n;i++) { cnt=1; for(j=2;j<=n/2;j++) { if(i%j==0) cnt=0; } if(cnt==1) { a[k]=i; k++; } } for(i=0;i<k;i++) { sum=sum+a[i]; c= prime(sum); if(c==1) count++; } printf(" %d",count); return 0; } int prime(int b) { int j,cnt; cnt=1; for(j=2;j<=b/2;j++) { if(b%j==0) cnt=0; } if(cnt==0) return 1; else return 0; }
Output Enter a number : 43 4
#include<bits/stdc++.h> using namespace std; int prime(int b) { int j,cnt; cnt=1; for(j=2;j<=b/2;j++) { if(b%j==0) cnt=0; } if(cnt==0) return 1; else return 0; } int main() { int i,j,n,cnt,a[25],c,sum=0,count=0,k=0; cout<<"Enter a number : "; cin>>n; for(i=2;i<=n;i++) { cnt=1; for(j=2;j<=n/2;j++) { if(i%j==0) cnt=0; } if(cnt==1) { a[k]=i; k++; } } for(i=0;i<k;i++) { sum=sum+a[i]; c= prime(sum); if(c==1) count++; } cout<<count; return 0; }
Output Enter a number : 5 1
import java.util.Scanner; class Main { static int prime(int b) { int j,cnt; cnt=1; for (j = 2; j <= b/2; j++) { if(b%j==0) cnt=0; } if(cnt==0) return 1; else return 0; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i,j,n=0,cnt,c=0,sum=0,count=0,k=0; Main t = new Main(); int[] a = new int[25]; System.out.println("Enter no"); n = sc.nextInt(); for (i = 2; i <=n ; i++) { cnt=1; for (j = 2; j <= n/2; j++) { if(i%j==0) cnt=0; } if(cnt==1) { a[k]=i; k++; } } for (i = 0; i < k; i++) { sum=sum+a[i]; c=t.prime(sum); if(c==1) count++; } System.out.println(count); } }
Output 43 4
num = int(input()) arr = [] sum = 0 count = 0 if num > 1: for i in range(2, num + 2): for j in range(2, i): if i % j == 0: break else: arr.append(i) def is_prime(sum): for i in range(2, (sum // 2) +2): if sum % i == 0: return False else: return True for i in range(0, len(arr)): sum = sum + arr[i] if sum <= num: if is_prime(sum): count = count + 1 print(count)
Output 20 2
Question 3
Fountains are installed at every position along a one-dimensional garden of length n. Array locations[] represents the coverage limit of these fountains. The ith fountain (where 1sisn) has a coverage limit of locations[i] that can range from the position max((i – locations[i]), 1) to min((i + locations[i]), n ). In other words, the h fountains do not reach outside the boundaries of the garden. In the beginning,all the fountains are switched off. Determine the minimum number of fountains that need to be activated to cover the n length garden by water.
Example
- n = 3
- locations[] = {0, 2, 13, then
- For position 1: locations[1] = 0, max((1 – 0),
- 1) to mini (1+0), 3) gives range = 1 to 1
- For position 2: locations[2] = 2, max((2-2),
- 1) to min( (2+2), 3) gives range = 1 to 3
- For position 3: locations[3] = 1, max( (3-1),
- 1) to min( (3+1), 3) gives range = 2 to 3
- For position 1: locations[1] = 0, max((1 – 0),
For the entire length of this garden to be covered, only the fountain at position 2 needs to be activated.
Function Description
Complete the function fountainActivation in the editor below.
fountainActivation has the following Parameter:
- int locations[n]: the fountain locations
Returns
- int: the minimum number of fountains that must be activated
Constraints
- 1<_n<_ 10^5
- O<_locations[i] <_ mini (n,100) (where 1 <_1<_10^5)
► Input Format For Custom Testing
Sample Case 0
Sample Input For Custom Testing
- 3 ->locations[] size n = 3
- 1 ->locations[] [1, 1, 1
- 1 ->Sample Output
Sample Output
- 1
Explanation
Here, locations = {1, 1, 13
- For position 1: locations[1] = 1, maxi (1 -1), 1) to min((1+1), 3) gives range = 1 to 2
- For position 2: locations[2] = 1, max( (2 -1), 1) to min( (2+1), 3) gives range = 1 to 3
- For position 3: locations[3] = 1, max((3 -1), 1) to min((3+1), 3) gyes range = 2 to 3
If the 2nd fountain is active, the range from position 7 to 3 will be covered. The total number of fountains needed is 1.
#include<bits/stdc++.h> #define ll long long using namespace std; bool compare(pair < int, int > A, pair < int, int > B) { if (A.first = B.first) return A.second < B.second; return A.first < B.first; } int solve(int location[], int n) { pair < int, int > range[n]; for (int i = 0; i < n; i++) { int id = i + 1; range[i].first = max(1, id - location[i]); range[i].second = min(n, id + location[i]); } sort(range, range + n, compare); int i = 0; int ans = 0; while (i < n) { pair < int, int > p = range[i]; ans++; while (i + 1 < n && range[i].first == range[i + 1].first) { p.second = max(p.second, range[i + 1].second); i++; } //cout<<p.second<<" "<<i<<endl; while (i < n && range[i].second <= p.second) i++; //cout<<p.second<<" "<<i<<endl; } return ans; } int main() { int n; cin >> n; int location[n]; for (int i = 0; i < n; i++) cin >> location[i]; cout << solve(location, n) << endl; return 0; }
import java.util.*; class Main { static int minCntFoun(int a[], int N) { int[] dp = new int[N + 1]; Arrays.fill(dp, -1); // Mark the reachable indices for each fountain for (int i = 0; i < N; i++) { int left = Math.max(i - a[i], 0); int right = Math.min(i + a[i]+1, N); dp[left] = Math.max(dp[left], right); } int cntfount = 1; int idxRight = dp[0]; int idxNext = 0; // Traverse the reachable indices and activate fountains for (int i = 0; i < N; i++) { idxNext=Math.max(idxNext,dp[i]); if(i==idxRight){ cntfount++; idxRight = idxNext; } } return cntfount; } // Driver Code public static void main(String[] args) { Scanner scan=new Scanner(System.in); int n = scan.nextInt(); int[] location=new int[n]; for(int i=0;i < n;i++){ location[i]=scan.nextInt(); } System.out.print(minCntFoun(location, n)); } }
Question 4
Rahul has an array a, consisting of n integers a1, a2, …, an. The boy cannot sit and do nothing, he decided to study an array. Rahul took a piece of paper and wrote out m integers l1, l2, …, lm (1 ≤ li ≤ n). For each number li he wants to know how many distinct numbers are staying on the positions li, li + 1, …, n. Formally, he want to find the number of distinct numbers among ali, ali + 1, …, an.?
Rahul wrote out the necessary array elements but the array was so large and the boy was so pressed for time. Help him, find the answer for the described question for each li.
Input
- The first line contains two integers n and m (1 ≤ n, m ≤ 105). The second line contains n integers a1, a2, …, an (1 ≤ ai ≤ 105) — the array elements.
- Next m lines contain integers l1, l2, …, lm. The i-th line contains integer li (1 ≤ li ≤ n).
Output
- Print m lines — on the i-th line print the answer to the number li.
Examples
- Input
10 10
1 2 3 4 1 2 3 4 100000 99999
1
2
3
4
5
6
7
8
9
10 - Output
6
6
6
6
6
5
4
3
2
1
n,m=map(int,input().split()) ar=list(map(int,input().split())) a=set() l=[0]*n for i in range(n-1,-1,-1): a.add(ar[i]) l[i]=len(a) #print(l) for i in range(m): lx=int(input()) print(l[lx-1])
#include<bits/stdc++.h> using namespace std; int main () { int n, m; cin >> n >> m; int a[n], b[m]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; set < int >st; int check[n] = { 0 }; for (int i = n - 1; i >= 0; i--) { st.insert (a[i]); check[i] = st.size (); } for (int i = 0; i < m; i++) cout << check[b[i] - 1] << endl; return 0; }
import java.util.*; class Solution { public static void main (String[]args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt (); int m = sc.nextInt (); int a[] = new int[n]; int l[] = new int[m]; for (int i = 0; i < n; i++) a[i] = sc.nextInt (); for (int j = 0; j < m; j++) l[j] = sc.nextInt (); int dp[] = new int[n]; HashSet < Integer > s = new HashSet < Integer > (); for (int i = n - 1; i >= 0; i--) { s.add (a[i]); dp[i] = s.size (); } for (int j = 0; j < m; j++) System.out.println (dp[l[j] - 1]); } }
Question 5 : Staircase Problem
Problem Description
There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time.
- Count the number of ways, the person can reach the top.
#include<stdio.h> int calc(int n); int count(int x); int main () { int n ; printf("Enter number of stairs : "); scanf("%d", &n); printf("Number of ways = %d", count(n)); getchar(); return 0; } int count(int x) { return calc(x + 1); } int calc(int n) { if (n <= 1) return n; return calc(n-1) + calc(n-2); }
Output Enter number of stairs : 5 Number of ways = 8
#include<bits/stdc++.h> using namespace std; int calc(int n); int count(int x); int main () { int n ; cout<<("Enter number of stairs : "); cin>>n; cout<<("Number of ways = %d", count(n)); return 0; } int count(int x) { return calc(x + 1); } int calc(int n) { if (n <= 1) return n; return calc(n-1) + calc(n-2); }
Output Enter number of stairs : 5 8
import java.util.*; class Main { static int count (int x) { return calc (x + 1); } static int calc (int n) { if (n < = 1) return n; return calc (n - 1) + calc (n - 2); } // Driver Code public static void main (String[]args) { Scanner scan = new Scanner (System.in); int n = scan.nextInt (); System.out.println (count (n)); } }
Output 5 8
n = int(input("Enter number of Stairs:")) def calc(x): if x <= 1: return x return calc(x - 1) + calc(x - 2) def count(n): return calc(n + 1) print("Number of ways:", count(n))
Output 5 8
FAQs on Junglee Games Coding Questions
Question 1: What are the roles does Junglee Games is offering for freshers?
Software Development Engineer, Project Engineer Intern, Game Content Writer, UI / UX Designer and other SDE Role for Specific Languages like C / C++, Golang, etc
Question 2: What should I expect during the interview process?
During the interview process at Junglee Games, you can expect to be asked a series of questions related to your experience, skills, and qualifications which are needed for Game Development. You will be showcasing your Game Development related skills like:
- Programming languages, including C++, Java, and C
- Experience in building libraries and APIs.
- Knowledge of the latest gaming trends.
- Strong Arts, Designing, and technical skills.
Question 3: Does Junglee Games offers any training or development programs for new hires?
Yes, Junglee Games offers a variety of training and development programs for new hires, including Orientation to the Gaming Industry, domain-specific training, and leadership development programs. They mainly focus on guiding the new hires to Upskill themselves and enhance their career goal in the field of Game industry.
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