Found 59 Articles for Campus Interview

Top Kubernetes Interview questions

Aadyaa Srivastava
Updated on 27-Feb-2023 09:51:25

691 Views

The best orchestration technology nowadays is Kubernetes, which has become the industry buzzword. It draws a lot of seasoned employees looking to go up the corporate ladder. International businesses including Huawei, Pokémon, eBay, Yahoo Japan, SAP, Open AI, and Sound Cloud utilize Kubernetes on a daily basis. The market, however, is lacking in Kubernetes Certified experts. I assume you already are aware of these details, which led you to this post about Kubernetes Interview Questions. This article will help you learn about the most common interview questions. Describe Kubernetes An open-source container management platform called Kubernetes is in charge of ... Read More

Java Program to Convert the local Time to GMT

Aishwarya Naglot
Updated on 18-Jun-2025 16:23:01

3K+ Views

In this article, we will learn how to convert the local time to GMT (Greenwich Mean Time) in Java. We need this conversion when we want to standardize time across different time zones or when working with systems that require GMT. We will cover the following methods to convert local time to GMT: Using ZonedDateTime class Using Calendar Class Using Date Class Using ZonedDateTime Class ZonedDateTime class was introduced in Java 8, which is used for converting local time to GMT. We can use the ... Read More

Java program to display time in different country’s format

Aishwarya Naglot
Updated on 10-Jun-2025 14:47:26

656 Views

In this article, we will learn how to display the current date in different country formats using Java. We can import java.time package to work with the date and time API. The java.time package, along with the DateFormat and Locale classes, allows us to format the date according to various regions' standards. Displaying Date in Different Country Formats There are two or more ways to display the date in different country formats in Java: Using DateFormat Class Using LocalDate Class and DateTimeFormatter Let's explore each of these methods in detail. Using ... Read More

Java Program to Display Dates of Calendar Year in Different Format

Aishwarya Naglot
Updated on 10-Jun-2025 14:43:48

389 Views

In this article, we will understand how to display dates of a calendar year in different formats. Java has a built-in Date class, but it is recommended to use the java.time package, to work with the modern date and time API. The package includes many date and time classes. Following are the ways to display dates of a calendar year in different formats: Using DateFormat Class Using SimpleDateFormat Class Using LocalDate Class and DateTimeFormatter Using DateFormat Class The DateFormat class is part of the java.text package. ... Read More

Java Program to Iterate over ArrayList using Lambda Expression

Aishwarya Naglot
Updated on 10-Jun-2025 14:26:28

3K+ Views

The ArrayList class is a resizable array that can be found in java.util package. The difference between a built-in array and an ArrayList in Java is that the size of an array cannot be modified. Lambda Expression is a feature that was introduced in Java 8. It is useful when we use collections, such as ArrayList, Set, or Map, and we want to perform operations on the elements of these collections. In this article, we will learn how to iterate over an ArrayList using a lambda expression in Java. Iterating Over an ArrayList Using Lambda Expressions There are two main ... Read More

Java Program to Pass ArrayList as the function argument

Aishwarya Naglot
Updated on 18-Jun-2025 16:25:40

4K+ Views

The ArrayList is a resizable array, which is part of java.util package. The difference between a built-in array and an ArrayList in Java is that the size of an array cannot be modified. In this article, we will understand how to pass an ArrayList as a function argument. Following are the ways to pass an ArrayList as a function argument: Using Function Argument Using Return Type Using Function Argument We can pass an ArrayList as a function argument in Java. The function can take an ArrayList as a parameter and perform operations ... Read More

Java Program to Sort map by keys

Alshifa Hasnain
Updated on 17-Jan-2025 19:45:03

628 Views

In this article, we will learn to sort maps by keys in Java. In Java, the Map interface provides a collection of key-value pairs where each key is unique. Sorting a map by its keys can be useful when you want to order the elements based on the keys instead of their values. Sorting a Map in Java Java provides different ways to sort a map by keys. A TreeMap, a part of the java.util package is one of the easiest ways to sort a map. It stores the map entries in a natural order (ascending) based on the ... Read More

Java Program to Check if a set is the subset of another set

Aishwarya Naglot
Updated on 18-Jun-2025 16:27:32

1K+ Views

In this article, we will understand how to check if a Set is a subset of another set. A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are not allowed. Following are the ways to check if a set is a subset of another set: Using containsAll() Method Using Stream API Using containsAll() Method In Java, the set interface has a method called containsAll() that checks ... Read More

Java program to calculate the difference between two sets

Aishwarya Naglot
Updated on 18-Jun-2025 13:11:52

1K+ Views

A Set is a Collection that cannot contain duplicate elements (same as the mathematical set abstraction). The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited. Finding the difference between two sets means finding the elements that are not similar in both sets. For example, we have set A = {1, 2, 3} and set B = {2, 3, 4}. The difference between these two sets will be {1, 4} because 1 is not in set B and 4 is not in set A. In this article, we will learn how to ... Read More

Java program to detect loop in a LinkedList

Aishwarya Naglot
Updated on 18-Jun-2025 12:20:51

455 Views

What is a LinkedList? A Linked list is a sequence of data structures where each node contains two parts as follows - Data: The value or information stored in the node. Next: A reference (or pointer) to the next node in the sequence. Detecting a Loop in a LinkedList A loop or cycle means that the last node of a linked list is connected back to one of the nodes earlier in the list, creating a cycle. Or, the next pointer of a node points to itself. The following are the ways ... Read More

Advertisements