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

SDE - 1

NoBroker
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data structures, Algorithms, OOPS, Low level Design, Database design
Tip
Tip

Tip 1 : Solve Problems that are one level up from you. If you can solve an easy problem easily then start solving medium problems. and so on.
Tip 2 : Upsolve problems that you couldn't solve in the contest.
Tip 3 : Before starting to write code make sure you are clear with your approach

Application process
Where: Email Approach
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mention the projects that you can explain more than 10-15 mins
Tip 2 : Single page

Interview rounds

01
Round
Medium
Video Call
Duration50 minutes
Interview date26 Jul 2021
Coding problem2

Added dificulty of round as per leetcode ratings

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
HCL TechnologiesInformaticaSamsung

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

Brute force : Time complexity : O(n*n)
-----------------------------------------
1. Consider all subarrays possible. if array has n elements then there are n*(n+1)/2 subarrays possible.
2. Maintain two variables running_sum and max_sum.
3. Run two nested loops. Outer loop will denote starting point of the subarray and inner loop denote end point of the subarray.
4. Outer loop starts from i = 0 to n and inner loop starts from j = i to n. 
5. for each step in outer loop initialize running_sum to zero
6. for each step in inner loop increment running_sum by the element in that index and update max_sum
7. at the end max_sum is the ans


Optimised approach(DP) : Time complexity : O(n), Space Complexity : O(n)
--------------------------------------------
Assumption : 
a. Size of the array : n
b. Array contains negetive elements as well

Steps:
1. Consider solving the problem using DP.
2. let's initialize a variable max_sum and 1d array dp of size n.
2. dp[i] denotes maximum subarray sum ending with ith index.
3. Iterate over n elements i.e i = 0 to n.
4. At each step, we have two option either I append ith element to subarray sum ending with i-1 index or don't
5. dp[i] = maximum of dp[i-1] + num[i] and num[i]
6. also update max sum at each step, max_sum = maximum of max_sum and dp[i] 
7. max_sum is the ans

Try solving now

2. Maximum Product Subarray

Moderate
25m average time
75% success
0/80
Asked in companies
InnovaccerAmazonMicrosoft

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.

For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3]. 
For Example:
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Follow Up:
Can you solve this in linear time and constant space complexity?
Problem approach

Optimized approach(DP) : Time complexity: O(n)
-----------------------------------------------

Assumption : 
a. Size of the array : n
b. Array contains negetive elements as well
c. product never goes of out of limit 

Steps:
1. Consider solving the problem using DP.
2. let's two 1d array max_product and min_product of size n and a variable max_product.
2. max_product[i] denotes maximum subarray product ending with ith index.
2. min_product[i] denotes minimum subarray product ending with ith index.
3. Iterate over n elements i.e i = 0 to n.
4. At each step, to fill max_sum[i] we have 3 options to choose
a. append minimum product subarray ending with i-1th index with ith element
b. append maximum product subarray ending with i-1th index with ith element
c. don't append 
5. max_product[i] = maximum of (max_product[i-1] * num[i]), (min_product[i-1] * num[i]) and num[i]
6. Similarly do same for min_product
6. Also at each step update max_product with max_product[i]
7. max_product is the ans

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date28 Jul 2021
Coding problem1

added dificulty of round as per leetcode ratings

1. Technical Questions

Fundamental questions:
----------------------
1. What is Spring dat JPA?
2. How JPA works internally?
3. What is hibernet?

Design questions:
-------------------
1. Design a LRU cache system.

Puzzles:
--------
1. There are 25 horses among which you need to find out the fastest 3 horses. You can conduct race among at most 5 to find out their relative speed. At no point you can find out the actual speed of the horse in a race. Find out the minimum no. of races which are required to get the top 3 horses.

Problem approach

Tip 1: Understand fundamentals.
Tip 2: Practice few low level design problems
Tip 3: Also prepare some puzzles (refer to geeksforgeeks for puzzles)

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
SDE - 1
1 rounds | 1 problems
Interviewed by NoBroker
1424 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by NoBroker
1815 views
0 comments
0 upvotes
Python Developer
2 rounds | 2 problems
Interviewed by NoBroker
1093 views
0 comments
0 upvotes
Frontend Developer
3 rounds | 5 problems
Interviewed by NoBroker
0 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114578 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57824 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34960 views
7 comments
0 upvotes