Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Arcesium interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Arcesium
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: DSA, OOPS, Database Management System, Operating System, Aptitude
Tip
Tip

Tip 1 : Revise what you learned
Tip 2 : Try solving new questions
Tip 3 : See hint after 20 minutes if no solutions hit

Application process
Where: Referral
Eligibility: 1 year experience
Resume Tip
Resume tip

Tip 1 : Use Single column
Tip 2 : Mention projects in detail

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date1 Jan 2022
Coding problem2

1. Find Number Of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
OlaLinkedInArcesium

You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.

A cell is said to be connected to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

Intuition

Treat the 2d grid map as an undirected graph and there is an edge between two horizontally or vertically adjacent nodes of value '1'.

Algorithm

Linear scan the 2d grid map, if a node contains a '1', then it is a root node that triggers a Depth First Search. During DFS, every visited node should be set as '0' to mark as visited node. Count the number of root nodes that trigger DFS, this number would be the number of islands since each DFS starting at some root identifies an island.

Try solving now

2. Maximum Subarray Sum

Moderate
25m average time
75% success
0/80
Asked in companies
Paytm (One97 Communications Limited)AmazonSnapdeal

Given an array of numbers, find the maximum sum of any contiguous subarray of the array.


For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would take elements 42, 14, -5, and 86.


Given the array [-5, -1, -8, -9], the maximum sum would be -1.


Follow up: Do this in O(N) time.

Problem approach

Intuition

Whenever you see a question that asks for the maximum or minimum of something, consider Dynamic Programming as a possibility. The difficult part of this problem is figuring out when a negative number is "worth" keeping in a subarray. This question in particular is a popular problem that can be solved using an algorithm called Kadane's Algorithm. If you're good at problem solving though, it's quite likely you'll be able to come up with the algorithm on your own. This algorithm also has a very greedy-like intuition behind it.

Let's focus on one important part: where the optimal subarray begins. We'll use the following example.

nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]

We can see that the optimal subarray couldn't possibly involve the first 3 values - the overall sum of those numbers would always subtract from the total. Therefore, the subarray either starts at the first 4, or somewhere further to the right.

What if we had this example though?

nums = [-2,1000000000,-3,4,-1,2,1,-5,4]

We need a general way to figure out when a part of the array is worth keeping.

As expected, any subarray whose sum is positive is worth keeping. Let's start with an empty array, and iterate through the input, adding numbers to our array as we go along. Whenever the sum of the array is negative, we know the entire array is not worth keeping, so we'll reset it back to an empty array.

However, we don't actually need to build the subarray, we can just keep an integer variable current_subarray and add the values of each element there. When it becomes negative, we reset it to 0 (an empty array).

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date7 Jan 2022
Coding problem1

F2F interview over zoom call

1. DBMS Questions

  • Write an SQL query to report the nth highest salary from the Employee table. If there is no nth highest salary, the query should report null.
  • Write an SQL query to report the second-highest salary from the Employee table. If there is no second-highest salary, the query should report null.
Problem approach

Tip 1 : Revise SQL basics
Tip 2 : Do SQL problems 
Tip 3 : Learn important concepts like ACID properties

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 write a single-line comment in C++?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 1
4 rounds | 3 problems
Interviewed by Arcesium
859 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 4 problems
Interviewed by Arcesium
542 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by Arcesium
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by Arcesium
526 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
5656 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
4899 views
3 comments
0 upvotes