3 Questions from My Interview Experience at Infogain

Quesstion1: Generating All Permutations of a String in Java. Problem Statement Given an input string, generate all possible permutations of the string. For example, if the input string is “abc”, the output should be: Solution: Question 2: Can you explain to me String Boot features, real-time features, and how you have implemented them in your […]

Finding the Longest Palindromic Substring (LeetCode Problem)

Introduction: In this blog post, we’ll explore a problem from LeetCode – finding the longest palindromic substring in a given string. A palindrome is a string that reads the same backwards as forward, such as “racecar” or “kayak“. We’ll start with a brute-force approach, discuss its time complexity, and then move on to an optimal […]

Conquering the GS Interview 💼: Transforming Fractions to Decimals and Cyclic Patterns 📝

🤔 The Challenge: Fractions to Decimals In the world of mathematics, fractions are a fundamental concept that represents the division of one integer by another non-zero integer. While some fractions can be easily converted to their decimal counterparts (e.g., 1/2 = 0.5), others exhibit a peculiar behaviour known as cyclic decimals. These fractions, when converted […]

Finding All Combination Sum Up to a Target in Java

In this tutorial, we’ll explore a common problem in algorithm design: given an array of integers and a target sum, how can we find all possible combinations of numbers in the array that add up to the target? Furthermore, we’ll allow the repetition of numbers in our combinations, adding a twist to the classic combination […]

Unlock Efficiency: Exploring Amortized Time Complexity with 7 Powerful Insights for ArrayList and HashTable

  • February 16, 2024
  • 0 Comments

Introduction: Amortized time complexity is a crucial concept in analyzing the performance of data structures. It helps us understand the average time taken per operation over a sequence of operations, considering occasional expensive operations. In this blog post, we’ll explore the amortized time complexity of two fundamental data structures in Java: ArrayList and HashTable (or […]