This round was conducted in Mettl.
Given a NxN chess board, there are some black soldiers represented by 'S', some black knights represented by 'H', and a black king represented by 'K'. Also there are some friendly pieces (i.e. they do not attack but block the cell) represented by 'F'. You only have a single white knight. Find the minimum possible steps you need to take to kill the king by taking safe steps. It is assumed that the black pieces do not move but they can attack if your knight goes in their area. The knights and king attack as they do in normal chess game. But here the soldiers can attack diagonally in any direction by taking one step.
My idea here was to do a preprocessing of the chess board and then apply bfs to find the shorter number of steps. Comment below if you have a better solution.
Find the 'k' th largest element in a BST. My solution was https://www.geeksforgeeks.org/kth-largest-element-in-bst-when-modification-to-bst-is-not-allowed/ where I used O(1) space and O(h + k) time, where 'h' is the height of the tree.
Find the 'k' th largest element from a stream of numbers - https://www.geeksforgeeks.org/kth-largest-element-in-a-stream/
Given a set of strings such that each contains only lowercase letters. The ending character of one string can be joined to the beginning character of another string having same character. Find if a cycle can be formed by including all the given strings only once.
For eg., Suppose the set of strings are - ["abaa", "babba", "ab"], the cycle can be - "abaa"->"ab"->"babba"->"abaa".
We had a long discussion on the projects that I have done. Be prepared for all types of questions.
Questions were asked from topics like Operating Systems and Database Management Systems.
Given a stream of strings and their corresponding timestamp (in seconds) when they arrive to a system. Print those strings in order which has not been printed in the last 10 seconds. Comment how you would have approached this problem. https://leetcode.com/problems/logger-rate-limiter (premium)
Questions from my projects were also asked in this round.
Finally I was SELECTED !