Add office photos
Engaged Employer

Cadence Design Systems

4.1
based on 272 Reviews
Video summary
Filter interviews by

10+ Khanco Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Find All Pairs with Given Sum

Given an integer array arr and an integer Sum, count and return the total number of pairs in the array whose elements add up to the given Sum.

Input:

The first line contains two sp...read more
Ans.

Count and return the total number of pairs in the array whose elements add up to a given sum.

  • Use a hashmap to store the frequency of each element in the array.

  • Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.

  • Increment the count of pairs if the complement exists in the hashmap.

Add your answer

Q2. Minimum Number of Jumps Problem

Given an array ARR of N integers, determine the minimum number of jumps required to reach the last index of the array (i.e., N - 1). From any index i, you can jump to an index i ...read more

Ans.

The problem involves finding the minimum number of jumps required to reach the last index of an array, where each element indicates the maximum distance that can be jumped from that position.

  • Use a greedy approach to keep track of the farthest reachable index and the current end of the jump.

  • Iterate through the array, updating the farthest reachable index and incrementing the jump count when necessary.

  • Return the jump count as the minimum number of jumps needed to reach the last...read more

Add your answer

Q3. Two Teams (Check Whether Graph is Bipartite or Not)

Determine if a given undirected graph can be divided into exactly two disjoint cliques. Print 1 if possible, otherwise print 0.

Input:

The first line contains...read more
Ans.

Check if a given undirected graph can be divided into exactly two disjoint cliques.

  • Create an adjacency list to represent the graph

  • Use BFS or DFS to check if the graph is bipartite

  • If the graph is bipartite, it can be divided into two disjoint cliques

Add your answer

Q4. Maximum Length Pair Chain Problem

You are provided with 'N' pairs of integers, where the first number in each pair is less than the second number, i.e., in pair (a, b) -> a < b. A pair chain is defined as a seq...read more

Ans.

Find the length of the longest pair chain that can be formed using the provided pairs.

  • Sort the pairs based on the second number in each pair.

  • Iterate through the sorted pairs and keep track of the maximum chain length.

  • Update the maximum chain length based on the conditions given in the problem statement.

Add your answer
Discover Khanco interview dos and don'ts from real experiences
Q5. What is the Diamond Problem in C++ and how can it be resolved?
Ans.

Diamond Problem is a common issue in multiple inheritance in C++ where a class inherits from two classes that have a common base class.

  • Diamond Problem occurs when a class inherits from two classes that have a common base class, leading to ambiguity in accessing members.

  • It can be resolved in C++ using virtual inheritance, where the common base class is inherited virtually to avoid duplicate copies of base class members.

  • Example: class A is inherited by classes B and C, and then...read more

Add your answer
Q6. What is data abstraction and how can it be achieved?
Ans.

Data abstraction is the process of hiding implementation details and showing only the necessary features of an object.

  • Data abstraction can be achieved through classes and objects in object-oriented programming.

  • It involves creating a class with private data members and public methods to access and modify those data members.

  • By using data abstraction, users can interact with objects without needing to know the internal workings of the object.

  • For example, a car object may have me...read more

Add your answer
Are these interview questions helpful?
Q7. What is meant by multitasking and multithreading in operating systems?
Ans.

Multitasking involves running multiple tasks concurrently, while multithreading allows multiple threads within a single process to run concurrently.

  • Multitasking allows multiple processes to run concurrently on a single processor, switching between them quickly.

  • Multithreading allows multiple threads within a single process to run concurrently, sharing resources like memory and CPU time.

  • Multitasking is at the process level, while multithreading is at the thread level.

  • Example: A...read more

Add your answer
Q8. How would you design a system like Pastebin?
Ans.

Design a system like Pastebin for sharing text snippets

  • Use a web application framework like Django or Flask for the backend

  • Store text snippets in a database like MySQL or MongoDB

  • Generate unique URLs for each snippet to share with others

  • Implement features like syntax highlighting, expiration time, and password protection

  • Consider implementing user accounts for managing and organizing snippets

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Can you explain the TCP/IP Protocol?
Ans.

TCP/IP is a set of rules governing the exchange of data over the internet.

  • TCP/IP stands for Transmission Control Protocol/Internet Protocol.

  • It is a suite of communication protocols used to connect devices on the internet.

  • TCP ensures that data is delivered reliably and in order, while IP handles the addressing and routing of data packets.

  • Examples of TCP/IP applications include web browsing (HTTP), email (SMTP), and file transfer (FTP).

Add your answer
Q10. What are friend functions in C++?
Ans.

Friend functions in C++ are functions that are not members of a class but have access to its private and protected members.

  • Friend functions are declared inside a class with the keyword 'friend'.

  • They can access private and protected members of the class they are friends with.

  • Friend functions are not member functions of the class.

  • They can be standalone functions or functions of another class.

  • Example: friend void displayDetails(Student);

Add your answer
Q11. Can you explain the DHCP Protocol?
Ans.

DHCP Protocol is used to automatically assign IP addresses to devices on a network.

  • DHCP stands for Dynamic Host Configuration Protocol

  • It allows devices to obtain IP addresses and other network configuration information dynamically

  • DHCP servers assign IP addresses to devices for a specific lease period

  • DHCP uses a client-server model where the client requests an IP address and the server assigns one

  • DHCP uses UDP port 67 for the server and UDP port 68 for the client

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-2 Interview Questions from Similar Companies

4.1
 • 39 Interview Questions
3.8
 • 19 Interview Questions
4.0
 • 16 Interview Questions
3.9
 • 14 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

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