Add office photos
Employer?
Claim Account for FREE

LinguaSol

3.9
based on 4 Reviews
Filter interviews by

The Doon School Interview Questions and Answers

Updated 19 Aug 2024

Q1. what is Binary Serch Tree and its Time Complexity.

Ans.

Binary Search Tree is a data structure where each node has at most two children, with left child smaller and right child larger. Time complexity is O(log n) for search, insert, and delete operations.

  • Nodes have at most two children - left child is smaller, right child is larger

  • Search, insert, and delete operations have time complexity of O(log n)

  • Example: In a BST, if we search for a value, we can eliminate half of the remaining nodes at each step

Add your answer

Q2. Difference between array and linked list ? Arraylist and LinkedList in collection framework

Ans.

Array is a fixed-size data structure while linked list is a dynamic data structure. ArrayList and LinkedList are implementations of List interface in Java.

  • Array is a contiguous block of memory with fixed size, while linked list is a collection of nodes where each node points to the next node.

  • ArrayList in Java is implemented using an array, which can dynamically resize itself. LinkedList is implemented using nodes with references to the next and previous nodes.

  • Arrays are faste...read more

Add your answer

Q3. Explain Quick sort , Merge Sort algorithm

Ans.

Quick sort and Merge sort are popular sorting algorithms used to efficiently sort arrays of elements.

  • Quick sort: Divide and conquer algorithm, picks a pivot element and partitions the array around the pivot. Recursively sorts subarrays.

  • Merge sort: Divide and conquer algorithm, divides the array into two halves, recursively sorts the halves, and then merges them back together.

  • Example: Quick sort - [3, 6, 8, 10, 1, 2, 1], Merge sort - [7, 2, 4, 1, 5, 3]

Add your answer

Q4. Write down the linked list implementation code .

Ans.

Implementation of a linked list in code format

  • Define a Node class with data and next pointer

  • Create LinkedList class with methods like insert, delete, search

  • Handle edge cases like empty list, inserting at beginning/end

Add your answer
Discover The Doon School interview dos and don'ts from real experiences

Q5. difference between interface and abstract class

Ans.

Interface defines only method signatures while abstract class can have method implementations.

  • Interface cannot have method implementations, only method signatures

  • Abstract class can have method implementations along with abstract methods

  • A class can implement multiple interfaces but can only inherit from one abstract class

  • Interfaces are used to achieve multiple inheritance in Java

  • Abstract classes can have constructors while interfaces cannot

Add your answer

Q6. what is polymorphism

Ans.

Polymorphism is the ability of a single function or method to operate on different types of data.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).

  • Example: a superclass Animal with subclasses Dog and Cat. Both Dog and Cat can be treated as Animals.

Add your answer

Q7. java code on HashMap().

Ans.

HashMap is a data structure in Java that stores key-value pairs.

  • HashMap is part of the Java Collections framework.

  • Keys in a HashMap must be unique.

  • Values in a HashMap can be duplicated.

  • Example: HashMap map = new HashMap<>();

  • Example: map.put("John", 25);

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

3.4
 • 489 Interview Questions
3.9
 • 304 Interview Questions
3.4
 • 252 Interview Questions
4.2
 • 147 Interview Questions
4.2
 • 143 Interview Questions
3.8
 • 134 Interview Questions
View all
Top LinguaSol 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
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