Mindtickle SDE-1 | DSA Interview Round

mindtickle logo
mindtickle
SDE-1Rejected
July 12, 20251 reads

Summary

I interviewed for an SDE-1 role at Mindtickle, where I successfully solved two data structures and algorithms problems involving greedy approaches, priority queues, and sliding window techniques, but ultimately was not shortlisted.

Full Experience

I recently went through an SDE-1 DSA interview round at Mindtickle. This round involved two algorithmic questions designed to assess my problem-solving skills, understanding of data structures, and my ability to optimize for time and space complexity. I solved both questions within the allotted time and discussed their expected time and space complexities. However, even after solving both problems, I was not shortlisted further, and no proper feedback was provided.

Interview Questions (2)

Q1
Farthest Reachable Hill
Data Structures & Algorithms

You're on a hiking expedition across a series of hills, represented by an array elevations, where each element indicates the height of a hill. Starting from hill 0, your objective is to travel as far as possible using a limited number of grappling hooks and a stockpile of climbing gear units.

Movement Rules:

To move from hill i to hill i + 1:

  • If the next hill is at the same height or lower, you can walk without using any equipment.
  • If the next hill is higher, you must either:
    • Use one grappling hook, or
    • Spend a number of climbing gear units equal to the elevation gain: (elevations[i+1] - elevations[i]). You may choose when to use grappling hooks or climbing gear. The objective is to plan your resource usage wisely to reach the farthest hill possible.

Function Signature:

int furthestHillIndex(vector<int>& elevations, int climbing_gears, int grappling_hook);

Sample Inputs & Expected Outputs:

  • Input: elevations = [4,2,7,6,9,14,12], climbing_gears = 5, grappling_hook = 1 Output: 4
  • Input: elevations = [14,3,19,3], climbing_gears = 17, grappling_hook = 0 Output: 3
  • Input: elevations = [3,11,7,11,15], climbing_gears = 8, grappling_hook = 1 Output: 4
Q2
Balanced Substring Replacement
Data Structures & Algorithms

You are given a string S consisting only of the characters 'A', 'B', 'C', and 'D'. The length of the string is always a multiple of 4 (i.e., length = 4 * N for some positive integer N).

A string is considered balanced if every character 'A', 'B', 'C', and 'D' appears exactly N times.

Your task is to find the minimum length of a contiguous substring that can be replaced with any arbitrary sequence (of the same length) such that the entire string becomes balanced.

Function Signature:

int minSubstringToBalance(string s);

Objective:

Identify the shortest substring to replace, so that the final string has an equal number of each character, i.e., count('A') = count('B') = count('C') = count('D') = N.

Sample Inputs & Expected Outputs:

  • Input: "AAAABBCD" Output: 2 (Replace "AA" with "CD")
  • Input: "ABBBADAA" Output: 3
  • Input: "BACD" Output: 0 (Already balanced)
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!