Add office photos
Employer?
Claim Account for FREE

Applied Materials

3.9
based on 395 Reviews
Filter interviews by

KPMG India Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations
Asked in
SDE Interview

Q1. What is hashing? When is the time complexity of searching a hash table O(n)?

Ans.

Hashing is a technique to map data to a fixed-size table. Time complexity of searching a hash table is O(n) in worst case.

  • Hashing is used to store and retrieve data quickly

  • It uses a hash function to map data to a fixed-size table

  • In the best case, searching a hash table takes O(1) time

  • In the worst case, all the data maps to the same index and searching takes O(n) time

  • Collision resolution techniques like chaining and open addressing are used to handle collisions

Add your answer
Asked in
SDE Interview

Q2. What data structure would you use for a dictionary?

Ans.

An array of key-value pairs is the best data structure for a dictionary.

  • Use a hash table or a balanced tree to implement the dictionary.

  • Keys should be unique and immutable.

  • Values can be any data type.

  • Access time should be O(1) or O(log n) depending on the implementation.

  • Examples: Python's dict, Java's HashMap, C++'s unordered_map.

Add your answer
Asked in
SDE Interview

Q3. Puzzle - add mathematical operators to make all these expressions true-

Ans.

Add mathematical operators to make given expressions true.

  • Use addition, subtraction, multiplication, division, exponentiation, and parentheses to modify the expressions.

  • For example, 5 - 3 + 2 = 4 can be made true by adding parentheses: 5 - (3 + 2) = 0.

  • Another example is 6 6 6 6 = 4 can be made true by using square root: √6 ÷ √6 + √6 - √6 = 4.

Add your answer
Asked in
SDE Interview

Q4. Difference between an array and a linked list

Ans.

Array is a collection of elements stored in contiguous memory locations while linked list is a collection of nodes linked by pointers.

  • Arrays have fixed size while linked lists can grow or shrink dynamically

  • Insertion and deletion is faster in linked lists than arrays

  • Accessing elements in arrays is faster than linked lists

  • Arrays are better for random access while linked lists are better for sequential access

Add your answer
Discover KPMG India interview dos and don'ts from real experiences
Asked in
SDE Interview

Q5. Practical application of a linked list

Ans.

A linked list is used to store and manipulate a collection of data elements in a linear order.

  • Linked lists are commonly used in computer science for implementing data structures like stacks, queues, and hash tables.

  • They are also used in operating systems for managing memory allocation.

  • For example, a linked list can be used to implement a music playlist where each song is a node and the links between nodes represent the order of the songs.

  • Another example is a spell checker tha...read more

Add your answer
Asked in
SDE Interview

Q6. Implement a stack using a linked list

Ans.

Implement a stack using a linked list

  • Create a Node class with data and next pointer

  • Create a Stack class with top pointer

  • Push new nodes to the top of the stack

  • Pop nodes from the top of the stack

  • Check if the stack is empty before popping

Add your answer
Asked in
SDE Interview

Q7. program to check if a tree is a BST

Ans.

Program to check if a binary tree is a BST

  • Traverse the tree in-order and check if the values are in ascending order

  • Use a min-max range for each node to check if it satisfies the BST property

  • Recursively check if the left and right subtrees are BSTs

Add your answer
Asked in
SDE Interview

Q8. What is a BST?

Ans.

BST stands for Binary Search Tree, a data structure used for efficient searching and sorting operations.

  • BST is a tree-like data structure where each node has at most two children.

  • The left child of a node contains a value less than the parent node, while the right child contains a value greater than the parent node.

  • BST allows for efficient searching and sorting operations with a time complexity of O(log n).

  • Examples of applications of BST include dictionary, spell checker, and ...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top SDE Interview Questions from Similar Companies

4.1
 • 47 Interview Questions
4.4
 • 14 Interview Questions
4.1
 • 12 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
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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