BYJUS interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

BYJUS
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
In my 4th semester I started doing DSA in C++, Biju's visited my college in the 5th semester for providing 6 months internship opportunity. I started my interview preparation around April which nearly completed in July end.
Application story
Fill the form around mid of August and first online assessment held in august end, result came same day of online assessment. Then 2 coding interviews take place within a week.
Why selected/rejected for the role?
My both interview went pretty well, in both interview interviewer were pretty impressed by my grasp on coding and CS fundaments
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, Dynamic Programming, OOPS, Operating System, DBMS
Tip
Tip

Tip 1 : Solve at least any standard interview preparation sheet
Tip 2 : Must prepare CS fundamentals like OOPS,OS DBMS at least

Application process
Where: Campus
Eligibility: 7.5
Resume Tip
Resume tip

Tip 1: Atleast 2 good project should be in resume
Tip 2: Mention all your coding profile irrespective how many question you have done it that

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 mins
Interview date28 Aug 2022
Coding problem2

1. GCD Sum

Hard
35m average time
55% success
0/120
Asked in companies
AdobeDunzoQuikr

Consider all numbers from 1 to ‘N’, your task is to find the sum of gcd of all pairs (i, j) such that 1 <= i < j <= N.

For example for N = 3, all pairs are { (1, 2), (1, 3), (2, 3) }.

Note :

Gcd of two numbers (X, Y) is defined as the largest integer that divides both ‘X’ and ‘Y’. 
Problem approach

#include 
using namespace std;
int GCD[1002][1002];
bool vis[1002][1002][2];
int dp[1002][1002][2];
void pre()
{
for ( int i = 1; i <= 1000; i++ ) {
for ( int j = 1; j <= i; j++ ) {
GCD[i][j] = GCD[j][i] = __gcd(i,j);
}
}
return;
}
int f(int a, int b, int turn)
{
if ( turn == 0 ) {
if ( a == 1 ) return 0;

if ( turn == 1 ) {
if ( b == 1 ) return 0;
}
if ( vis[a][b][turn] ) return dp[a][b][turn];
vis[a][b][turn] = true;
int ans = 0;
if ( turn == 0 ) {
ans |= (!f(a,b-1,turn^1));
if ( GCD[a][b] != 1 ) ans |= (!f(a,b/GCD[a][b],turn^1));
}
else {
ans |= (!f(a-1,b,turn^1));
if ( GCD[a][b] != 1 ) ans |= (!f(a/GCD[a][b],b,turn^1));
}
dp[a][b][turn] = ans;
return ans;
}
int main() {
int t,A,B;
pre();
cin >> t;
while ( t-- ) {
cin >> A >> B;
if(A==1 && B==1)
cout<<"Draw"< else if(A==1)
cout<<"Prateek"< else if(B==1)
cout<<"Gautam"< else{
if ( f(A,B,0) ) cout << "Gautam"< else cout << "Prateek"< }
}
return 0;
}

Try solving now

2. Edit Distance

Moderate
30m average time
70% success
0/80
Asked in companies
OYOGoldman SachsHCL Technologies

You are given two strings 'S' and 'T' of lengths 'N' and 'M' respectively. Find the "Edit Distance" between the strings.

Edit Distance of two strings is the minimum number of steps required to make one string equal to the other. In order to do so, you can perform the following three operations:

1. Delete a character
2. Replace a character with another one
3. Insert a character
Note:
Strings don't contain spaces in between.
Problem approach

I am used dynamic programming. I build a 2D matrix t[][] where t[i][j] represents the minimum number of operations required to transform the substring word1[0...i-1] into the substring word2[0...j-1].

Try solving now
02
Round
Medium
Video Call
Duration45 mins
Interview date31 Aug 2022
Coding problem1

1. Peak Value

Moderate
0/80
Asked in companies
FacebookUberWalmart

You are given an array ‘arr’, your task is to find an element, such that it is strictly larger than its left and right neighbour and return its index in the array.

Note:
Assume that the first and the last element of the array is -∞. 
For Example:
You are given ‘arr’ = [4, 6, 3, 2], Here element 6 is greater than 4 as well as 3, the index of 6 is 1. Hence the answer is 1.
Problem approach

First I told linear search solution then binary search one, then interviewer asked me to prove that you will always get a solution for binary search approach. I proved via contradiction method.

Try solving now
03
Round
Medium
Video Call
Duration45 mins
Interview date2 Sep 2022
Coding problem2

1. Kth Smallest and Largest Element of Array

Easy
15m average time
70% success
0/40
Asked in companies
HSBCSalesforceSprinklr

You are given an array ‘Arr’ consisting of ‘N’ distinct integers and a positive integer ‘K’. Find out Kth smallest and Kth largest element of the array. It is guaranteed that K is not greater than the size of the array.

Example:

Let ‘N’ = 4,  ‘Arr’ be [1, 2, 5, 4] and ‘K’ = 3.  
then the elements of this array in ascending order is [1, 2, 4, 5].  Clearly, the 3rd smallest and largest element of this array is 4 and 2 respectively.
Problem approach

First I told using sorting. Then i used Min Heap approach. Interview was pretty happy in this.

Try solving now

2. Longest Palindromic Substring

Moderate
20m average time
80% success
0/80
Asked in companies
MathworksLivekeeping (An IndiaMART Company)Goldman Sachs

You are given a string 'str' of length 'N'.


Your task is to return the longest palindromic substring. If there are multiple strings, return any.


A substring is a contiguous segment of a string.


For example :
str = "ababc"

The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome. 

There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
Problem approach

First I told brute force approach which interview told me to optimize then I wrote dp solution

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by BYJUS
829 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 8 problems
Interviewed by BYJUS
664 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by BYJUS
688 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by BYJUS
602 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15605 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10216 views
2 comments
0 upvotes