Add office photos
Engaged Employer

Dunzo

3.4
based on 741 Reviews
Video summary
Filter interviews by

30+ Carbynetech Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Maximum Coins Collection Problem

Imagine a two-dimensional grid with 'N' rows and 'M' columns, where each cell contains a certain number of coins. Alice and Bob want to maximize the total number of coins they c...read more

Ans.

Given a matrix of coins, Alice and Bob have to collect maximum coins with certain conditions.

  • Alice starts from top left corner and Bob starts from top right corner

  • They can move to (i+1, j+1) or (i+1, j-1) or (i+1, j)

  • They have to collect all the coins that are present at a cell

  • If Alice has already collected coins of a cell, then Bob gets no coins if goes through that cell again

Add your answer

Q2. Arithmetic Subarrays Problem Statement

You are provided with an array A of length N. Your task is to determine the number of arithmetic subarrays present within the array A.

Explanation:

An arithmetic subarray ...read more

Ans.

Count the number of arithmetic subarrays in an array.

  • An arithmetic subarray has 3 or more elements with the same difference between consecutive elements.

  • Loop through the array and check for all possible subarrays with 3 or more elements.

  • If the difference between consecutive elements is the same, increment the count.

  • Return the count for each test case.

Add your answer

Q3. Distance To Nearest 1 in a Binary Matrix Problem

Given a binary matrix MAT containing only 0s and 1s of size N x M, find the distance of the nearest cell containing 1 for each cell in the matrix.

The distance i...read more

Ans.

Given a binary matrix, find the distance of the nearest cell having 1 in the matrix for each cell.

  • Use BFS to traverse the matrix and find the nearest cell having 1 for each cell.

  • Initialize the output matrix with maximum possible distance.

  • If the current cell has 1, distance is 0, else update distance based on the nearest cell having 1.

Add your answer

Q4. Asteroid Collision Problem Description

Given an array/list ASTEROIDS representing asteroids aligned in a row, each element's absolute value identifies the asteroid's size, while its sign indicates the direction...read more

Ans.

Determine the state of asteroids after collisions occur.

  • Iterate through the array of asteroids and simulate collisions between adjacent asteroids.

  • Use a stack to keep track of remaining asteroids after collisions.

  • Handle cases where asteroids moving in opposite directions collide and destroy each other.

  • Handle cases where asteroids moving in the same direction do not collide.

Add your answer
Discover Carbynetech interview dos and don'ts from real experiences

Q5. Container with Most Water Problem Statement

Given a sequence of 'N' space-separated non-negative integers A[1], A[2], ..., A[i], ..., A[n], where each number in the sequence represents the height of a line draw...read more

Ans.

Find two lines to form a container with maximum water area on a Cartesian plane.

  • Iterate through the array from both ends to find the maximum area.

  • Calculate the area using the formula: (min(height[left], height[right]) * (right - left)).

  • Update the pointers based on the height of the lines to maximize the area.

Add your answer

Q6. Number of Subsequences with Even and Odd Sum

Your task is to determine the number of subsequences with odd sums and the number of subsequences with even sums from a given array of positive integers. As resultin...read more

Ans.

Count the number of subsequences with odd and even sums in a given array of positive integers modulo 10^9 + 7.

  • Use dynamic programming to keep track of the count of subsequences with odd and even sums.

  • Consider the parity of each element in the array to determine the count of subsequences with odd and even sums.

  • Apply modulo 10^9 + 7 to handle large resulting numbers.

  • Example: For input [1, 2, 3], there are 3 subsequences with odd sums and 4 subsequences with even sums.

Add your answer
Are these interview questions helpful?

Q7. Minimum Cost to Reduce Array Problem Statement

You are given an array ARR containing N positive integers. Your task is to reduce the size of this array to 1 by repetitively merging adjacent elements. Each time ...read more

Ans.

Find the minimum cost to reduce an array to a single element by merging adjacent elements with their sum.

  • Iteratively merge adjacent elements to minimize total cost

  • Choose pairs to merge strategically to reduce cost

  • Calculate sum of adjacent elements and update array size

Add your answer

Q8. Word Break II Problem Statement

Given a non-empty string 'S' containing no spaces and a dictionary of non-empty strings, generate and return all possible sentences by adding spaces in the string 'S', such that ...read more

Ans.

Given a string and a dictionary, generate all possible sentences by adding spaces between words from the dictionary.

  • Use backtracking to generate all possible sentences by recursively adding words from the dictionary to the current sentence.

  • Check if the current substring of the input string exists in the dictionary, if so, add it to the current sentence and continue recursively.

  • When the entire input string is processed, add the current sentence to the result list.

  • Repeat the pr...read more

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

Q9. Maximum Size Rectangle Binary Sub-Matrix with All 1s

Given a binary-valued matrix of size N x M, your task is to determine the largest area of a submatrix that contains only 1's.

Input:

The first line contains ...read more
Ans.

Find the largest area of a submatrix containing only 1's in a binary matrix.

  • Iterate over each cell in the matrix and calculate the maximum area of submatrix with all 1's ending at that cell.

  • Use dynamic programming to keep track of the maximum area ending at each cell.

  • Update the maximum area as you iterate through the matrix.

  • Return the overall maximum area found in the matrix.

Add your answer

Q10. Wildcard Pattern Matching Problem Statement

Implement a wildcard pattern matching algorithm to determine if a given wildcard pattern matches a text string completely.

The wildcard pattern may include the charac...read more

Ans.

Implement a wildcard pattern matching algorithm to determine if a given wildcard pattern matches a text string completely.

  • Create a dynamic programming matrix to store intermediate results

  • Handle cases for '?' and '*' characters separately

  • Check if the characters match or '*' can be used to match any sequence of characters

Add your answer

Q11. Anagram Substring Search

Given two strings 'STR' and 'PTR', identify all starting indices of 'PTR' anagram substrings in 'STR'. Two strings are anagrams if one can be rearranged to form the other.

Input:

First ...read more
Ans.

Identify starting indices of anagram substrings of 'PTR' in 'STR'.

  • Use a sliding window approach to check for anagrams of 'PTR' in 'STR'.

  • Create a frequency map of characters in 'PTR' and 'STR' to compare.

  • Slide the window along 'STR' and check if the frequency maps match.

  • Return the starting indices where anagrams are found.

Add your answer

Q12. Bipartite Graph Problem Statement

Given an undirected graph of 'V' vertices (labeled 0, 1, ..., V-1) and 'E' edges, the task is to determine whether the graph is bipartite.

Explanation:

A bipartite graph is one...read more

Ans.

The task is to determine whether a given undirected graph is bipartite or not.

  • Create a function to check if the graph can be colored using two colors without any adjacent vertices sharing the same color.

  • Use graph coloring algorithms like BFS or DFS to determine if the graph is bipartite.

  • Check for odd-length cycles in the graph, as a bipartite graph cannot have odd-length cycles.

  • Consider using a boolean array to keep track of visited vertices and their colors while traversing ...read more

Add your answer

Q13. Convert Binary Tree to Mirror Tree Problem Statement

Given a binary tree, convert this binary tree into its mirror tree. A binary tree is a tree in which each parent node has at most two children. The mirror of...read more

Ans.

Convert a binary tree into its mirror tree by interchanging left and right children of non-leaf nodes.

  • Traverse the binary tree in a recursive manner and swap the left and right children of each non-leaf node.

  • Use a temporary variable to swap the children of each node.

  • Ensure to handle cases where a node may have only one child or no children.

  • Implement the function to convert the given binary tree to its mirror tree in place.

Add your answer

Q14. Next Greater Element Problem Statement

You are given an array arr of length N. For each element in the array, find the next greater element (NGE) that appears to the right. If there is no such greater element, ...read more

Ans.

The task is to find the next greater element for each element in an array to its right, if no greater element exists return -1.

  • Use a stack to keep track of elements for which the next greater element is not found yet.

  • Iterate through the array from right to left, popping elements from the stack until a greater element is found.

  • Store the next greater element for each element in a separate array.

Add your answer

Q15. Longest Common Subsequence Problem Statement

Given two strings STR1 and STR2, determine the length of their longest common subsequence.

A subsequence is a sequence that can be derived from another sequence by d...read more

Ans.

The problem involves finding the length of the longest common subsequence between two given strings.

  • Use dynamic programming to solve the problem efficiently.

  • Create a 2D array to store the lengths of common subsequences of substrings.

  • Iterate through the strings to fill the array and find the length of the longest common subsequence.

  • Return the length of the longest common subsequence for each test case.

Add your answer

Q16. Convert Array to Min Heap Task

Given an array 'ARR' of integers with 'N' elements, you need to convert it into a min-binary heap.

A min-binary heap is a complete binary tree where each internal node's value is ...read more

Ans.

Convert the given array into a min-binary heap by following min-heap properties.

  • Iterate through the array and heapify each node starting from the last non-leaf node to the root.

  • For each node, compare it with its children and swap if necessary to maintain min-heap property.

  • Continue this process until the entire array satisfies the min-heap property.

Add your answer

Q17. Valid Parentheses Problem Statement

Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.

Input:

The first line contains an integer...read more
Ans.

The task is to determine if a given string consisting of parentheses is balanced or not.

  • Use a stack data structure to keep track of opening parentheses

  • Iterate through the string and push opening parentheses onto the stack and pop when encountering a closing parenthesis

  • If at the end the stack is empty, the string is balanced, otherwise it is not

Add your answer

Q18. Left View of a Binary Tree

Given a binary tree, your task is to print the left view of the tree. The left view of a binary tree contains the nodes visible when the tree is viewed from the left side.

Input:

The ...read more
Ans.

Print the left view of a binary tree, containing nodes visible from the left side.

  • Traverse the tree level by level, keeping track of the leftmost node at each level

  • Use a queue for level order traversal and a map to store the leftmost nodes

  • Print the values of leftmost nodes stored in the map as the left view of the tree

Add your answer

Q19. Trie Data Structure Implementation

Design and implement a Trie (Prefix Tree) which should support the following two operations:

1. Insert a word into the Trie. The operation is marked as 'insert(word)'.
2. Searc...read more
Ans.

Implement a Trie data structure supporting insert and search operations efficiently.

  • Implement a Trie class with insert and search methods.

  • Use a nested class Node to represent each node in the Trie.

  • For insert operation, iterate through each character in the word and create nodes as needed.

  • For search operation, traverse the Trie based on the characters in the word to check for existence.

  • Return 'TRUE' if the word is found in the Trie, 'FALSE' otherwise.

Add your answer

Q20. Left View of a Binary Tree Problem Statement

Given a binary tree, your task is to print the left view of the tree.

Example:

Input:
The input will be in level order form, with node values separated by a space. U...read more
Ans.

Print the left view of a binary tree given in level order form.

  • Traverse the tree level by level and print the first node of each level (leftmost node)

  • Use a queue to keep track of nodes at each level

  • Time complexity should be O(n) where n is the number of nodes in the tree

Add your answer
Q21. How would you implement undo and redo operations for MS Word?
Ans.

Implementing undo and redo operations for MS Word

  • Maintain a stack for undo operations and another stack for redo operations

  • Whenever a change is made, push the previous state onto the undo stack

  • When undo is triggered, pop the state from undo stack and push it onto redo stack

  • When redo is triggered, pop the state from redo stack and push it onto undo stack

  • Ensure to update the document state accordingly after each undo or redo operation

Add your answer

Q22. How challenging is handling blue coloured employees

Ans.

It is not appropriate to refer to employees by their skin color. All employees should be treated equally and with respect.

  • It is important to avoid using language that could be perceived as discriminatory or offensive

  • Focus on individual performance and behavior rather than skin color

  • Provide equal opportunities for all employees to succeed

  • Create a culture of inclusivity and diversity

  • Train managers and employees on diversity and inclusion best practices

Add your answer

Q23. What would be the ideal EPH for any city.

Ans.

Ideal EPH for a city depends on various factors such as population, geography, climate, and infrastructure.

  • EPH stands for 'Events Per Hour', which refers to the number of emergency incidents that occur in a city per hour.

  • The ideal EPH for a city can vary depending on the size of the population, the geography of the area, the climate, and the infrastructure available to respond to emergencies.

  • For example, a city with a high population density and limited emergency services may...read more

Add your answer

Q24. What tools are required to run a smooth operation

Ans.

Tools required for a smooth operation include inventory management software, communication tools, and employee scheduling software.

  • Inventory management software to track stock levels and ensure timely restocking

  • Communication tools such as email, phone, and messaging apps to keep in touch with employees and customers

  • Employee scheduling software to manage shifts and ensure adequate staffing levels

  • Point of sale (POS) system to process transactions and track sales data

  • Security sy...read more

Add your answer

Q25. Overall supply needed for N number of tasks

Ans.

The overall supply needed for N number of tasks depends on the specific requirements of each task.

  • The supply needed for each task should be assessed individually

  • Factors such as task duration, complexity, and required resources should be considered

  • The total supply needed can be calculated by adding up the supply requirements for each task

  • Regular monitoring and adjustment of supply levels may be necessary

Add your answer

Q26. Last ctc and expecting in current organisation

Ans.

I am currently earning INR 8 lakhs per annum and expecting a hike of 10% in my current organization.

  • My last CTC was INR 8 lakhs per annum.

  • I am expecting a hike of 10% in my current organization.

  • I am open to negotiation based on the job responsibilities and market standards.

Add your answer

Q27. Privious company details work responsibility

Add your answer

Q28. What you know abou sales

Ans.

Sales involves identifying customer needs, presenting products or services, and closing deals to generate revenue.

  • Understanding customer needs and preferences

  • Effective communication and persuasion skills

  • Product knowledge and ability to highlight benefits

  • Negotiation and closing techniques

  • Building and maintaining customer relationships

  • Meeting sales targets and goals

Add your answer

Q29. SQL joins difference

Ans.

SQL joins are used to combine rows from two or more tables based on a related column between them.

  • Types of SQL joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

  • INNER JOIN returns rows when there is at least one match in both tables.

  • LEFT JOIN returns all rows from the left table and the matched rows from the right table.

  • RIGHT JOIN returns all rows from the right table and the matched rows from the left table.

  • FULL JOIN returns rows when there is a match in one of ...read more

Add your answer

Q30. What is your expected CTC

Ans.

My expected CTC is in line with industry standards and commensurate with my experience and skills.

  • I have researched the market and have a good understanding of the salary range for this position

  • I am open to negotiation based on the overall compensation package

  • I am looking for a fair and competitive salary that reflects my qualifications and contributions to the company

Add your answer

Q31. What abou your study

Ans.

I have a Bachelor's degree in Business Administration with a focus on sales and marketing.

  • Bachelor's degree in Business Administration

  • Focus on sales and marketing

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

Interview Process at Carbynetech

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

Top Interview Questions from Similar Companies

4.0
 • 407 Interview Questions
3.8
 • 403 Interview Questions
3.6
 • 340 Interview Questions
4.2
 • 142 Interview Questions
4.3
 • 138 Interview Questions
View all
Top Dunzo 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