sathipkr
BAN USER- 0of 0 votes
AnswersAssume you have a function isAccountHacked(String username) This function is called by a system whenever a there is a failed login by a particular username.
- sathipkr in United States
The function returns true if there have been "n" consecutive unsuccessful login attempts in the last 1hr/36,000 seconds.How will you write this method.I was asked this question in an interview and I came up with few solutions of logging last n timestamps in 1 hr.
He wanted a solution with space complexity of timestamps less than O(n).Let me know if you need any more details| Report Duplicate | Flag | PURGE
SDE-3 Algorithm - 0of 0 votes
Answer# Given a string *Str of ASCII characters, write the pseudo code to remove the duplicate elements present in them. For example, if the given string is "Potato", then, the output has to be "Pota". Additional constraint is, the algorithm has to be in-place( no extra data structures allowed) . Extend your algorithm to remove duplicates in the string which consisted of UNICODE characters.
- sathipkr| Report Duplicate | Flag | PURGE
- 0of 0 votes
Answer# Given that, there are 2 linked lists L1 and L2. The algorithm finds the intersection of the two linked lists. i.e' "L1 intersection L2 " ( similar to intersection of 2 sets ). Write all the possible test cases involved in the above given problem.
- sathipkr| Report Duplicate | Flag | PURGE
Algorithm - 0of 0 votes
AnswersWhat is the use of static functions in C
- sathipkr| Report Duplicate | Flag | PURGE
- 0of 0 votes
AnswersGiven 2 set of arrays of size N(sorted +ve integers ) find the median of the resultant array of size 2N.
- sathipkr
(dont even think of sorting the two arrays in a third array , though u can sort them. Try something better than order NLogN )| Report Duplicate | Flag | PURGE
Microsoft
How abt using a heap...where the frequency of occurence is represented using the parental dominance condition?
- sathipkr October 19, 2009