- Role : SDE - Fullstack Developer
-----------------------------------Gameskraft Interview Experience---------------------------------
After clearing the online assessment, I received an interview call a week later.
Round 1: Technical Interview
- Problem 1: You are given an integer array power representing the power of dragons, some bullets, and some magic potions.
You start trying to kill the dragons from dragon at the 0th index and move to the next dragon by possibly killing the current dragon using bullets or magic potion.
It is given that the first dragon (0th index) is defeated automatically without using any bullets or potions.
While moving from dragon i to dragon i+1 (0-indexed), If the current dragon's power is greater than or equal to the next dragon's power, you do not need potion or bullets to kill the next dragon as the next dragon bows down seeing you kill the previous powerful dragon. if the current dragon's power is less than the next dragon's power, you can either use one potion or (power [i+1] - power [i]) bullets to defeat the next dragon.
Return the last dragon index (0-indexed) you can defeat if you use the given potions and bullets optimally.
Example:
Powers: [4, 12, 2, 7, 3, 18, 20, 3, 19]
Bullets: 10
Potions: 2
- Problem 2:An array duration represents the execution times of a set of n tasks performed within a computer system. duration[i] represents the execution time of the ith task (0 ≤ i ≤n).
An operation may be performed on these tasks:
Select a specific task.
Reduce the execution time of the selected task by one time unit. If the task's duration reaches zero, it is removed from the list of tasks.
The goal is to achieve an equilibrium state where all the tasks in the list have equal duration in the minimum number of operations. Return the number of operations.
Example:
Duration: [1, 2, 6, 3]
n: 4
Answer: 6
Round 2: Technical Interview
- Introduction followed by a discussion on projects.
- Project discussion and problem-solving.
- Problem 1:
Given a grid in which all cells are initially connected, modify the grid such that it remains connected even after blocking exactly
k
cells.
#
= Wall (cannot move to that cell)
.
= Cell (where you can move)
Operation to perform: Block exactly k
cells such that the remaining cells are still connected.
Example:
n = 3, m = 4, k = 2
Given Grid:
// # . . #
// . . # .
// # . . .
output :
// # . X #
// X . # .
// # . . .
-
Problem 2:
Find the k-th
most frequent element in an array.
-
n = 14, k = 3
Array: [5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9]
Round 3: Technical Interview
-
Introduction followed by a deep dive into projects.
-
Asked about all the APIs used in the project and some scenario-based questions related to the project.Discussed the differences between MongoDB and MySQL, and the benefits of each (discussion lasted 20-30 minutes).
-
Afterward, moved on to a coding question.
-
Problem:
You are given the root of a tree and three other nodes, say a
, b
, c
. You need to find a node in the tree such that if it is disconnected, the nodes a
, b
, and c
become part of different subtrees.