Add office photos
Employer?
Claim Account for FREE

WatchGuard Technologies

3.9
based on 14 Reviews
Filter interviews by

20+ Classic Marble Company Interview Questions and Answers

Updated 25 Sep 2024

Q1. Party Over: Sorting Strings Problem

Help Ninja sort the provided list of strings according to a specific condition given by a monster. The condition is to sort the strings based on the last letter. If two strin...read more

Ans.

Sort the list of strings based on the last character, then second last character, and so on.

  • Iterate through each string in the list

  • Sort the strings based on the last character first, then second last character, and so on

  • Use a custom sorting function to achieve the required sorting order

Add your answer

Q2. Distinct Elements in K-Sized Windows

The task is to determine the number of distinct elements in every sliding window of size 'K' across an array 'ARR' of size 'N'. A 'K' sized window is a contiguous sequence o...read more

Ans.

Calculate the count of distinct elements in each sliding window of size 'K' across an array 'ARR'.

  • Use a sliding window approach to iterate through the array and keep track of distinct elements using a hashmap or set.

  • Update the count of distinct elements in each window as it slides across the array.

  • Return the array detailing the count of distinct elements in each 'K' sized window for each test case.

Add your answer

Q3. Treasure Hunt Problem Statement

Alex and Rome are engaged in a treasure hunt game. Rome has a treasure box that Alex aims to open, using one of the N uniquely numbered keys placed by Rome in boxes numbered sequ...read more

Ans.

Given a list of key numbers in sequentially numbered boxes, help Alex determine the box containing the correct key.

  • Iterate through the list of key numbers and compare each with the target key number.

  • Use binary search for efficient search in the sorted list of key numbers.

  • Return the box number if the correct key is found, otherwise indicate that it is not present.

Add your answer

Q4. Covid Vaccination Distribution Problem

As the Government ramps up vaccination drives to combat the second wave of Covid-19, you are tasked with helping plan an effective vaccination schedule. Your goal is to ma...read more

Ans.

Maximize vaccines administered on a specific day while following certain rules.

  • Iterate through each test case and calculate the maximum number of vaccines distributed on the specified day.

  • Distribute vaccines in a way that the difference between consecutive days is at most 1 and the total does not exceed the maximum allowed.

  • Ensure to maximize the number of vaccines administered on the specified day.

  • Return the maximum number of vaccines administered on the specified day for eac...read more

Add your answer
Discover Classic Marble Company interview dos and don'ts from real experiences

Q5. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Ans.

Reverse a given string containing alphabets, numbers, and special characters.

  • Iterate through the string from end to start and append each character to a new string.

  • Alternatively, use built-in functions like reverse() or slicing to reverse the string.

  • Handle special characters and numbers while reversing the string.

  • Ensure to consider the constraints on the length of the string and number of test cases.

Add your answer

Q6. Move Zeros to Left Problem Statement

Your task is to rearrange a given array ARR such that all zero elements appear at the beginning, followed by non-zero elements, while maintaining the relative order of non-z...read more

Ans.

Rearrange an array such that all zero elements appear at the beginning, followed by non-zero elements, maintaining relative order of non-zero elements.

  • Iterate through the array and maintain two pointers - one for the next position to place a zero and one for the next non-zero element.

  • Swap the elements at these pointers until all zeros are moved to the left and non-zero elements are in their relative order.

  • Time complexity: O(N), Space complexity: O(1)

  • Example: Input: [1, 1, 0, ...read more

Add your answer
Are these interview questions helpful?
Q7. ...read more

Mirror Diagonals Problem Statement

Ninja has a square 2D array arr of size N x N. Your task is to determine if the numbers on the left diagonal are the same as those on the right diagonal of the matrix.

Input:

Ans.

Check if the numbers on the left diagonal are the same as those on the right diagonal of a square matrix.

  • Iterate through the matrix to compare the numbers on the left and right diagonals.

  • Keep track of the numbers on both diagonals and check for equality.

  • Return 'true' if the diagonals are equal, otherwise return 'false'.

Add your answer

Q8. MergeSort Linked List Problem Statement

You are given a Singly Linked List of integers. Your task is to sort the list using the 'Merge Sort' algorithm.

Input:

The input consists of a single line containing the ...read more
Ans.

Sort a Singly Linked List using Merge Sort algorithm.

  • Implement the Merge Sort algorithm for linked lists.

  • Divide the list into two halves, sort each half recursively, and then merge them.

  • Use a fast and slow pointer to find the middle of the list for splitting.

  • Handle the base cases of empty list or single node list.

  • Example: Input: 4 3 2 1 -1, Output: 1 2 3 4

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Alpha Pattern Problem Statement

Ninja wants to create a pattern using characters in a specified number of rows ‘N’. The pattern arranges characters in increasing order, such that the first row has 1 character, ...read more

Ans.

Generate a pattern of characters in increasing order based on the number of rows specified.

  • Iterate through each row from 1 to N

  • For each row, print the corresponding character repeated row number of times

  • Increment the character for each row

Add your answer
Q10. Write an SQL query to find the second highest salary from a table.
Ans.

SQL query to find the second highest salary from a table

  • Use the MAX() function to find the highest salary

  • Use the NOT IN operator to exclude the highest salary from the results

  • Order the salaries in descending order and limit the result to 1

Add your answer

Q11. What are the types of inheritance

Ans.

There are 5 types of inheritance: single, multiple, multilevel, hierarchical, and hybrid.

  • Single inheritance: A class inherits from a single base class.

  • Multiple inheritance: A class inherits from multiple base classes.

  • Multilevel inheritance: A class inherits from a derived class, which in turn inherits from another class.

  • Hierarchical inheritance: Multiple classes inherit from a single base class.

  • Hybrid inheritance: Combination of multiple and multilevel inheritance.

Add your answer

Q12. Write a code to reverse array in a linked list

Ans.

Reverses the order of elements in an array stored in a linked list.

  • Traverse the linked list and store the elements in an array

  • Reverse the array using two pointers

  • Update the linked list with the reversed array

Add your answer

Q13. Write a code implementing inheritance

Ans.

Code implementing inheritance

  • Inheritance is a concept in object-oriented programming where a class inherits properties and methods from another class

  • The class that is being inherited from is called the parent class or base class

  • The class that inherits from the parent class is called the child class or derived class

  • The child class can access the properties and methods of the parent class

  • Inheritance promotes code reusability and allows for creating specialized classes based on ...read more

Add your answer

Q14. preorder traversal without using recursion

Ans.

Iterative solution to perform preorder traversal without using recursion

  • Use a stack to keep track of nodes

  • Start by pushing the root node onto the stack

  • While the stack is not empty, pop a node, visit it, then push its right child followed by its left child onto the stack

Add your answer

Q15. 4 pillars of oops , tcp ip model ,osi model

Ans.

4 pillars of OOPs are Abstraction, Encapsulation, Inheritance, and Polymorphism. TCP/IP and OSI models are networking models.

  • Abstraction: Hiding implementation details and showing only necessary information.

  • Encapsulation: Binding data and functions together and restricting access to them.

  • Inheritance: Creating new classes from existing ones, inheriting their properties and methods.

  • Polymorphism: Ability of objects to take on multiple forms or behaviors.

  • TCP/IP model: Consists of...read more

Add your answer

Q16. virus vs malware, python code for identifying the ip adress

Ans.

Malware is a broad term that includes viruses, which are a specific type of malware. Python code can be used to identify IP addresses in malware analysis.

  • Malware is a general term for any type of malicious software, while viruses are a specific type of malware that self-replicates by inserting copies of itself into other computer programs.

  • Python code can be used to extract and analyze IP addresses from malware samples, helping analysts understand the network infrastructure us...read more

Add your answer

Q17. rotate materix(nxn) 90 degree

Ans.

To rotate a matrix 90 degrees, transpose the matrix and then reverse each row.

  • Transpose the matrix by swapping matrix[i][j] with matrix[j][i]

  • Reverse each row of the transposed matrix to get the final rotated matrix

Add your answer

Q18. what is diamond problem

Ans.

Diamond problem is a common issue in multiple inheritance where a class inherits from two classes that have a common ancestor.

  • Occurs in languages that support multiple inheritance like C++

  • Results in ambiguity when calling methods or accessing attributes from the common ancestor class

  • Can be resolved using virtual inheritance or interfaces

Add your answer

Q19. run length encoding dsa problem

Ans.

Run length encoding is a data compression technique that replaces repeated characters with a count and single character.

  • Iterate through the input array of strings

  • Count the number of consecutive characters in each string

  • Replace consecutive characters with count and character

Add your answer

Q20. rotate an array by d times

Ans.

Rotate an array of strings by d times

  • Create a new array and copy elements from original array based on rotation index

  • Use modulo operator to handle cases where d is greater than array length

  • Handle edge cases like empty array or d being negative

Add your answer

Q21. 5 dsa array string

Ans.

Implement a data structure for storing and manipulating an array of strings.

  • Use a dynamic array to store the strings.

  • Implement functions for adding, removing, and accessing strings in the array.

  • Consider memory management and resizing the array as needed.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Classic Marble Company

based on 18 interviews
Interview experience
3.7
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.8
 • 3.9k Interview Questions
3.8
 • 1.7k Interview Questions
4.0
 • 258 Interview Questions
4.2
 • 178 Interview Questions
4.0
 • 158 Interview Questions
3.7
 • 142 Interview Questions
View all
Top WatchGuard Technologies Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter