## Recent Interview Questions

More Questions »- 0of 0 votes

AnswersN cows sitting on some point on the x-axis, each cow has some appetite, in other word hunger index. A cow can sleep of 1 unit of time or eat for one unit of time or move left or move right.

- xyz September 15, 2019 in India

We've got some vessels those are having infinite supply and they are placed on the x-axis. Find minimum time in which all cows appetite would be filled.

Input:

cow Apetitte = {1,1}

Vessle locations = {-1,1}

Answer would be 2 since both cow can go in different direction they would eat for one seconds. One second for moving and one second for eating.

This problem looks to be similar to rotten eggs/tomatoes.| Report Duplicate | Flag | PURGE

Amazon SDE-2 Algorithm - 0of 0 votes

Answershow to find the fastest xor of large subarray or given range?

`print(reduce(xor,arry[qury[1]-1:qury[-1]]))`

but it's not working for larger input

- Dhioyt September 14, 2019 in United States| Report Duplicate | Flag | PURGE

HackerEarth - 1of 1 vote

AnswersDesign a voting system. 100M users will be logging in within a window of 24h (not necessarily uniformly). Every user will be able to choose from a fixed list of options. If the user has already voted the system should not let them to vote a second time. Additional constraint: only the first 100K votes are accepted. If the quota is exceeded any attempt to vote should be rejected.

- adr September 12, 2019 in United States| Report Duplicate | Flag | PURGE

Software Engineer System Design - 0of 2 votes

AnswersA special palindrome is a palindrome of size N which contains atmost K distinct characters such that any prefix between the size 2 to N-1 is not a palindrome.

- Prashanthwagle360 September 08, 2019 in India

You need to count the number of special palindromes

For example, abba is a special palindrome with N=4 and K=2 and ababa is not a special palindrome because aba is a palindrome and its a prefix of ababa.

If N=3, K=3, possible special palindromes are aba, aca, bab, bcb, cac and cbc. So answer will be 6.

Input format

Two integers N and K

Output format

Answer modulo 10^9+9

Constraints

1<=N,K<=10^9

Sample TC

3 3

Output

6| Report Duplicate | Flag | PURGE

HackerEarth Problem Setter Algorithm - 0of 0 votes

AnswersGiven a length n, count the number of strings of length n that can be made using ‘a’, ‘b’ and ‘c’ with at-most one ‘b’ and two ‘c’s allowed.

- Nits September 07, 2019 in United States| Report Duplicate | Flag | PURGE

Facebook Software Development Manager Algorithm