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 in C++. In the 5th semester, Biju's visited my college and offered a 6-month internship opportunity. I commenced my interview preparation around April and almost finished it by the end of July.
Application story
Submit the form around mid-August, and the first online assessment will be conducted by the end of August, with results provided on the same day. Following this, two coding interviews will be scheduled within a week.
Why selected/rejected for the role?
I performed exceptionally well in both interviews, impressing the interviewers with my strong command of coding and computer science fundamentals.
Preparation
Duration: 6 months
Topics: Dynamic Programming, OOPS, Operating System, DBMS ,Data Structures, Algorithms,
Tip
Tip

Tip 1 : Make sure to solve a standard interview preparation sheet as part of your preparation.
Tip 2 : Ensure to thoroughly prepare Computer Science fundamentals such as Object-Oriented Programming (OOPS), Operating Systems (OS), and Database Management Systems (DBMS) at the very least.

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

Tip 1 : Ensure your resume includes at least two substantial projects.
Tip 2 : Include all your coding profiles, regardless of the number of questions you have completed in each of them.

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

The pre() function calculates the GCD for all pairs of numbers from 1 to 1000 and stores the results in the GCD array.

The f() function is the main recursive function to calculate the winning state of the game for both players. It uses memoization (through the vis and dp arrays) to avoid redundant calculations.

The main() function takes the number of test cases as input and runs a loop for each test case. For each test case, it takes input values A and B, representing the two numbers for that game.

If both A and B are equal to 1, the game results in a draw. If A is 1 and B is not, Prateek wins. If B is 1 and A is not, Gautam wins.

For other cases, it calls the f() function to determine the winner.

The algorithm effectively simulates the game and calculates the winner based on the given A and B values.

Note: It is essential to include the necessary header files ( and ) at the beginning of the program.

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

I employed dynamic programming to construct a 2D matrix, denoted as t[i][j], where each entry represents the minimum number of operations needed to transform the substring word1[0...i-1] into the substring word2[0...j-1].

Try solving now
02
Round
Easy
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

Initially, I presented a linear search solution, and then I proposed a binary search approach. Subsequently, the interviewer requested me to demonstrate that the binary search approach will always yield a solution. To prove this, I utilized 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 suggested using the sorting technique. Later, I introduced the Min Heap approach. The interviewer expressed satisfaction with both solutions.

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

Initially, I presented the brute force approach, but the interviewer requested an optimization. Subsequently, I provided a dynamic programming solution as an improved alternative.

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