Author: admin

Top 10 Applications of Java in Real World

Java is the Queen of programming languages. It beholds the pride of the most preferred programming language by software developers. Java has recently celebrated its 25th anniversary and is continuously updating to cope up with the latest technological advancements. It is surprising to note that at present around three billion devices use Java for development. […]

Continue Reading

Check if any row of the matrix can be converted to the elements present in the target row

  import java.util.*;  class GFG {                  public static boolean checkPossibleOrNot(        int[][] mat, int[] target)    {                  int[] comp = new int[mat[0].length];                          Arrays.fill(comp, Integer.MIN_VALUE);                  for (int[] val : mat) {                                                  if (val[0]

Continue Reading

Minimum adjacent swaps required to get Kth smallest number greater than given number

#include using namespace std;  void minSwapsKthLargest(string str, int k){        string res = str;              for (int i = 0; i < k; i++) {        next_permutation(            str.begin(), str.end());    }          int swap_count = 0;              for (int i = 0; i < res.length(); i++) {                  if (res[i] != str[i]) {            int start = i + 1;                          while (res[i] != str[start]) {                                  start++;            }            while (i != start) {                swap(str[start], str[start - 1]);                                                  start--;                swap_count++;            }        }    }          cout

Continue Reading

Minimum characters to be replaced in Ternary string to remove all palindromic substrings for Q queries

  #include #define SIZE 100005using namespace std;  void preprocess(string& s, string& t,                int prefix[][SIZE],                int n, int i){        prefix[i][0] = (s[0] != t[0]);      for (int j = 1; j < n; j++) {                                  prefix[i][j]            = prefix[i][j - 1]              + (s[j] != t[j % 3]);    }    return;}  void minChangesNonPalindrome(    string str, int N, int Q,    vector queries){          int prefix[6][SIZE];                  vector sequences        = { "012", "021", "102",            "120", "201", "210" };      for (int i = 0; […]

Continue Reading

Introduction to Universal Hashing in Data Structure

Hashing is a great practical tool, with an interesting and subtle theory too. In addition to its use as a dictionary data structure, hashing also comes up in many different areas, including cryptography and complexity theory. This article discusses an important notion: Universal Hashing (also known as universal hash function families).Universal Hashing refers to selecting a […]

Continue Reading

MCF ISRO Interview Experience

My Interview was scheduled for the 19th of Mar 2021 at MCF ISRO, Bhopal. I reached there on the time. First, they checked all documents and then ask me to wait for the turn.The interview panel was not at the center but they were taking the interview using video conference.At my turn, I was asked […]

Continue Reading

Flipkart Interview Experience for SDE-1

Flipkart Interview Experience (Flipkart Grid 3.0 for SDE 1 intern+FTE)Flipkart Interview experience off-campus through Flipkart Grid 3.0. Flipkart Grid 3.0 is a team hackathon contest However Our Team didn’t qualify for the ideation round, but we got a coding round test link.Hey geek! It’s time to become a success story instead of reading them. Check […]

Continue Reading

Nvidia Interview Experience for Compiler Engineer

My Background: I worked in the compiler frontend (Clang) during my thesis developing a compiler-like tool for static analysis of C language. Basically a linter for C programming language. I am from Tier 1 college (IIT). I am 1+ years experienced.Hiring Manager Round: He worked in the GPU compiler optimization team at NVIDIA. Talked about […]

Continue Reading