Panda Guru LogoPanda
Guru

Tracxn Intreview

Round 1

Questions:

  1. Search in matrix (Revised)

You are given an 'm x n' matrix where each cell represents an alphabetical character (denoted by 'a' to 'z') or a wildcard character (denoted by '?').

Write a function 'search_in_matrix' to search string in the matrix that will have the following interface

Input

Output

Constraints:

Additional Constraints: 1xn.m 100

Input 1:

string : code Matrix a C O y b ? i fd k e m W X g e

Output 1: 1

Input 2:

string = "code" Matrix a C O y bf ? L i k e m W X g e

Output 2: 1

Execution time limit: 10 seconds


Round 2

Questions: For a string S, remove consecutive duplicate characters of even count.

E.g.

  1. Input: abbcbddd Output: acbddd
  2. Input: azxxzyyyddddyzzz Output: azzz

Candidate's Approach:

Candidate's Approach

The candidate initially struggled with the problem but later reattempted it and solved it in 45 minutes. The initial approach involved iterating through the string and counting consecutive characters, then removing them if their count was even.

After discussing with friends, the candidate optimized the solution to O(N) time complexity and O(N) space complexity using a stack to manage character counts.

Interviewer's Feedback

The interviewer was patient and provided guidance during the coding process. However, the candidate was unable to solve the problem during the interview.