Add office photos
Employer?
Claim Account for FREE

Walmart

3.7
based on 2.5k Reviews
Video summary
Filter interviews by

Dabur Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Ways To Make Coin Change

Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more

Ans.

The task is to find the total number of ways to make change for a specified value using given denominations.

  • Use dynamic programming to solve this problem efficiently.

  • Create a 2D array to store the number of ways to make change for each value using different denominations.

  • Initialize the base cases and then iterate through the denominations to fill up the array.

  • The final answer will be in the last cell of the array corresponding to the specified value.

Add your answer

Q2. Validate Binary Search Tree (BST)

You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).

BST Definition:

A Binary Search Tree (BST)...read more

Ans.

Validate if a given binary tree is a Binary Search Tree (BST) or not.

  • Check if the left subtree of a node contains only nodes with data less than the node's data.

  • Check if the right subtree of a node contains only nodes with data greater than the node's data.

  • Recursively check if both the left and right subtrees are also binary search trees.

  • Example: For each node, ensure all nodes in its left subtree are less and all nodes in its right subtree are greater.

Add your answer

Q3. Duplicate Integer in Array

Given an array ARR of size N, containing each number between 1 and N-1 at least once, identify the single integer that appears twice.

Input:

The first line contains an integer, 'T', r...read more
Ans.

Identify the duplicate integer in an array of size N containing numbers between 1 and N-1.

  • Iterate through the array and keep track of the frequency of each element using a hashmap.

  • Return the element with a frequency greater than 1 as the duplicate integer.

  • Ensure the constraints are met and a duplicate number is guaranteed to be present in the array.

Add your answer

Q4. Maximum Frequency Number Problem Statement

Given an array of integers with numbers in random order, write a program to find and return the number which appears the most frequently in the array.

If multiple elem...read more

Ans.

The program finds the number that occurs the maximum times in an array of integers.

  • Iterate through the array and count the frequency of each number using a dictionary.

  • Keep track of the number with the maximum frequency and its index.

  • Return the number with the maximum frequency and the lowest index.

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

Q5. Next Smaller Element Problem Statement

You are provided with an array of integers ARR of length N. Your task is to determine the next smaller element for each array element.

Explanation:

The Next Smaller Elemen...read more

Ans.

Find the next smaller element for each element in an array.

  • Iterate through the array from right to left and use a stack to keep track of elements.

  • Pop elements from the stack until a smaller element is found or the stack is empty.

  • If a smaller element is found, that is the next smaller element. If the stack is empty, there is no smaller element.

Add your answer

Q6. Graph Coloring Problem

You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacent vert...read more

Ans.

The problem is to color a graph with two colors such that no two connected vertices have the same color.

  • Use a graph coloring algorithm such as Depth First Search (DFS) or Breadth First Search (BFS).

  • Start with an arbitrary vertex and color it with one color (e.g., blue).

  • Color all its adjacent vertices with the other color (e.g., red).

  • Continue this process for all connected components of the graph.

  • If at any point, you encounter two adjacent vertices with the same color, it is n...read more

Add your answer

Q7. Josephus Problem Statement

Consider 'N' individuals standing in a circle, numbered consecutively from 1 to N, in a clockwise direction. Initially, the person at position 1 starts counting and will skip K-1 pers...read more

Ans.

The Josephus Problem involves eliminating every Kth person in a circle of N individuals until only one person remains. Determine the position of the last person standing.

  • Use a circular linked list to simulate the elimination process efficiently

  • Implement a function to find the position of the last person standing based on the given N and K values

  • Consider edge cases such as when N=1 or K=1

  • Optimize the solution to handle large values of N and K efficiently

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

Interview Process at Dabur

based on 2 interviews
1 Interview rounds
Coding Test Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Intern Interview Questions from Similar Companies

3.9
 • 46 Interview Questions
3.4
 • 12 Interview Questions
3.7
 • 12 Interview Questions
4.2
 • 12 Interview Questions
4.2
 • 11 Interview Questions
3.6
 • 10 Interview Questions
View all
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
75 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