Add office photos
Delhivery logo
Premium Employer

Delhivery

Verified
3.9
based on 6.2k Reviews
Video summary
Filter interviews by
Software Developer
Clear (1)

10+ Delhivery Software Developer Interview Questions and Answers

Updated 2 Aug 2024

Q1. Rotting Oranges Problem Statement

You are given an undirected and disconnected graph G(V, E) with V vertices numbered from 0 to V-1 and E edges. Your task is to perform a BFS traversal starting from the 0th ver...read more

Ans.

Perform BFS traversal on an undirected and disconnected graph starting from vertex 0.

  • Implement BFS traversal algorithm starting from vertex 0

  • Use a queue to keep track of visited nodes and their neighbors

  • Print the traversal order in sorted order for each node's connected nodes

Add your answer
right arrow

Q2. BFS Traversal in a Graph

Given an undirected and disconnected graph G(V, E) where V vertices are numbered from 0 to V-1, and E represents edges, your task is to output the BFS traversal starting from the 0th ve...read more

Ans.

BFS traversal of an undirected and disconnected graph starting from vertex 0.

  • Implement BFS algorithm to traverse the graph starting from vertex 0.

  • Use a queue to keep track of visited nodes and their neighbors.

  • Ensure to visit all connected components of the graph.

  • Print the BFS traversal sequence for each test case in a separate line.

  • Handle cases where not all vertices are reachable from vertex 0.

View 1 answer
right arrow

Q3. Smallest Integer Not Representable as Subset Sum

Given a non-decreasing sorted array ARR of N positive numbers, determine the smallest positive integer that cannot be expressed as the sum of elements from any p...read more

Ans.

Find the smallest positive integer that cannot be expressed as the sum of elements from any proper subset of a non-decreasing sorted array of positive numbers.

  • Start with the smallest possible sum that can be represented, which is 1.

  • Iterate through the array and update the smallest sum that cannot be represented.

  • Return the final smallest sum that cannot be represented.

Add your answer
right arrow

Q4. What is diameter of Binary Tree? Write full working code.

Ans.

Diameter of a binary tree is the longest path between any two leaf nodes.

  • Calculate the height of left and right subtrees recursively.

  • Calculate the diameter recursively using the formula max(left_height + right_height + 1, max(left_diameter, right_diameter)).

  • Return the maximum diameter.

Add your answer
right arrow
Discover Delhivery interview dos and don'ts from real experiences

Q5. Find interchanged terms from an AP, where terms are arranged in series

Ans.

To find interchanged terms from an AP series

  • Identify the common difference between terms

  • Swap the positions of adjacent terms

  • Check if the new series is also an AP

  • Repeat until no more interchanged terms can be found

Add your answer
right arrow
Q6. Design an LRU (Least Recently Used) cache.
Ans.

Design an LRU cache to store least recently used items efficiently.

  • Use a combination of a doubly linked list and a hashmap to store and retrieve items in O(1) time complexity.

  • When an item is accessed, move it to the front of the linked list to mark it as the most recently used.

  • If the cache is full, remove the least recently used item from the end of the linked list and the hashmap.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Design a stack that support getmin in O(1) time and O(1) space complexities

Ans.

Design a stack that supports getmin in O(1) time and O(1) space complexities.

  • Use two stacks, one for storing the actual values and the other for storing the minimum values.

  • When pushing a new value, check if it is smaller than the current minimum value and push it to the minimum stack if it is.

  • When popping a value, check if it is the current minimum value and pop it from the minimum stack if it is.

  • To get the minimum value, simply return the top value of the minimum stack.

Add your answer
right arrow

Q8. whats difference between patch and put

Ans.

Patch is used to update a specific part of a resource, while put is used to replace the entire resource.

  • Patch is used for partial updates, while put is used for full updates.

  • Patch is idempotent, meaning multiple identical patch requests will have the same effect as a single request, while put is not necessarily idempotent.

  • Example: Using patch to update the title of a blog post without affecting other fields, while using put to replace the entire blog post with a new one.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Explain database indexing

Ans.

Database indexing is a technique to improve the performance of database queries.

  • Indexing creates a data structure that allows for faster retrieval of data.

  • Indexes are created on one or more columns of a table.

  • Queries that use indexed columns can be executed faster.

  • Indexes can be clustered or non-clustered.

  • Clustered indexes determine the physical order of data in a table.

  • Non-clustered indexes create a separate structure to store the indexed data.

  • Examples of indexing include B-...read more

View 1 answer
right arrow

Q10. What is oops concepts

Ans.

OOPs concepts are the fundamental principles of object-oriented programming.

  • Encapsulation - binding data and functions together in a single unit

  • Inheritance - creating new classes from existing ones

  • Polymorphism - ability of objects to take on many forms

  • Abstraction - hiding implementation details from the user

  • Examples: class, object, inheritance, encapsulation, polymorphism, abstraction

Add your answer
right arrow

Q11. LRU cache explanation

Ans.

LRU cache is a data structure that stores the most recently used items and discards the least recently used items.

  • LRU stands for Least Recently Used

  • It has a fixed size and when the cache is full, the least recently used item is removed to make space for a new item

  • It uses a combination of a doubly linked list and a hash map to achieve O(1) time complexity for both insertion and deletion

  • Example: A web browser cache that stores the most recently visited web pages for faster acce...read more

Add your answer
right arrow

Q12. What is spring boot

Ans.

Spring Boot is a framework for building standalone, production-grade Spring-based applications.

  • Spring Boot simplifies the process of creating and deploying Spring-based applications.

  • It provides a set of pre-configured dependencies and an embedded web server.

  • It also offers features like auto-configuration, which reduces the need for manual configuration.

  • Spring Boot is widely used for building microservices and RESTful APIs.

  • Example: A Spring Boot application can be created usin...read more

Add your answer
right arrow

More about working at Delhivery

Back
Awards Leaf
AmbitionBox Logo
#20 Best Large Company - 2022
Awards Leaf
Awards Leaf
AmbitionBox Logo
#3 Best Internet/Product Company - 2022
Awards Leaf
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Delhivery Software Developer

based on 3 interviews
1 Interview rounds
Technical Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

Flipkart Logo
4.0
 • 81 Interview Questions
Cisco Logo
4.1
 • 50 Interview Questions
Goibibo Logo
4.3
 • 15 Interview Questions
View all
Recently Viewed
SALARIES
K12 Techno Services
SALARIES
Ola Electric Mobility
SALARIES
Bank of America Securities
SALARIES
Ola Electric Mobility
INTERVIEWS
Larsen & Toubro Limited
No Interviews
SALARIES
Ola Electric Mobility
SALARIES
Bank of America Securities
INTERVIEWS
Testbook.com
No Interviews
INTERVIEWS
Mahindra & Mahindra
No Interviews
SALARIES
Ola Electric Mobility
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
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