Add office photos
Premium Employer

Deloitte

3.8
based on 17.7k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

40+ Dr. Reddy's Interview Questions and Answers

Updated 6 Jan 2025
Popular Designations

Q1. Find K'th Character of Decrypted String

You are given an encrypted string where repeated substrings are represented by the substring followed by its count. Your task is to find the K'th character of the decrypt...read more

Ans.

Given an encrypted string with repeated substrings represented by counts, find the K'th character of the decrypted string.

  • Parse the encrypted string to extract substrings and their counts

  • Iterate through the substrings and counts to build the decrypted string

  • Track the position in the decrypted string to find the K'th character

View 1 answer

Q2. Pair Sum Problem Statement

You are provided with an array ARR consisting of N distinct integers in ascending order and an integer TARGET. Your objective is to count all the distinct pairs in ARR whose sum equal...read more

Ans.

Count distinct pairs in an array whose sum equals a given target.

  • Use two pointers approach to iterate through the array and find pairs with sum equal to target.

  • Keep track of visited pairs to avoid counting duplicates.

  • Return -1 if no such pair exists with the given target.

View 1 answer

Q3. Sort 0 1 2 Problem Statement

Given an integer array arr of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.

Input:

The first line contains an integer 'T' representing the number of...read more
Ans.

Sort an array of 0s, 1s, and 2s in linear time complexity.

  • Use three pointers to keep track of the positions of 0s, 1s, and 2s in the array.

  • Iterate through the array and swap elements based on the values encountered.

  • Maintain left pointer for 0s, right pointer for 2s, and current pointer for traversal.

  • Example: If current element is 0, swap it with element at left pointer and increment both pointers.

View 1 answer

Q4. Cycle Detection in Undirected Graph Problem Statement

You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determine whe...read more

Ans.

Detect if an undirected graph contains a cycle.

  • Use Depth First Search (DFS) to traverse the graph and detect cycles.

  • Maintain a visited array to keep track of visited vertices.

  • If a visited vertex is encountered again during DFS, a cycle exists.

  • Check for back edges while traversing the graph.

  • Consider disconnected graphs as well.

Add your answer
Discover Dr. Reddy's interview dos and don'ts from real experiences

Q5. Next Smaller Palindrome Problem Statement

You are given a palindrome number represented as a string S. Your task is to find the largest palindrome number that is strictly less than S.

Example:

Input:
T = 2
S1 = ...read more
Ans.

Given a palindrome number represented as a string, find the largest palindrome number that is strictly less than the given number.

  • Iterate from the middle towards the start and end of the string to find the next smaller palindrome.

  • If the number is odd in length, simply mirror the left half to the right half to get the next smaller palindrome.

  • If the number is even in length, decrement the middle digit and mirror the left half to the right half to get the next smaller palindrome...read more

Add your answer

Q6. Longest Common Subsequence Problem Statement

Given two strings STR1 and STR2, determine the length of their longest common subsequence.

A subsequence is a sequence that can be derived from another sequence by d...read more

Ans.

The problem involves finding the length of the longest common subsequence between two given strings.

  • Use dynamic programming to solve this problem efficiently.

  • Create a 2D array to store the lengths of common subsequences of substrings.

  • Iterate through the strings to fill the array and find the length of the longest common subsequence.

  • Example: For input STR1 = 'abcde' and STR2 = 'ace', the longest common subsequence is 'ace' with a length of 3.

Add your answer
Are these interview questions helpful?

Q7. Boundary Traversal of a Binary Tree

Given a binary tree of integers, your task is to output the boundary nodes of this binary tree in Anti-Clockwise order, starting from the root node.

Explanation:

The boundary...read more

Ans.

Output the boundary nodes of a binary tree in Anti-Clockwise order, starting from the root node.

  • Traverse the left boundary nodes in top-down order

  • Traverse the leaf nodes from left to right

  • Traverse the right boundary nodes in bottom-up order

  • Combine the above traversals to get the boundary nodes in Anti-Clockwise order

Add your answer

Q8. Search an Element in a Sorted Array

Given a sorted array 'A' of 'N' integers, determine whether a number 'X' exists within this array for a series of queries. For each query, print 1 if 'X' exists in the array,...read more

Ans.

Search for a number in a sorted array and determine its existence for multiple queries.

  • Use binary search algorithm to efficiently search for each query integer in the sorted array.

  • For each query integer 'X', check if it exists in the array 'A' and output 1 if found, 0 otherwise.

  • Ensure the array 'A' is sorted in non-decreasing order to apply binary search effectively.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. What type of work does the Deloitte company engage in?

Ans.

Deloitte is a multinational professional services network that provides consulting, audit, tax, and advisory services.

  • Deloitte engages in consulting services for various industries

  • They provide audit and assurance services to ensure financial accuracy

  • The company offers tax services to help clients navigate complex tax regulations

  • Deloitte also provides advisory services to help businesses improve performance and manage risks

Add your answer

Q10. What synchronous and asynchronous means??

Ans.

Synchronous means happening at the same time, while asynchronous means not happening at the same time.

  • Synchronous operations occur in real-time, while asynchronous operations can be delayed or queued.

  • Synchronous operations block the program until they are completed, while asynchronous operations allow the program to continue running.

  • Examples of synchronous operations include function calls and loops, while examples of asynchronous operations include callbacks and promises.

Add your answer

Q11. What is diff between action controller and api action controller

Ans.

Action controller is for web applications, API action controller is for APIs

  • Action controller is used for handling web requests in a traditional web application

  • API action controller is used for handling API requests in a RESTful API

  • API action controller typically returns JSON responses, while action controller may return HTML responses

  • API action controller often has different authentication and authorization mechanisms compared to action controller

Add your answer

Q12. What type of work does Deloitte engage in?

Ans.

Deloitte engages in consulting, audit, tax, and advisory services for clients in various industries.

  • Consulting services for businesses

  • Audit services for financial statements

  • Tax services for individuals and corporations

  • Advisory services for strategy and operations

  • Industry-specific services such as healthcare, technology, and financial services

Add your answer

Q13. What is Lambada function, does lambda suitable for long run

Ans.

Lambda function is an anonymous function in programming that can be used for short, simple tasks.

  • Lambda functions are commonly used in functional programming languages like Python.

  • They are often used for tasks that require a quick, one-time function without the need to define a separate function.

  • Lambda functions can be used as arguments for higher-order functions like map, filter, and reduce.

  • They are not suitable for long, complex tasks as they can make the code harder to rea...read more

Add your answer

Q14. What is the use of bean factory

Ans.

Bean factory is used for creating and managing instances of beans in Spring framework.

  • Bean factory is responsible for creating and managing instances of beans defined in the Spring configuration file.

  • It provides a way to decouple the configuration and specification of dependencies from the actual application code.

  • Bean factory supports different scopes of beans such as singleton, prototype, request, session, etc.

  • It also supports dependency injection and inversion of control.

  • Ex...read more

Add your answer

Q15. what is interface,abstraction,polymorphism?

Ans.

Interface, abstraction, and polymorphism are key concepts in object-oriented programming.

  • Interface: A contract that defines a set of methods that a class must implement.

  • Abstraction: The process of hiding the implementation details and exposing only the essential features of an object.

  • Polymorphism: The ability of an object to take on many forms, allowing objects of different classes to be treated as objects of a common superclass.

Add your answer

Q16. what is mvc lify cyle with example?

Ans.

MVC lifecycle is the sequence of events that occur during the execution of a Model-View-Controller application.

  • 1. User interacts with the View triggering a request

  • 2. Controller receives the request and processes it

  • 3. Controller updates the Model with new data

  • 4. Model notifies the View about the changes

  • 5. View retrieves the updated data from the Model

  • 6. View renders the updated data for the user

Add your answer

Q17. what is virtual and override keyword?

Ans.

The virtual keyword is used to allow a method to be overridden in a derived class. The override keyword is used to indicate that a method is intended to override a base class method.

  • The virtual keyword is used in the base class to define a method that can be overridden in a derived class.

  • The override keyword is used in the derived class to indicate that a method is intended to override a base class method.

  • The virtual keyword is used to provide a default implementation of a me...read more

Add your answer

Q18. tell me difference between treemap and hashmap

Ans.

HashMap is an unordered collection while TreeMap is a sorted collection based on keys.

  • HashMap uses hashing to store key-value pairs, while TreeMap uses a red-black tree for sorting keys.

  • HashMap allows one null key and multiple null values, while TreeMap does not allow null keys but allows null values.

  • HashMap is generally faster for lookups and insertions, while TreeMap is useful when you need to iterate over keys in sorted order.

Add your answer

Q19. When to use CTE and temp table.

Ans.

CTE and temp table usage in SQL

  • Use CTE for recursive queries and complex subqueries

  • Use temp tables for large data sets and complex queries

  • CTE is more efficient for small data sets

  • Temp tables can be indexed for faster performance

  • Consider the scope and lifespan of the data when choosing between CTE and temp table

Add your answer

Q20. What is managed code and unmanaged code

Ans.

Managed code is code that is executed by the Common Language Runtime (CLR) while unmanaged code is code that is executed directly by the operating system.

  • Managed code is written in high-level languages like C#, VB.NET, and is compiled to Intermediate Language (IL) which is executed by the CLR.

  • Unmanaged code is written in languages like C, C++, and is compiled directly to machine code which is executed by the operating system.

  • Managed code provides automatic memory management, ...read more

Add your answer

Q21. What are diff design patterns in sql

Ans.

Design patterns in SQL are reusable solutions to common problems encountered in database design and development.

  • Singleton Pattern: Ensures a class has only one instance and provides a global point of access to it.

  • Factory Pattern: Creates objects without specifying the exact class of object that will be created.

  • Repository Pattern: Separates the logic that retrieves data from a data source from the business logic that acts on the data.

  • Decorator Pattern: Allows behavior to be ad...read more

Add your answer

Q22. Tell about aws s3, uses, how to copy s3

Ans.

AWS S3 is a cloud storage service provided by Amazon Web Services for storing and retrieving data.

  • AWS S3 is used for storing and retrieving any amount of data at any time.

  • It is commonly used for backup and recovery, archiving, data lakes, and big data analytics.

  • To copy data in S3, you can use the AWS Management Console, AWS CLI, or AWS SDKs.

  • For example, you can use the 'aws s3 cp' command in the AWS CLI to copy files between S3 buckets or from local storage to S3.

Add your answer

Q23. What is dependency injection

Ans.

Dependency injection is a design pattern that allows objects to receive dependencies rather than creating them.

  • It helps to decouple the code and makes it more testable and maintainable.

  • It allows for easier swapping of dependencies without changing the code.

  • There are three types of dependency injection: constructor injection, setter injection, and interface injection.

  • Example: Instead of creating a database connection object inside a class, we can inject it as a dependency from...read more

Add your answer

Q24. What is MVC and explain its pattern

Ans.

MVC is a software design pattern that separates an application into three main components: Model, View, and Controller.

  • Model represents the data and business logic of the application

  • View is responsible for displaying the data to the user

  • Controller acts as an intermediary between Model and View, handling user input and updating the Model accordingly

  • MVC helps in achieving separation of concerns, making the code more organized and easier to maintain

Add your answer

Q25. What is routing in MVC and Angular

Ans.

Routing in MVC and Angular is the mechanism of mapping URLs to controller actions or components.

  • In MVC, routing is used to define the URL patterns and map them to specific controller actions.

  • In Angular, routing is used to navigate between different components based on the URL.

  • Routing in MVC is typically configured in the RouteConfig class, while in Angular it is configured in the RouterModule.

  • Example in MVC: routes.MapRoute('Default', '{controller}/{action}/{id}', new { contr...read more

Add your answer

Q26. what is const and readonly ?

Ans.

const and readonly are keywords used in programming to define variables that cannot be modified.

  • const is used to declare a constant variable that cannot be changed after initialization

  • readonly is used to declare a variable that can only be assigned a value at the time of declaration or in the constructor

  • const variables are implicitly static and must be initialized with a constant value

  • readonly variables can have different values in different instances of a class

Add your answer

Q27. What are different access modifiers

Ans.

Access modifiers in programming define the scope of a class, method, or variable.

  • Public - accessible from any other class

  • Private - accessible only within the same class

  • Protected - accessible within the same package and subclasses

  • Default (no modifier) - accessible only within the same package

Add your answer

Q28. Why string is unmutable

Ans.

Strings are immutable in order to ensure data integrity and security.

  • Immutable strings prevent accidental changes to data

  • Enhances security by preventing data tampering

  • Allows for efficient memory management

Add your answer

Q29. What is connection pooling

Ans.

Connection pooling is a technique used to manage a pool of database connections to improve performance and efficiency.

  • Connection pooling helps reduce the overhead of opening and closing database connections for each request

  • It allows multiple clients to reuse a pre-created set of connections to the database

  • Connection pooling can help improve the scalability and performance of applications that require frequent database access

Add your answer

Q30. sort array without using sorting logic

Ans.

Use custom logic to rearrange array elements without traditional sorting algorithms

  • Create a custom logic to rearrange the array elements based on specific criteria

  • Use loops and conditional statements to compare and swap elements

  • Consider using techniques like bubble sort or insertion sort without directly implementing them

Add your answer

Q31. Sql Queries with 2nd greatest emp salary

Ans.

Use SQL query to find the employee with the second highest salary.

  • Use the ORDER BY clause to sort the salaries in descending order.

  • Use the LIMIT clause to retrieve the second row after skipping the first row.

Add your answer

Q32. Diff between array and arraylist

Ans.

Array is a fixed-size data structure while ArrayList is a dynamic-size data structure in Java.

  • Array is a fixed-size collection of elements of the same data type.

  • ArrayList is a resizable collection that can grow or shrink in size dynamically.

  • Arrays can store primitive data types and objects, while ArrayList can only store objects.

  • Arrays use square brackets [] for declaration, while ArrayList is a class in Java's collection framework.

  • Example: String[] names = new String[5]; Arr...read more

Add your answer

Q33. Diff between string and stringbuilder

Ans.

String is immutable, while StringBuilder is mutable and more efficient for concatenating strings.

  • String is immutable, meaning once created, it cannot be changed. StringBuilder is mutable and allows for modifications.

  • String concatenation in a loop using String can be inefficient due to creating new objects each time. StringBuilder is more efficient for this purpose.

  • String has a fixed length, while StringBuilder can dynamically adjust its length as needed.

  • Example: String str = ...read more

Add your answer

Q34. Tell about inheritance

Ans.

Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.

  • Allows for code reusability by creating a new class based on an existing class

  • Derived class (subclass) inherits attributes and methods from a base class (superclass)

  • Supports the 'is-a' relationship, where a subclass is a specialized version of a superclass

  • Can have multiple levels of inheritance, creating a hierarchy of classes

Add your answer

Q35. Dependency injection in .net core

Ans.

Dependency injection in .NET Core allows for loosely coupled components and easier testing.

  • In .NET Core, dependency injection is built-in and can be configured in the ConfigureServices method of the Startup class.

  • Services are registered in the ConfigureServices method using the IServiceCollection interface.

  • Dependencies are injected into classes using constructor injection or property injection.

  • Example: services.AddScoped();

  • Example: public class MyClass { private readonly IMyS...read more

Add your answer

Q36. What is polymorphism

Ans.

Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.

  • 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: Inheritance in object-oriented programming languages like Java allows for polymorphism.

Add your answer

Q37. What is abstraction

Ans.

Abstraction is the concept of hiding complex details and showing only the essential features of an object or system.

  • Abstraction allows developers to focus on what an object does rather than how it does it

  • It helps in reducing complexity and improving efficiency in software development

  • For example, in object-oriented programming, abstract classes and interfaces are used to define common behaviors without specifying implementation details

Add your answer

Q38. Commandbuilder vs command

Ans.

CommandBuilder is a class used to dynamically create SQL commands, while Command is a pre-defined SQL command.

  • CommandBuilder is used to construct SQL commands at runtime based on user input or conditions.

  • Command is a pre-defined SQL command that is executed as is.

  • CommandBuilder is more flexible and allows for dynamic SQL generation.

  • Command is static and does not change during runtime.

  • Example: CommandBuilder can be used to construct a SELECT query with different WHERE clauses ...read more

Add your answer

Q39. Tell us one weakness

Ans.

One weakness is that I tend to get too focused on details, sometimes losing sight of the bigger picture.

  • I tend to spend too much time on perfecting small details

  • I sometimes struggle with prioritizing tasks and can get overwhelmed by the amount of work

  • I am working on improving my time management skills to avoid getting too caught up in minor details

Add your answer

Q40. Whats is middleware

Ans.

Middleware is software that acts as a bridge between different applications or components, allowing them to communicate and work together.

  • Middleware facilitates communication between different software components

  • It can handle tasks such as data transformation, security, and routing

  • Examples include message brokers like RabbitMQ, API gateways like Kong, and web servers like Nginx

Add your answer

Q41. What is Linked List

Ans.

A linked list is a linear data structure where elements are stored in nodes that have a reference to the next node in the sequence.

  • Consists of nodes linked together by pointers or references

  • Can be singly linked (each node points to the next) or doubly linked (each node points to the next and previous)

  • Allows for dynamic size and efficient insertion/deletion operations

  • Example: Singly linked list: 1 -> 2 -> 3 -> 4 -> null

Add your answer

Q42. What is Heap in DS

Ans.

Heap is a specialized tree-based data structure where the root node is either the maximum or minimum value in the tree.

  • Heap is used to implement priority queues.

  • There are two types of heaps: max heap (root node is the maximum value) and min heap (root node is the minimum value).

  • Insertion and deletion operations in a heap have time complexity of O(log n).

Add your answer

Q43. Lwc lifecycle explanation

Ans.

LWC lifecycle explanation

  • LWC lifecycle consists of creation, rendering, updating, and destruction phases

  • Creation phase includes constructor, connectedCallback, and renderedCallback

  • Rendering phase involves updating the DOM based on data changes

  • Updating phase includes setter methods and rerendering components

  • Destruction phase involves disconnectedCallback and removing the component from the DOM

Add your answer

Q44. MiddleWare in ASP.NET core

Ans.

MiddleWare in ASP.NET Core is a software component that handles HTTP requests and responses.

  • Middleware is a pipeline of components that process HTTP requests and responses in ASP.NET Core.

  • Middleware can be used for logging, authentication, authorization, error handling, etc.

  • Middleware is added to the application pipeline using the 'UseMiddleware' method in the 'Configure' method of Startup class.

Add your answer

Q45. Existing project

Ans.

The existing project is a web application for managing inventory and sales.

  • The project uses React for the front-end and Node.js for the back-end.

  • It integrates with a MySQL database to store product information and sales data.

  • The application includes features such as user authentication, product search, and sales reporting.

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

Interview Process at Dr. Reddy's

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

Top Software Developer Interview Questions from Similar Companies

3.7
 • 113 Interview Questions
3.8
 • 71 Interview Questions
4.2
 • 26 Interview Questions
4.7
 • 15 Interview Questions
3.9
 • 13 Interview Questions
3.6
 • 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

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