## Calculate (x^y)%z without using pow() function

Problem: Given integers x, y, and z. Write a program to calculate (x^y)%z without pow() function. Example: x = 2, y= 5, z = 3 Output: (2 ^ 5) % 3 = 2 x...

Skip to content# Category: Google Interview

## Calculate (x^y)%z without using pow() function

## Find subarray with a sum to given number-2 | Handle negative numbers

## Sort the two dimensional (2D) array – In-place

## Implement/Design the version control map system

## Two Sum Problem

## Lexicographically next permutation With One swap

## Stable Marriage Problem – Gale–Shapley Algorithm – Java

## Given an array, find three-element sum closest to Zero

## Number of Intervals in which given value lies

## Articulation Points OR Cut Vertices in a Graph

## Print All Paths in Dijkstra’s Shortest Path Algorithm

## Check if Graph is Bipartite – Adjacency List using Depth-First Search(DFS)

## Longest substring with at most K unique characters

## Sort a given stack – Using Recursion

## Determine the given routing number belong to which bank

@tutorialhorizon

Problem: Given integers x, y, and z. Write a program to calculate (x^y)%z without pow() function. Example: x = 2, y= 5, z = 3 Output: (2 ^ 5) % 3 = 2 x...

Problem: Given an array (positive and negative) and an integer, find the subarray with sum is equal to the given integer. Note: This problem is an extension of – find the subarray with sum...

Problem: Given a two-dimensional array where each individual row is sorted in ascending order. Your task to sort the entire 2d array in ascending order. Write an algorithm for the sorting. Example: Given Array:...

Problem: Implement the version control map system which takes the snapshot of the versions of data. Implement the following functions: put(key, value) – puts the value again the key in the latest version of...

Objective: Given an array of integers, and k. Write a program to find indexes of two elements in an array which sum is equal to K. Example: Given array: [5, 4, 7, 3, 9,...

Objective: Given an array of integers (in particular order or permutation of a set of numbers), write an algorithm to find the lexicographically next permutation of the given permutation with only one swap. This...

Stable Marriage Given N men and N women and the marriage preference order for each man and woman. Their marriage will be stable when these men and women marry in such a manner so...

Objective: Given an array of integers, find the sum of any three elements which is closest to zero. The array may contain positive and negative elements. Example: Given Input: [-1, 4, -2, 5, 10,...

Objective: Given a list of intervals with start and end for each interval. You have given a value V, write an algorithm to find the number of intervals in which the value V lies. ...

Objective: Given a graph, write an algorithm to find all the articulation points or cut vertices. Articulation Points: In a graph, a vertex is called an articulation point if removal of that vertex (along...

Objective: Given a graph and a source vertex write an algorithm to find the shortest path from the source vertex to all the vertices and print the paths all well. Example: We strongly recommend reading...

Objective: Given a graph represented by the adjacency List, write a Depth-First Search(DFS) algorithm to check whether the graph is bipartite or not. Earlier we have solved the same problem using Adjacency Matrix (Check...

Objective: Given a string, write an algorithm to find the longest substring with at most K characters. Example: Input: aabbaacdeeeeddded, K = 3 Output: Longest substring with 3 most unique characters is: cdeeeeddded with...

Objective: Given a stack of integers, write an algorithm to sort the stack using recursion. Example: Original Stack: [14, 9, 67, 91, 101, 25] Sorted Stack: [9, 14, 25, 67, 91, 101] Original Stack:...

Objective: Given the banks and range of routing numbers for each bank. You have given a routing number, write a program to determine which bank it belongs to. Input: Given a list of routing...

%d bloggers like this: