- Prepare
- All Platforms
- Programming
- Aptitude
- Syllabus
- Interview Preparation
- Interview Exp.
- Off Campus
- Prime Video
- Prime Mock

- Prime Video
- OffCampus Updates
- Placement Stats
- Prime Video
- Prime Mock

^{0}Notifications Mark All Read

No New notification

- Login
- Get Prime

# Wiley Edge Coding Questions and Answers

## Wiley Edge Coding Questions with Solutions 2023

Wiley Edge Coding Questions and Answers become a prime importance when we know Wiley Edge Graduate Recruitment Process by it’s round the corner. It makes it obvious that you as an aspirant are looking for the previous year questions or similar questions for the batch 2022 and 2023.

Before going in detail keep a note that you must have strong SQL skills and hands on experience in Java and Python. This is necessary because you aspire to be a part of some of the global renowned banks.

## About Wiley Edge Graduate Recruitment Process

Wiley Edge is the partner for reskilling training and developing rising talent for both public and private businesses throughout the world.

It’s more crucial than ever to prepare for the future. The rate of change is quickening, creating a bigger gap between the skills that are required and those that are available in the labour market.

### Wiley Edge Recruitment Process

The recruitment process for the Wiley Edge Recruitment Program could comprise the following –- Eligibility check based on application
- Aptitude Test
- Coding Test
- Automated Video Test/ Group Discussion
- Live Tech Interview
- Final Interview

**Wiley Edge Assessment Details**

Wiley Edge Graduate Recruitment Program | Details |
---|---|

Number of Rounds | 2 |

Number of Questions | 23 Questions |

Time Allotted | 90 minutes |

**Wiley Edge Online Assessment**

Wiley Edge Online Assessment Rounds | No. Of Questions | Time Allotted |
---|---|---|

Aptitude Round | 20 Q’s | 30 Mins |

Coding Round | 3 Q’s | 60 Mins |

### Prime Course Trailer

### Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

## Wiley Edge Eligibility Criteria

Wiley Edge Graduate Recruitment Program | Eligibility Criteria |
---|---|

Batch | 2022 & 2023 |

Course | B.Tech/ M.TECH/ BCA/MCA/B.Sc/M.Sc/ B.E./M.E. |

Education | 60% aggregate in 10th, 12th graduation & Post graduation |

Branch | E/ECE/EC/IT/EEE/EIE & Mathematics |

Backlogs | No standing Arrears |

Proficiency | Java/ Python |

Starting CTC

9 - 11 LPA

Registration Ends

On 27th Feburary

Hiring Male

& Female Tech

## Sample Wiley Edge Coding Questions and Answers

**Question 1 : Match**

**Problem Statement :**The number of goals achieved by two football teams in matches in a league is given in the form of two lists. For each match of team B. Compute the total number of matches of team A where team A has scored less than or equal to the number of goals scored by team B in that match.

**Example : **team A =[ 1,2,3]

team B =[ 2,4]

Team A has played three matches and has scored team A =[1,2,3] goals in each match respectively. Team B has played two matches and has scored team B = [2,4] goals in each match respectively. For 2 goals scored by team B in its first match, team A has 2 matches with scores 1,2 and 3 hence , the answer is [2,3].

**Function Description :**

Complete the function counts in the editor below.

Counts has the following parameters:

int teamA(n): First array of positive integers

int teamB(m): Second array of positive integers

**Return :**

int(m): an array of m positive integers, one for each teamB[i] representing the total number of elements from teamA[j] satisfying teamA[j]<_ teamB[i] where 0<_j<n and 0<_i< m, in the given order.

**Constraints :**

2<_n, m<_10^5

1<_ teamA[j]<_10^9,where 0<_j<n.

1<_ teamB[i]<_10^9,where 0<_j<m

**Input format for custom Testing :**

Input from stdin will be processed as follows and passed to the functions.

The first line contains an integer n, the number of elements in teamA.

The next n lines each contain an integer describing teamA[j] where 0<_j<n.

The next line contains an integer m, the number of elements in teamB.

The next m lines each contain an integer describing teamB[i]where 0<_i<m.

**Sample input 0 :**

4 -> teamA[] size n = 4

1 -> teamA = [1,4,2,4]

4

2

4

2-> teamB [] size m = 2

3-> teamB = [3,5]

5

**Sample ōutput 0 :**

2

4

**Explanation 0 :**

Given values are n =4, team A = [1,4,2,4], m= 2, and teamB = [3,5].

For teamB[0] = 3, we have 2 elements in teamA(teamA[0] = 1 and teamA[2] = 2) that are <_ teamB[0].

For teamB[1] = 5, we have 4 elements in teamA(teamA[0] = 1, teams[1] =4, teamA[2] = 2, and teamA[3] =4) that are <_teamB[1].

Thus , the function returns the array [2,4] as the answer.

import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int teamA[] = new int[n]; for (int i = 0; i < n; i++) teamA[i] = sc.nextInt(); int m = sc.nextInt(); int teamB[] = new int[m]; for (int i = 0; i < m; i++) teamB[i] = sc.nextInt(); Arrays.sort(teamA); int count = 0; for (int i = 0; i < m; i++) { count = 0; for (int j = 0; j < n; j++) { if (teamA[j] <= teamB[i]) count++; else break; } System.out.println(count); } } }

ar=list(map(int,input().split())) br=list(map(int,input().split())) ar.sort() ans=[] import bisect for i in br: ans.append(bisect.bisect(ar,i)) print(ans)

**Question 2 : Game Of Clicks (R->Hard)**

**Problem Statement :**

Sahil watches TV all day and gets bored. He started playing this dumb game of identifying minimum number of inputs needed to reach a channel. As his cousin, you have to help him, but you live far from his house. So you decide to write a code that will ask Sahil for some inputs and give outputs respectively.

**Here are the problems you need to keep in mind :**

- There are 13 buttons on his remote: 10 buttons for the numbers (0-9) to form integers denoting respective channel index, “Up channel” button and “ Down channel” button for going i +1th channel and i-1th channel from i respectively, and a “Last viewed” button to see what’s the last channel before it.
- The number buttons allow you to jump directly to a specific channel (Ex: to go to channel 172 by typing 1,7,2).
- If the channel which you are in is ith and that is the max channel index possible, by Up channel, you will reach the first channel possible. Same goes for the down channel button. You can go to the highest channel possible if you go down from the lowest channel possible.

- Sahil can get from one channel to the next in one of the two ways.
- Sahil’s parents have set some parental control on some channels on Aniruth’s television. The “Up Channel “ and “Down buttons” buttons skip these channels as these channels are not viewable.
- Given a list of channels to view, the lowest channel, the highest channel, and a list of blocked channels, your program should return the minimum number of clicks necessary to get through all the shows that Anirudh would like to match.

**Input Format :**

- First line is the lowest Channel
- Second-line is the highest Channel
- Followed by a number of blocked channels B,

and the next B lines contain the actual blocked channels. - Followed by the number of Channels to view V, and the next V lines contain the actual channels to view.

**Constraints :**

- The lowest channel on the television will be greater than 0. and less than or equal to 10,000.
- The highest channel on the television will be greater than or equal to the lowest channel. and less than or equal to 10.000.
- The list of channels that are blocked on Anirudh’s television. All the channels in this list will be valid channels (greater than or equal to lowest channel, less than or equal 1 to highest channel). Duplicates may be Ignored. The blocked list can be a maximum of 40 channels.
- The sequence that Sahil must view contains between 1 and 50 elements. inclusive. All channels in this sequence are not in the blocked list and are between lowest channel and highest channel. Inclusive.

**Sample Input 0:**

1

20

2

18

19

5

15

14

17

1T

17**Sample output 0:**

7

#include<bits/stdc++.h> using namespace std; unordered_map < int, int > m; int l, u; int util(int a, int b) { if (a == b) return 0; if (m[a]) return util(a + 1, b); return 1 + util(a + 1, b); } int func(int b, int prev) { if (b < prev) return min(util(prev, u) + util(l, b) + 1, util(b, prev)); else return min(util(prev, b), util(l, b) + util(prev, u) + 1); } int main() { int flag = 0, ans = 0, prev, prev2; cin >> l >> u; int bn, b; cin >> bn; while (bn--) { cin >> b; m[b]++; } cin >> bn; while (bn--) { cin >> b; if (b > 9 && flag == 0) { ans += 2; flag++; prev = b; } else if (flag == 0) { ans += 1; flag++; prev = b; } else if (prev2 == b) { prev2 = prev; prev = b; ans++; } else { ans += min(b > 9 ? 2 : 1, func(prev, b)); prev2 = prev; prev = b; } } cout << ans; }

import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int l = sc.nextInt(); int h = sc.nextInt(); int b = sc.nextInt(); List < Integer > bl = new ArrayList < > (); for (int i = 0; i < b; i++) { bl.add(sc.nextInt()); } int v = sc.nextInt(); List < Integer > vl = new ArrayList < > (); for (int i = 0; i < v; i++) { vl.add(sc.nextInt()); } Set < Integer > sl = new HashSet < > (); int res = 0; for (Integer i: vl) { if (bl.contains(i)) continue; sl.add(i); } for (Integer i: sl) { String s = i + ""; res += s.length(); } System.out.println(res); } }

def prev(now, l, h, blocked): if now != l: if (now - 1) not in blocked: return now - 1 else: return prev(now - 1, l, h, blocked) else: if h not in blocked: return h else: return prev(h, l, h, blocked) def next(now, l, h, blocked): if now != h: if (now + 1) not in blocked: return now + 1 else: return next(now + 1, l, h, blocked) else: if l not in blocked: return l else: return next(l, l, h, blocked) def digits(n): count = 0 while n > 0: n = n // 10 count += 1 return count for i in range(2): if i == 0: l = int(input()) else: h = int(input()) b = int(input()) blocked = [] for i in range(b): blocked.append(int(input())) back = -1 now = -1 c = int(input()) k = 0 for i in range(c): n = int(input()) n1 = digits(n) if now == -1: now = n k += n1 continue if back == n: k += 1 back, now = now, back continue pf = 0 pb = 0 now1 = now prev1 = now for j in range(n1): if j == (n1 - 1): pf = n1 pb = n1 break else: now1 = next(now1, l, h, blocked) pf += 1 prev1 = prev(prev1, l, h, blocked) pb += 1 if now1 == n: break if prev1 == n: break k += pf back = now now = n print(k)

**Question 3 : Help Anirudh**

**Problem Statement :**

Anirudh loves to play games but his father is very strict. But one day his father agreed to get him a new game if he solves the following problem –

Given an array of Integers, determine the number of moves to make all elements equal. Each move consists of choosing all but 1 element and Incrementing their values by 1. Can you help Anirudh?

**Example :**

numbers= [3, 4, 6, 6, 3]

Choose 4 of the 5 elements during each move and Increment each of their values by one. Indexing begins at 1. It takes 7 moves as follows:

iteration | array |
---|---|

0 | [3,4,6,6,3] |

1 | [4,5,7,6,4] |

2 | [5,6,7,7,5] |

3 | [6,7,8,7,6] |

4 | [7,8,8,8,7] |

5 | [8,9,9,8,8] |

6 | [9,9,10,9,9] |

7 | [10,10,10,10,10] |

**Returns: long:** the minimum number of moves required

**Constraints**

1<=n<=10^5

1<=numbers(i)<=10^6

**Sample case 0:****Sample input 0:**

5 → size of numbers[]

3 → numbers[]=[3,4,6,6,3]

4

6

6

3**Sample output 0:**

7

**Sample input 1:**

4

4

3

4

**Sample Output 1:**

2

#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int t; t = 1; while (t--) { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int min_element = INT_MAX; long long int sum = 0; for (int i = 0; i < n; i++) { min_element = min(min_element, arr[i]); sum += arr[i]; } cout << sum - n * min_element << endl; } 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 arr[] = new int[n]; for (int i = 0; i < n; i++) arr[i] = sc.nextInt(); int min = Integer.MAX_VALUE; long sum = 0; for (int i = 0; i < n; i++) { min = Math.min(min, arr[i]); sum = sum + arr[i]; } System.out.println(sum - n * min); } }

def minMoves(n, nums): s = 0 i = nums.index(min(nums)) for j in range(n): if i == j: continue else: s = s + nums[j] - nums[i] return s n = int(input()) numbers = [] for i in range(n): numbers.append(int(input())) print(minMoves(n, numbers))

**Question 4 : Array Subarray**

**Problem Statement :**You are given an array, You have to choose a contiguous subarray of length ‘k’, and find the minimum of that segment, return the maximum of those minimums.

**Sample input :**

1 → Length of segment x =1

5 → size of space n = 5

1 → space = [ 1,2,3,1,2]

2

3

1

2

**Sample output :**

3**Explanation :**

The subarrays of size x = 1 are [1],[2],[3],[1], and [2],Because each subarray only contains 1 element, each value is minimal with respect to the subarray it is in. The maximum of these values is 3. Therefore, the answer is 3

#include <bits/stdc++.h> using namespace std; vector < int > arr; int prevmin=-1; int flag=0; int x,n,q; int sorting(int start,int end) { if(start+1==n) {start=0;end=end-n;} if(start==end) return arr[start]; return min(arr[start],sorting(start+1,end)); } int func(int start,int end) { if(flag==0) {flag++;return prevmin=sorting(start,end);} if(arr[start-1]==prevmin) return prevmin; return prevmin=(arr[end] <= prevmin)?prevmin:sorting(start,end); } int main() { cin >> x >> n; int ans=0; for(int i=0;i < n;i++) {cin >> q;arr.push_back(q);} for(int i=0;i < n;i++) { ans=max(ans,func(i,i+x-1)); } cout << ans; }

import java.util.*; public class DiskSpace { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x=sc.nextInt(); int n=sc.nextInt(); int arr[]=new int[n]; for(int i=0;i < n;i++) arr[i]=sc.nextInt(); int min=Integer.MAX_VALUE; int max=Integer.MIN_VALUE; for(int i=0;i <= n-x;i++) { min=Integer.MAX_VALUE; for(int j=i;j < (i+x);j++) min=Math.min(min,arr[j]); max=Math.max(min,max); } System.out.println(max); } }

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 : 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)

## FAQs on Wiley Edge Coding Questions with Solutions

##### Question 1: Are there any coding questions asked in Wiley Edge?

Yes coding questions are asked in the Wiley Edge Recruitment Exam.

##### Question 2: Is Wiley Edge exam difficult to crack?

The difficulty level of Wiley Edge exam is moderate. The questions are mostly easy to medium level in difficulty and with apt practice can be solved.

**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