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

SDE - Intern

BYJUS
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
During my 4th semester, I began learning Data Structures and Algorithms (DSA) in C++. In the 5th semester, Byjus visited my college and offered me a 6-month internship opportunity. I initiated my interview preparation around April, and it was almost completed by the end of July.
Application story
I filled out the form around mid-August, and the first online assessment was conducted towards the end of August. The results of the online assessment were provided on the same day. Subsequently, two coding interviews were scheduled within a week after the online assessment.
Why selected/rejected for the role?
That's fantastic to hear! It's great to know that both interviews went well, and the interviewers were impressed with your strong grasp of coding and Computer Science fundamentals. Keep up the excellent work!
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, Dynamic Programming, OOPS, Operating System, DBMS
Tip
Tip

Tip 1: Make sure to solve at least one standard interview preparation sheet to familiarise yourself with common interview questions and problem-solving techniques.
Tip 2: Prioritise preparing fundamental Computer Science topics such as Object-Oriented Programming (OOPS), Operating Systems (OS), and Database Management Systems (DBMS) to strengthen your knowledge base for technical interviews.

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

Tip 1: Ensure that your resume includes at least 2 substantial and impressive projects that showcase your skills and experiences effectively.
Tip 2: Include all your coding profiles, regardless of the number of questions you have attempted on each platform. Highlighting your coding profiles can give interviewers insight into your problem-solving abilities and coding expertise.

Interview rounds

01
Round
Easy
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
WalmartOYOGoldman Sachs

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

That sounds like a great approach! Using dynamic programming and constructing a 2D matrix t[][] to represent the minimum number of operations needed to transform substrings word1[0...i-1] into word2[0...j-1] is a common technique for solving string transformation problems.

By calculating and storing the minimum operations in the matrix t, you can efficiently determine the optimal solution for transforming one string into another. This dynamic programming technique can be quite useful in various string manipulation and transformation scenarios.

If you have any specific questions or need further assistance with your dynamic programming implementation, feel free to ask!

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

1. Find Peak Element

Easy
15m average time
85% success
0/40
Asked in companies
GrabDunzoHike

You are given an array 'arr' of length 'n'. Find the index(0-based) of a peak element in the array. If there are multiple peak numbers, return the index of any peak number.


Peak element is defined as that element that is greater than both of its neighbors. If 'arr[i]' is the peak element, 'arr[i - 1]' < 'arr[i]' and 'arr[i + 1]' < 'arr[i]'.


Assume 'arr[-1]' and 'arr[n]' as negative infinity.


Note:
1.  There are no 2 adjacent elements having same value (as mentioned in the constraints).
2.  Do not print anything, just return the index of the peak element (0 - indexed).
3. 'True'/'False' will be printed depending on whether your answer is correct or not.


Example:

Input: 'arr' = [1, 8, 1, 5, 3]

Output: 3

Explanation: There are two possible answers. Both 8 and 5 are peak elements, so the correct answers are their positions, 1 and 3.


Problem approach

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

Try solving now

2. Minimum Characters For Palindrome

Hard
20m average time
70% success
0/120
Asked in companies
GeeksforGeeksBarclaysMicrosoft

Given a string STR of length N. The task is to return the count of minimum characters to be added at front to make the string a palindrome.

For example, for the given string “deed”, the string is already a palindrome, thus, minimum characters needed are 0.

Similarly, for the given string “aabaaca”, the minimum characters needed are 2 i.e. ‘a’ and ‘c’ which makes the string “acaabaaca” palindrome.

Problem approach

I used tabular dp

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 the Min Heap approach. The interviewer was pretty happy about this.

Try solving now

2. Longest Palindromic Substring

Moderate
20m average time
80% success
0/80
Asked in companies
MicrosoftCIS - Cyber InfrastructureGartner

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

Optimizing a brute force approach by implementing a dynamic programming (DP) solution is a commendable strategy. Dynamic programming is an effective technique for optimizing recursive or brute force algorithms by storing intermediate results in a table or array, which helps avoid redundant computations and significantly improves the overall efficiency of the solution.

By transitioning to a DP approach, you likely achieved a more efficient and faster solution to the problem, which is highly valued in technical interviews. Employing DP demonstrates your problem-solving skills and ability to optimize algorithms, which are essential qualities sought in candidates.

Well done on optimizing your approach and providing a DP solution! If you have any further questions or need assistance with other problems, feel free to ask. Good luck with your interview preparation!

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

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by BYJUS
804 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by BYJUS
620 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 8 problems
Interviewed by BYJUS
641 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by BYJUS
671 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15481 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15339 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes