BYJU’s Coding Questions with Answers

Byju’s Coding Questions with Solution 2023

Byju’s Coding Questions with Answers is a part of Online Test conducted by Byju’s Exam Prep to hire Software Engineer through their recruitment Drive.

This page consists completge information about Byju’s Exam Prep Recruitment and Coding Questions asked in their Technical Assessment. You can even find eligibility criteria, salary details here. Remember that you will appear for software engineer .

Byjus Coding Question

About BYJU's Exam Prep

The most thorough exam preparation app in the nation, Byju’s Exam Prep, is adored by millions of applicants nationwide.

They are a fast expanding group of creative, curious, and motivated individuals who have aided over 3 billion aspirants in realising their professional goals. With an average employee age of 27, the business is young and driven, continually aiming to further the interests of aspirants.

Prime Course Trailer

Eligibility Criteria of Byju's Placement Exam

Here is the detailed Eligibility Criteria for being eligible in byjus exam prep. We have tabulated the complete information for better understanding.

 

Byjus Exam PrepEligibility Criteria
CourseB.Tech, M.Tech, MCA
BranchesB.Tech (CSE, CS, CSIT, IT, ECE, EI, EN, ME, CE) , MCA & M.Tech): CSE, CS, CSIT, IT
Batch2023
Education Qualification10th , 12th & Graduation, Post Graduation Percentage): 60% throughout
BondNo Bond

Related Banners

Byju's Exam Prep Recruitment Process

Here we have explained complete placement process of Byju’s Exam Prep. Go through it carefully.

  1. Pre-Placement Talk
  2. Technical Assessment
  3. Interview process 

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

Salary for Byju's Exam Prep

ByjusSalary Breakdown
DesignationSoftware Engineer
CTC OfferedRs 10 LPA
Fixed PayRs 8 Lakhs
Joining BonusRs 1 Lakh
Performance BasedRs 1 Lakh (Performance Based)

Byju's Software Developer Coding Questions with Answers

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

Question 2 : Maximize Earnings (R->Hard)

Problem Statement  :

A company has a list of jobs to perform. Each job has a start time, end time and profit value. The manager has asked his employee Anirudh to pick jobs of his choice. Anirudh being greedy wants to select jobs for him in such a way that would maximize his earnings.
Given a list of jobs how many jobs and total earning are left for other employees once Anirudh
Picks jobs of his choice.
Note: Anirudh can perform only one job at a time.

Input format:

Each Job has 3 pieces of info – Start Time,End Time and Profit
The first line contains the number of Jobs for the day. Say ‘n’. So there will be ‘3n lines
following as each job has 3 lines.
Each of the next ‘3n’ lines contains jobs in the following format:
start_time
end-time
Profit
start-time and end-time are in HHMM 24HRS format
i.e. 9am is 0900 and 9PM is 2100

Constraints :

The number of jobs in the day i.e’ is less.
than 10000
0<_n<_10000
start-time is always less than end time.

Output format :

Program should return an array of 2 integers where
1st one is number of jobs left and earnings of other employees


Sample Input 1 :
4
0200
0300
10
0400
0700
20
0300
0800
30
0900
1000
50


Sample Output 1:
1
20

Sample Explanation 1

CHooses 1st, 3rd and 4th job cause they don’t overlap. So only second job is remaining.

Sample Input 2:

5
0805
0830
100
0835
0900
100
0905
0930
100
0935
1000
100
1005
1030
100

Sample output 2:

0
0

Sample Explanation 2:
Anirudh can work on all appointments as there are none overlapping.
Hence 0 appointments and 0 earnings for other employees.

Question 3 : 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’.

Question 4 : Minimum Occurrence (R->Medium)

Problem Statement  :
Given a sting , return the character that appears the minimum number of times in the string. The string will contain only ascii characters, from the ranges (“a”-”z”,”A”-”Z”,0-9), and case matters . If there is a tie in the minimum number of times a character appears in the string return the character that appears first in the string.

Input Format:
Single line with no space denoting the input string.

Output Format:
Single character denoting the least frequent character.

Constraints:
Length of string <=10^6

Sample Input:
cdadcda

Sample Output:
c

Explanation:
C and A both are with minimum frequency. So c is the answer because it comes first with less index.

 

Question 5 : Password Creation

Problem Statement  :

A password manager wants to create new passwords using two strings given by the user, then combined to create a harder-to- guess combination. Given two strings,
interleave the characters of the strings to create a new string. Beginning with an empty string, alternately append a character from string a and from string b. If one of the strings is exhausted before the other, append the remaining letters from the other
string all at once. The result is the new password.

Example :
If a = ‘hackerrank’ and b = ‘mountain’,
The result is hmaocuknetrariannk.

Function Description :
Complete the function newPassword in the
editor below.

newPassword has the following parameter(s):
Str : string a
Str : string b
Returns:
Str: new password using two strings
Sample case 0 :
Sample input0:
abc → a=”abc”
def → b=”def”

Sample output 0:
Adbecf

Byju's Coding Questions and Answers FAQ's

Question 1: What is the difficulty level of Coding in Byju's?

The coding level of Byju’s is quite difficult, you will be evaluated on the basis of in-depth knowledge.

Question 2: Do Byju's also hire for Software developer?

Yes, Byju’s do hire for Software Developer role, via a Coding exam.

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

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription