Thursday, October 6, 2016

Happy Numbers

What is an happy number can be shown in the following example:

19 is a happy number
1^2 + 9^2 = 82
8^2 + 2^2 = 68
6^2 + 8^2 = 100
1^2 + 0^2 + 0^2 = 1

http://www.programcreek.com/2014/04/leetcode-happy-number-java/
http://getprogramcode.com/2013/12/java-program-to-check-for-a-happy-number/

Caterpillars and Uneaten Leaves

K caterpillars are eating their way through N leaves, each caterpillar falls from leaf to leaf in a unique sequence, all caterpillars start at a twig at position 0 and falls onto the leaves at position between 1 and N. Each caterpillar j has as associated jump number Aj. A caterpillar with jump number j eats leaves at positions that are multiple of j. It will proceed in the order j, 2j, 3j…. till it reaches the end of the leaves and it stops and build its cocoon.

Given a set A of K elements K<-15, N<=10^9, we need to determine the number of uneaten leaves.

Input:

N= No of uneaten leaves.

K= No. of caterpillars

A = Array of integer jump numbers

Output: The integer nu. Of uneaten leaves.

Sample Input:10, 3, 2, 4, 5

Output: 4

Explanation:

[2, 4, 5] is a j member jump numbers, all leaves which are multiple of 2, 4, and 5 are eaten, leaves 1,3,7,9 are left, and thus the no. 4

http://codereview.stackexchange.com/questions/95145/caterpillar-uneaten-leaves
http://stackoverflow.com/questions/27248327/caterpillars-and-leaves-can-we-do-better-than-onc
http://qa.geeksforgeeks.org/219/uneaten-leaves-problem

Wednesday, September 14, 2016

Active and Inactive cells after k Days

Given a binary array of size n where n > 3. A true (or 1) value in the array means active and false (or 0) means inactive. Given a number k, the task is to find count of active and inactive cells after k days. After every day, status of i’th cell becomes inactive if its left and right cells have same value, i.e., either both are 0 or both are 1.
Since there are no cells before leftmost and after rightmost cells, the value cells before leftmost and after rightmost cells is always considered as 0 (or inactive).

http://www.geeksforgeeks.org/active-inactive-cells-k-days/

Maximize value of (arr[i] – i) – (arr[j] – j) in an array

Given an array, arr[] find the maximum value of (arr[i] – i) – (arr[j] – j) where i is not equal to j. Where i and j vary from 0 to n-1 and n is size of input array arr[].

Tuesday, September 13, 2016

Behavioural Questions

Behavioral Questions
  1. Things u learn in 3 years of experience which makes u different from fresher guy?
  2. Project description
  3. Discussion about my project details and challenging task

Miscellaneous Interview Questions

1. Draw the recursion stack of any program and find in what order one function is called and stored in the stack and in what order it is returned back to its callee function. And to prove what is the space complexity through that recursion stack.

2.

Design a Server to keep track of shares and clients

Design an object oriented design system for an server that keeps track of shares and clients can ask the server to get the most up to date information about value of the shares.

Tuesday, August 30, 2016

Remove duplicates from infinite integers

You are given an infinite stream of integers. The stream of integers is unsorted and are provided by iterator so that you don't have the access to all the elements at once. You have to return another iterator from the input iterator so that there are no duplicates and the input order is maintained.

http://www.dsalgo.com/2013/03/remove-duplicate-infinite-integer.html

Sunday, August 28, 2016

Microsoft Cloud Computing Services

Overall Azure Services:
https://azure.microsoft.com/en-in/get-started/

Microsoft Azure specific Services:
https://azure.microsoft.com/en-in/documentation/articles/active-directory-whatis/
https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/

Onedrive vs Sharepoint
http://blog.apterainc.com/bid/392491/What-s-the-Difference-between-OneDrive-and-SharePoint

Microsoft Azure Vault:
http://www.cio.com/article/2986308/cloud-security/is-byok-the-key-to-secure-cloud-computing.html

Office LockBox
http://en.share-gate.com/blog/office365-security-customer-lockbox
https://blogs.office.com/2015/04/21/announcing-customer-lockbox-for-office-365/

Cloud Computing Security
https://en.wikipedia.org/wiki/Cloud_computing_security

Encryption Algorithms:
https://en.wikipedia.org/wiki/Symmetric-key_algorithm
https://en.wikipedia.org/wiki/RSA_(cryptosystem)
https://en.wikipedia.org/wiki/Public-key_cryptography

David Malan System Design Topics