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

SDE - 1

RedBus
upvote
share-icon
3 rounds | 10 Coding problems

Interview preparation journey

expand-icon
Journey
I completed my BTech, and during that time, I started doing coding questions and participating in interview mocks. Since then, I have done a number of questions on all the practice websites.
Application story
This is an on-campus opportunity for me, company visited to my campus for the placement. They have given a CGPA-wise cutoff also.
Why selected/rejected for the role?
I was rejected because i was not able to provide the accurate solution for the question given to me.
Preparation
Duration: 4 months
Topics: Data Structures and Algorithms, Object-Oriented Programming System, Operating system, Database Management System
Tip
Tip

Try to do Data Structures and Algorithms based questions and firstly attempt it yourself before going to the solution, also try to do it as quickly as you can. Also prepare for theory subjects like Operating system, Database Management System, etc which I prepared through Coding Ninjas subjective notes and they are very accurate and up to mark

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1: Have some projects on resume.
Tip 2: Do not put false things on resume.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date28 Oct 2022
Coding problem4

1. Remove Duplicates from Sorted Array

Easy
15m average time
85% success
0/40
Asked in companies
Goldman SachsSamsungHewlett Packard Enterprise

You are given a sorted integer array 'arr' of size 'n'.


You need to remove the duplicates from the array such that each element appears only once.


Return the length of this new array.


Note:
Do not allocate extra space for another array. You need to do this by modifying the given input array in place with O(1) extra memory. 


For example:
'n' = 5, 'arr' = [1 2 2 2 3].
The new array will be [1 2 3].
So our answer is 3.
Problem approach

// simple java program to remove duplicates

class Main {
// Function to remove duplicate elements This function
// returns new size of modified array.
static int removeDuplicates(int arr[], int n)
{
// Return, if array is empty or contains a single
// element
if (n == 0 || n == 1)
return n;

int[] temp = new int[n];

// Start traversing elements
int j = 0;
for (int i = 0; i < n - 1; i++)
// If current element is not equal to next
// element then store that current element
if (arr[i] != arr[i + 1])
temp[j++] = arr[i];

// Store the last element as whether it is unique or
// repeated, it hasn't stored previously
temp[j++] = arr[n - 1];

// Modify original array
for (int i = 0; i < j; i++)
arr[i] = temp[i];

return j;
}

public static void main(String[] args)
{
int arr[] = { 1, 2, 2, 3, 4, 4, 4, 5, 5 };
int n = arr.length;

n = removeDuplicates(arr, n);

// Print updated array
for (int i = 0; i < n; i++)
System.out.print(arr[i] + " ");
}
}

Try solving now

2. MCQ

Which of the following method can be used to instantiate a method?
a) static factory method
b) default-init method
c) destroy method
d) lazy-init method

Problem approach

Answer- static factory method
Explanation: Class attribute is used to specify the name of the class that contains the static factory method.

3. Spring Boot questions

What is a Spring configuration file?

Problem approach

A Spring configuration file is an XML file. This file mainly contains the classes information. It describes how those classes are configured as well as introduced to each other. The XML configuration files, however, are verbose and cleaner. If it’s not planned and written correctly, it becomes very difficult to manage in big projects.

4. Spring Boot question

What do you mean by Dependency Injection? (Learn)

Problem approach

In Dependency Injection, you do not have to create your objects but have to describe how they should be created. You don’t connect your components and services together in the code directly, but describe which services are needed by which components in the configuration file. The IoC container will wire them up together.

02
Round
Easy
Video Call
Duration60 minutes
Interview date28 Oct 2022
Coding problem5

1. Spring Boot questions

How configuration metadata is provided to the Spring container?

Problem approach

Configuration metadata can be provided to Spring container in following ways:

XML-Based configuration: In Spring Framework, the dependencies and the services needed by beans are specified in configuration files which are in XML format. These configuration files usually contain a lot of bean definitions and application specific configuration options. They generally start with a bean tag.

2. Spring Boot questions

What are the uses of @RequestMapping (Learn) and @RestController annotations in Spring Boot?

Problem approach

@RequestMapping:
This provides the routing information and informs Spring that any HTTP request matching the URL must be mapped to the respective method. `org.springframework.web.bind.annotation.RequestMapping` must be imported to use this annotation.

@RestController:
This is applied to a class to mark it as a request handler, thereby creating RESTful web services using Spring MVC. This annotation adds the `@ResponseBody` and `@Controller` annotations to the class. `org.springframework.web.bind.annotation.RestController` must be imported to use this annotation.

3. Spring Boot questions

What is the use of @Autowired annotation? Explain with code

Problem approach

@Autowired annotation is meant for the injection of a bean by means of its type along with methods and fields. This helps the Spring framework to resolve dependencies by injecting and collaborating the beans into another bean. For example, consider the below code snippet

import org.Springframework.beans.factory.annotation.Autowired;
import java.util.*;
public class InterviewBit {
// Autowiring/Injecting FormatterUtil as dependency to InterviewBit class
@Autowired
private FormatterUtil formatterUtil;

public Date something( String value ){
Date dateFormatted = formatterUtil.formatDate(value);
return dateFormatted
}
}
/**
* Util class to format any string value to valid date format
*/
public class FormatterUtil {

public Date formatDate(String value){
//code to format date
}
}

4. Spring Boot questions

How is it possible to use the Tomcat JNDI DataSource in the Spring applications?

Problem approach

To use the servlet container which is configured in the JNDI (Java Naming and Directory Interface) DataSource, the DataSource bean has to be configured in the spring bean config file and then injected into the beans as dependencies. Post this, the DataSource bean can be used for performing database operations by means of the JdbcTemplate. The syntax for registering a MySQL DataSource bean:

5. Networking Question

What do you understand by Content delivery network?

Problem approach

Content Delivery Network, or CDN for short, is a globally distributed proxy server network that serves content from locations close to the end-users. Usually, on websites, static files like HTML, CSS, JS files, images, and videos are served from a CDN.

03
Round
Easy
HR Round
Duration20 minutes
Interview date28 Oct 2022
Coding problem1

1. Basic HR Questions

My past experience, some behavioral questions, how you would deal with a non-supportive manager, and willingness to relocate in case of project requirements.

Problem approach

Just be confident, answer point to point, communication skills should be good.

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 the purpose of the return keyword?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 4 problems
Interviewed by RedBus
1542 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by RedBus
1510 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by RedBus
919 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by RedBus
663 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114869 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58031 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35057 views
7 comments
0 upvotes