Add office photos
Engaged Employer

Ernst & Young

3.4
based on 10.8k Reviews
Video summary
Filter interviews by

20+ Sterling Check Interview Questions and Answers

Updated 15 Nov 2024
Popular Designations

Q1. Smallest Subarray With K Distinct Elements

Given an array A consisting of N integers, your task is to find the smallest subarray of A that contains exactly K distinct integers.

If multiple such subarrays exist,...read more

Ans.

Find the smallest subarray in an array with exactly K distinct elements.

  • Use a sliding window approach to keep track of the subarray with K distinct elements.

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

  • Update the window by expanding or shrinking based on the number of distinct elements.

  • Return the smallest subarray with K distinct elements and the smallest leftmost index.

Add your answer

Q2. HashMap Implementation Problem Statement

Your task is to design a data structure that efficiently stores a mapping of keys to values and performs operations in constant time.

Explanation:

1. INSERT(key, value):...read more
Ans.

Design a HashMap data structure with operations like INSERT, DELETE, SEARCH, GET, GET_SIZE, and IS_EMPTY.

  • Implement a hash table with efficient key-value mapping.

  • Ensure constant time complexity for operations.

  • Handle cases where key is not found or data structure is empty.

  • Example: INSERT('key1', 10), SEARCH('key1'), GET('key1'), DELETE('key1'), GET_SIZE(), IS_EMPTY()

Add your answer

Q3. Group Anagrams Together

Given an array/list of strings STR_LIST, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.

Example:...read more

Ans.

Group anagrams in a list of strings together and return each group as a list of strings.

  • Iterate through the list of strings and sort each string alphabetically to identify anagrams.

  • Use a hashmap to group anagrams together based on their sorted versions.

  • Return the values of the hashmap as the grouped anagrams.

Add your answer
Q4. Can you differentiate between ArrayList and Vector in Java?
Ans.

ArrayList is non-synchronized and Vector is synchronized in Java.

  • ArrayList is not synchronized, while Vector is synchronized.

  • ArrayList is faster than Vector.

  • Vector is thread-safe, while ArrayList is not.

  • Example: ArrayList<String> list = new ArrayList<>(); Vector<String> vector = new Vector<>();

Add your answer
Discover Sterling Check interview dos and don'ts from real experiences
Q5. What is the difference between HashSet and HashMap in Java?
Ans.

HashSet is a collection of unique elements, while HashMap is a key-value pair mapping.

  • HashSet does not allow duplicate elements, HashMap allows duplicate keys but not values.

  • HashSet uses a hash table to store elements, HashMap uses key-value pairs.

  • Example: HashSet<String> set = new HashSet<>(); HashMap<String, Integer> map = new HashMap<>();

Add your answer
Q6. Can you differentiate between HashMap and Hashtable?
Ans.

HashMap and Hashtable are both data structures in Java used to store key-value pairs, but Hashtable is synchronized while HashMap is not.

  • HashMap allows null values and one null key, while Hashtable does not allow null keys or values.

  • HashMap is not synchronized and is not thread-safe, while Hashtable is synchronized and thread-safe.

  • HashMap is faster than Hashtable for most operations, as it is not synchronized.

  • HashMap is part of the Java Collections Framework, while Hashtable ...read more

Add your answer
Are these interview questions helpful?
Q7. Can you explain the @RestController annotation in Spring Boot?
Ans.

The @RestController annotation in Spring Boot is used to define a class as a RESTful controller.

  • Used to create RESTful web services in Spring Boot

  • Combines @Controller and @ResponseBody annotations

  • Eliminates the need for @ResponseBody annotation on each method

  • Returns data directly in the response body as JSON or XML

Add your answer
Q8. Why are Java Strings immutable in nature?
Ans.

Java Strings are immutable to ensure thread safety, security, and optimization.

  • Immutable strings prevent accidental changes, ensuring data integrity.

  • String pooling allows for memory optimization by reusing common strings.

  • Thread safety is guaranteed as strings cannot be modified concurrently.

  • Security is enhanced as sensitive information cannot be altered once set.

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Write a Java 8 program to iterate through a Stream using the forEach method.
Ans.

Java 8 program to iterate through a Stream using forEach method

  • Create a Stream of elements using Stream.of() or any other method

  • Use the forEach() method to iterate through the Stream and perform an action on each element

  • Example: Stream.of(1, 2, 3, 4, 5).forEach(System.out::println);

Add your answer
Q10. What are a few features of Spring Boot?
Ans.

Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured setups.

  • Auto-configuration: Spring Boot automatically configures the application based on dependencies added to the project.

  • Embedded server: Spring Boot comes with an embedded Tomcat, Jetty, or Undertow server for easy deployment.

  • Actuator: Provides production-ready features like monitoring, metrics, and health checks for the application.

Add your answer
Q11. What do you know about the JIT compiler?
Ans.

JIT compiler stands for Just-In-Time compiler, which compiles code during runtime for improved performance.

  • JIT compiler translates bytecode into machine code at runtime

  • It helps in optimizing performance by compiling frequently executed code

  • Examples include Java HotSpot JIT compiler and .NET JIT compiler

Add your answer
Q12. How does MVC work in Spring?
Ans.

MVC in Spring is a 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 rendering the user interface based on the data from the Model.

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

  • Spring MVC provides annotations like @Controller, @RequestMapping, and @ModelAttribute to implem...read more

Add your answer

Q13. How do you detect and handle memory leak in node js

Ans.

Detecting and handling memory leaks in Node.js involves using tools like heap snapshots and monitoring memory usage.

  • Use tools like heap snapshots to identify memory leaks

  • Monitor memory usage over time to detect abnormal increases

  • Implement proper garbage collection strategies to free up memory

  • Avoid creating unnecessary closures or retaining references to objects

Add your answer
Q14. How does Spring Boot work?
Ans.

Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured settings and tools.

  • Spring Boot eliminates the need for manual configuration by providing defaults for most settings.

  • It includes embedded servers like Tomcat, Jetty, or Undertow, making it easy to run applications as standalone JAR files.

  • Spring Boot also offers production-ready features like metrics, health checks, and externalized configuration.

  • It allows developers to q...read more

Add your answer
Q15. What are Java 8 streams?
Ans.

Java 8 streams are a sequence of elements that support functional-style operations.

  • Streams allow for processing sequences of elements in a functional way.

  • They can be created from various data sources like collections, arrays, or I/O channels.

  • Operations like filter, map, reduce, and collect can be performed on streams.

  • Streams are lazy, meaning intermediate operations are only executed when a terminal operation is called.

  • Example: List<String> names = Arrays.asList("Alice", "Bob...read more

Add your answer
Q16. What is dependency injection?
Ans.

Dependency injection is a design pattern in which components are given their dependencies rather than creating them internally.

  • Dependency injection helps in achieving loose coupling between classes.

  • It allows for easier testing by providing mock dependencies.

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

Add your answer

Q17. What is denormalization and explanation of projects

Ans.

Denormalization is the process of adding redundant data to a database to improve read performance.

  • Denormalization involves duplicating data from normalized tables into a single denormalized table.

  • It can improve query performance by reducing the need for joins and aggregations.

  • Denormalization is often used in data warehousing and reporting applications.

  • Examples of denormalization include creating summary tables or adding calculated fields to a table.

Add your answer

Q18. Write and explain Lambda function in Python

Ans.

Lambda function is a small anonymous function in Python that can have any number of arguments, but can only have one expression.

  • Lambda functions are defined using the lambda keyword.

  • They are commonly used with built-in functions like filter(), map() and reduce().

  • Lambda functions can be used to create simple one-line functions.

  • They are often used as arguments to higher-order functions.

  • Lambda functions can be assigned to variables and used like any other function.

Add your answer

Q19. Data Cleansing and ways to analyse data

Ans.

Data cleansing involves identifying and correcting errors in data to improve its quality. Ways to analyze data include using statistical methods, data visualization, and machine learning algorithms.

  • Identify and remove duplicate records

  • Standardize data formats and values

  • Fill in missing values using imputation techniques

  • Use data profiling to understand data quality issues

  • Apply data validation rules to ensure accuracy

  • Utilize data visualization tools for exploratory analysis

  • Imple...read more

Add your answer

Q20. what is cloud computing

Ans.

Cloud computing is the delivery of computing services over the internet, including storage, databases, networking, software, and more.

  • Allows users to access and store data and applications on remote servers instead of on their local devices

  • Provides scalability, flexibility, and cost-effectiveness for businesses

  • Examples include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform

Add your answer

Q21. Explain Hadoop architecture

Ans.

Hadoop architecture is a distributed computing framework that allows for the processing of large data sets.

  • Hadoop consists of two main components: Hadoop Distributed File System (HDFS) and MapReduce.

  • HDFS is responsible for storing data across multiple nodes in a cluster.

  • MapReduce is responsible for processing the data stored in HDFS.

  • Hadoop also includes other components such as YARN, which manages resources in the cluster, and Hadoop Common, which provides libraries and utili...read more

Add your answer

Q22. Library for graphs in R

Ans.

ggplot2 is a popular library for creating graphs in R.

  • ggplot2 is a powerful and flexible library for creating a wide range of graphs in R.

  • It allows for customization of almost every aspect of the graph.

  • Other popular graphing libraries in R include lattice and plotly.

Add your answer

Q23. What is data privacy

Ans.

Data privacy refers to the protection of personal information from unauthorized access or disclosure.

  • Data privacy involves controlling who has access to personal information

  • It includes ensuring that data is securely stored and transmitted

  • Examples include encryption, access controls, and data anonymization

Add your answer

Q24. Explain AWS Lambda

Ans.

AWS Lambda is a serverless computing service that allows you to run code without provisioning or managing servers.

  • AWS Lambda is event-driven and can be triggered by various AWS services or external events

  • It supports multiple programming languages including Node.js, Python, Java, and C#

  • You only pay for the compute time that you consume, with no upfront costs or minimum fees

  • Lambda functions can be used for a variety of tasks such as data processing, image resizing, and chatbot ...read more

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

Interview Process at Sterling Check

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

Top Technology Consultant Interview Questions from Similar Companies

3.8
 • 21 Interview Questions
3.4
 • 11 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