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

Senior Software Engineer

CaaStle
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Journey
I sent my resume to recruiter .After he shortlisted my resume,he called me and asked all the details like expected ctc,location and skills.Then he scheduled first round of interview.
Application story
I applied for the position of senior software engineer on instahyre portal for Caastle.After that,Recruiter called me and get some details regarding relevant years of experience and skills.He shortlisted my resume and scheduled my first round of interview.
Why selected/rejected for the role?
I was rejected after second round .My rounds went well but manager who took my second round did not select me because he asked me puzzle to which i gave the answer but took some time.
Preparation
Duration: 4 months
Topics: DBMS,MYSQL,Data Structures and Algorithms,OOPS,Core Java,System Design
Tip
Tip

Tip 1 :Do practice a lot of data structures questions as mostly questions in interviews are based on them. 
Tip 2 : do prepare for projects mentioned in your resume and skills which you have mentioned.
Tip 3 :Be confident

Application process
Where: Other
Eligibility: no
Resume Tip
Resume tip

Tip 1 : Resume should be one page.
Tip 2 : Do not be repetitive
Tip 3 : Be confident about techs you mention on your resume

Interview rounds

01
Round
Medium
Video Call
Duration60 mins
Interview date2 Mar 2023
Coding problem2

This was a DSA round purely where 2 coding questions were asked.One was to find the next greater element in array and second was min platforms required for trains with arrival and departure time given in array.

1. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
IBMInfo Edge India (Naukri.com)Amazon

You are given an array 'a' of size 'n'.



The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.


For example:
Input: 'a' = [7, 12, 1, 20]

Output: NGE = [12, 20, 20, -1]

Explanation: For the given array,

- The next greater element for 7 is 12.

- The next greater element for 12 is 20. 

- The next greater element for 1 is 20. 

- There is no greater element for 20 on the right side. So we consider NGE as -1.
Problem approach

Using Stack
The time complexity can be easily reduced to linear by using extra space. The idea is to use the stack data structure.

For each element x in the array, pop all elements from the stack smaller than x, and set their next greater element to x.
Loop till we have a greater element on top of the stack or stack becomes empty. Then push the current element x on top of the stack.
Repeat the process for every array element.
class Main
{
// Find the next greater element for every array element
public static int[] findNextGreaterElements(int[] input)
{
// base case
if (input == null) {
return input;
}

int[] result = new int[input.length];
Arrays.fill(result, -1);

// create an empty stack
Stack s = new Stack<>();

// do for each element
for (int i = 0; i < input.length; i++)
{
// loop till we have a greater element on top or stack becomes empty.

// Keep popping elements from the stack smaller than the current
// element, and set their next greater element to the current element

while (!s.isEmpty() && input[s.peek()] < input[i]) {
result[s.pop()] = input[i];
}

// push current "index" into the stack
s.push(i);
}

return result;
}

Try solving now

2. Minimum Number of Platforms

Moderate
30m average time
70% success
0/80
Asked in companies
MeeshoGrabAmazon

You have been given two arrays, 'AT' and 'DT', representing the arrival and departure times of all trains that reach a railway station.

Your task is to find the minimum number of platforms required for the railway station so that no train needs to wait.

Note :
1. Every train will depart on the same day and the departure time will always be greater than the arrival time. For example, A train with arrival time 2240 and departure time 1930 is not possible.

2. Time will be given in 24H format and colons will be omitted for convenience. For example, 9:05AM will be given as "905", or 9:10PM will be given as "2110".

3. Also, there will be no leading zeroes in the given times. For example, 12:10AM will be given as “10” and not as “0010”.
Problem approach

The idea is to merge the arrival and departure times of trains and consider them in sorted order. Maintain a counter to count the total number of trains present at the station at any point. The counter also represents the total number of platforms needed at that time.

If the train is scheduled to arrive next, increase the counter by one and update the minimum platforms needed if the count is more than the minimum platforms needed so far.
If the train is scheduled to depart next, decrease the counter by 1.
One special case needs to be handled – when two trains are scheduled to arrive and depart simultaneously, depart the train first.

class Main
{
// Function to find the minimum number of platforms needed
// to avoid delay in any train arrival
public static int findMinPlatforms(double[] arrival, double[] departure)
{
// sort arrival time of trains
Arrays.sort(arrival);

// sort departure time of trains
Arrays.sort(departure);

// maintains the count of trains
int count = 0;

// stores minimum platforms needed
int platforms = 0;

// take two indices for arrival and departure time
int i = 0, j = 0;

// run till all trains have arrived
while (i < arrival.length)
{
// if a train is scheduled to arrive next
if (arrival[i] < departure[j])
{
// increase the count of trains and update minimum
// platforms if required
platforms = Integer.max(platforms, ++count);

// move the pointer to the next arrival
i++;
}

// if the train is scheduled to depart next i.e.
// `departure[j] < arrival[i]`, decrease trains' count
// and move pointer `j` to the next departure.

// If two trains are arriving and departing simultaneously,
// i.e., `arrival[i] == departure[j]`, depart the train first
else {
count--;
j++;
}
}

return platforms;
}
The time complexity of the above solution is O(n.log(n)) and doesn’t require any extra space, where n is the total number of trains.

Try solving now
02
Round
Medium
Video Call
Duration60 mins
Interview date6 Mar 2023
Coding problem1

In this round,focus was on puzzle solving mainly.2 puzzles were asked. one was,there is a game with some fee while enter and exit and i have to make 0 amount in end and some constraints were given.second was of 3 ants and triangle standard puzzle.

1. Puzzle

There are 3 ants sitting on three corners of a triangle. All ants randomly pick a direction and start moving along edge of the triangle. What is the probability that any two ants collide?

Problem approach

Every ant has two choices (pick either of two edges going through the corner on which ant is initially sitting).
Since every ant has two choices (pick either of two edges going through the corner on which ant is initially sitting), there are total 23 possibilities.

Out of 23 possibilities, only 2 don’t cause collision. So, the probability of collision is 6/8 and the probability of non-collision is 2/8.

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 - 1
4 rounds | 8 problems
Interviewed by Amazon
8518 views
0 comments
0 upvotes
Analytics Consultant
3 rounds | 10 problems
Interviewed by ZS
907 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
3320 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by Expedia Group
2581 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Senior Software Engineer
1 rounds | 6 problems
Interviewed by Arcesium
3734 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by Ernst & Young (EY)
4984 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by HCL Technologies
3014 views
3 comments
0 upvotes