Filter interviews by
Interview had few dsa questions, reverse string , max array
Top trending discussions
I applied via Naukri.com
I appeared for an interview in Jun 2021.
Round duration - 60 Minutes
Round difficulty - Easy
Coding round on
1. Array
2. linked list
Given an array ARR
of N integers and an integer S, determine if there exists a contiguous subarray within the array with a sum equal to S. If such a subarray exis...
Given an array of integers, find a subarray with a given sum S.
Iterate through the array while keeping track of the sum of elements encountered so far.
Use a hashmap to store the cumulative sum and its corresponding index.
If the current sum minus the target sum is found in the hashmap, a subarray with the target sum exists.
Return the start and end indices of the subarray if found, otherwise return [-1, -1].
Given a singly linked list of integers, return the head of the reversed linked list.
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed link...
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node.
Use three pointers to keep track of the current, previous, and next nodes.
Update the head of the reversed linked list as the last node encountered.
Time complexity: O(N), Space complexity: O(1).
Round duration - 30 Minutes
Round difficulty - Medium
HR Round
Tip 1 : Stay smiling
Tip 2 : Be confident
Tip 3 : Follow STAR Approach
Tip 1 : Bold important things
Tip 2 : Keep it short and crisp
Tip 3 : Have some projects on resume.
I appeared for an interview before Dec 2020.
Round duration - 90 Minutes
Round difficulty - Medium
2 coding questions and 20 mcq
You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:
Find the minimum time required to rot all fresh oranges in a grid.
Use Breadth First Search (BFS) to simulate the rotting process.
Track the time taken to rot all oranges and return -1 if any fresh oranges remain.
Handle edge cases like no fresh oranges or all oranges already rotten.
Consider using a queue to efficiently process adjacent oranges.
Ensure to update the grid with the new state of oranges after each second.
Given a natural number N
, return the sum of all its proper divisors.
A proper divisor of Y
is defined as a number X
such that X < Y
and Y % X = 0
.
T...
Calculate the sum of proper divisors of a given natural number.
Iterate from 1 to sqrt(N) and check for divisors
If a divisor is found, add it to the sum and also add N/divisor if it is not the same as divisor
Return the sum as the result
Round duration - 45 Minutes
Round difficulty - Medium
Technical interview
Given an array ARR
consisting of non-negative integers, rearrange the numbers to form the largest possible number. The digits within each number cannot be changed.
Rearrange the array elements to form the largest possible number by concatenating them.
Sort the array elements in a custom comparator function to get the largest number.
Convert the sorted array elements to strings and concatenate them to form the final number.
Handle cases where the numbers have the same prefix by comparing the concatenated forms.
Tip 1 : Be clear about whatever you have mentioned in resume, don't mention buzz words, because interviewer can go in depth
Tip 2 : Along with DS and Algo, if you have 3-4 months experience or internship experience, then be ready to answer scenario based technical questions like scaling the application that you developed and design concepts that can be used for improving
Tip 3 : Last but most important tip is to be calm through out the whole process ,don't loose hope if any round didn't go well ,if you have explained your thought process there is still chance to procees to next round so keep preparating for next rounds.
Tip 1 : Keep it one page resume and mention keywords which align with your technical and personal competencies.
Tip 2 : Mention 3-4 projects in the order that , project which you can explain best should be at top,then the next, and so on.
I applied via Naukri.com and was interviewed in Aug 2023. There were 2 interview rounds.
Annotations used in Spring framework for dependency injection
Used in Spring framework to inject dependencies
Qualifier is used to specify which bean to autowire when multiple beans of the same type exist
Autowired is used to automatically inject the dependency
The @Data annotation is used in Java to declare a class as a data class, while the @Value annotation is used in Spring to create immutable objects.
The @Data annotation in Java is used to generate getters, setters, toString, equals, and hashCode methods for a class.
The @Value annotation in Spring is used to create immutable objects with final fields that are initialized through constructor injection.
Both annotations hel...
Annotation used in Spring framework to indicate that a class declares one or more @Bean methods
Used in Spring framework to define configuration classes
Indicates that a class should be considered as a source of bean definitions
Helps Spring to understand the configuration and create beans accordingly
To read values from application properties file, use a properties file reader in the programming language being used.
Use a properties file reader class in the programming language being used (e.g. Properties class in Java).
Load the properties file using the reader class.
Access the values using keys specified in the properties file.
Map applies a function to each element in a collection and returns a new collection. FlatMap applies a function that returns a collection for each element and flattens the result into a single collection.
Map transforms each element of a collection using a function and returns a new collection of the same size.
FlatMap transforms each element of a collection using a function that returns a collection, then flattens the r...
Array list stores elements in contiguous memory locations, while linked list stores elements in nodes with pointers to the next node.
Array list allows fast access to elements using index, while linked list allows for fast insertion and deletion of elements.
Array list is ideal for scenarios where random access is required, while linked list is suitable for scenarios where frequent insertion and deletion operations are n...
Immutable class is a class whose instances cannot be modified after creation.
Immutable class instances have all fields as final and private.
Immutable classes have no setter methods, only getter methods.
Examples of immutable classes in Java are String, Integer, and LocalDate.
Sample code using @functional annotation
Use @FunctionalInterface annotation to declare a functional interface in Java
Functional interfaces have exactly one abstract method
Example: @FunctionalInterface interface MyFunctionalInterface { void myMethod(); }
Method reference is a shorthand syntax for lambda expressions to call a method.
Method reference can be used to refer to static methods, instance methods, and constructors.
It helps in improving code readability and conciseness.
Example: list.forEach(System.out::println) is equivalent to list.forEach(item -> System.out.println(item)).
Intermediate operations in Java 8 are used to process the stream elements and produce a new stream as output.
Intermediate operations are lazy and do not start processing the stream until a terminal operation is invoked.
Examples of intermediate operations include filter, map, sorted, distinct, limit, and skip.
Intermediate operations can be chained together to form a pipeline of operations on a stream.
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and the new date and time API.
Lambda expressions allow you to write code in a more concise and readable way.
Functional interfaces provide a way to define interfaces with a single abstract method.
Streams allow for processing sequences of elements in a functional style.
The new date and time API provides improved date and
Code to find pairs in array list with sum 8
Iterate through array and check if pair sum is 8
Use a hashmap to store elements and their complements
Time complexity O(n)
Static class is used to create classes that cannot be instantiated and can only have static members.
Static class cannot be instantiated, meaning you cannot create an object of a static class.
Static class can only have static members such as static fields, methods, properties, and events.
Static classes are commonly used for utility classes where all members are static and do not require an instance to be accessed.
Code to print even numbers and their squares in Java8
Use Java8 Stream API to generate even numbers
Map each even number to its square using map() function
Print the even numbers and their squares using forEach() function
To communicate two APIs in Spring Boot, you can use RestTemplate or WebClient to make HTTP requests.
Use RestTemplate to make synchronous HTTP requests between APIs
Use WebClient to make asynchronous HTTP requests between APIs
Implement error handling and exception handling for robust communication
Consider using Feign client for declarative REST client
Ensure proper authentication and authorization mechanisms are in place
RestController and Controller annotations are used in Spring framework to define classes as controllers for handling HTTP requests.
RestController annotation is used to define a class as a RESTful web service controller, which returns data in JSON or XML format.
Controller annotation is used to define a class as a traditional Spring MVC controller, which returns a view to the client.
Both annotations are used to handle HT...
Parallel stream is a feature in Java that allows processing elements of a stream concurrently.
Parallel stream can be created from a regular stream using parallel() method.
It utilizes multiple threads to process elements in parallel, improving performance for large datasets.
However, parallel stream may not always be faster than sequential stream due to overhead of managing multiple threads.
Example: List
Streams in Java 8 are sequences of elements that support functional-style operations.
Streams allow for processing sequences of elements in a functional way
They can be created from collections, arrays, or I/O resources
Common operations on streams include map, filter, reduce, and collect
A collection is a group of related objects or data items that are stored together.
Collections can be used to store and manipulate multiple items of the same type.
Examples of collections include arrays, lists, sets, and maps.
Collections provide methods for adding, removing, and accessing items in the group.
Singleton is a design pattern that restricts the instantiation of a class to one object.
Ensures a class has only one instance and provides a global point of access to it
Commonly used in scenarios where only a single instance of a class is needed, such as database connections or configuration settings
Implemented by creating a static method that returns the same instance of the class every time it is called
I applied via Naukri.com and was interviewed in Aug 2023. There were 3 interview rounds.
Questions were asked on the language along with program logics
I applied via Campus Placement and was interviewed in Sep 2020. There were 3 interview rounds.
I am familiar with a wide range of technologies used in software development.
Java
Python
C++
JavaScript
HTML/CSS
SQL
Git
Linux
RESTful APIs
Agile methodologies
OOPs concepts in Java include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods together in a class.
Inheritance: Creating new classes from existing ones, inheriting their properties and behaviors.
Polymorphism: Objects of different classes can be treated as objects of a common superclass.
Abstraction: Hiding complex implementation details and providing a simplified interfa
Abstraction can be achieved through interfaces, abstract classes, and encapsulation.
Using interfaces to define a set of methods that a class must implement
Using abstract classes to provide a base implementation that can be extended by subclasses
Encapsulating implementation details to hide complexity and provide a simpler interface
Using design patterns such as Factory and Strategy to abstract away implementation details
Class is a blueprint for creating objects while interface defines a contract for implementing classes.
Class is a template for creating objects with properties and methods.
Interface is a contract that defines a set of methods and properties that a class must implement.
Object is an instance of a class that has its own set of properties and methods.
Function instance is a reference to a function that can be called with arg...
Access modifiers control the visibility and accessibility of class members.
Access modifiers include public, private, protected, and internal.
Public members can be accessed from anywhere.
Private members can only be accessed within the same class.
Protected members can be accessed within the same class and its subclasses.
Internal members can be accessed within the same assembly.
Access modifiers help enforce encapsulation ...
Cloud refers to the delivery of computing services over the internet.
Cloud computing allows users to access data and applications from anywhere with an internet connection.
Cloud services can be categorized into three main types: Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).
Cloud providers include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.
...
There are multiple ways to achieve tasks on AWS depending on the specific task.
Using AWS Management Console
Using AWS CLI
Using AWS SDKs
Using AWS CloudFormation
Using AWS Elastic Beanstalk
Using AWS Lambda
Using AWS Step Functions
Using AWS Batch
I applied via Campus Placement and was interviewed in Sep 2021. There were 3 interview rounds.
based on 1 interview
Interview experience
Assistant Manager
3
salaries
| ₹5 L/yr - ₹7.5 L/yr |
Service Engineer
3
salaries
| ₹2.6 L/yr - ₹3.5 L/yr |
Technician
3
salaries
| ₹1.5 L/yr - ₹2.5 L/yr |
Senior Executive Procurement
3
salaries
| ₹4 L/yr - ₹4.2 L/yr |
TCS
Accenture
Wipro
Cognizant