Laserfiche Interview Question for Software Engineer in Tests






Comment hidden because of low score. Click to expand.
0
of 0 vote

BTS?

- Anonymous February 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you mean BST ?

- cirus February 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

maybe red and black BST is the solution?

- Anonymous February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

may be binary search

- lvs February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

BST is a good option. Maybe we can add 'occurrences' field to every node (to avoid creation of duplicate nodes.)

- neo1234 February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I would go for binary search.
BST has overhead associated with creation. Plus the run time run time for search in both BST and binary search in log n (I think not 100%)

- Anonymous February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

if we use BST, we loose the sequence. we may again need to maintain one more variable in structure to store the original index.

- Anonymous February 18, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Whether you choose array implementation or bst, your algorithm in any case run in O(log n).

- Anonymous February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

if you use BST, creation overhead will be O(nlogn), worse than linear. binary search will work

- newlifeseattle February 03, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Here is my take:
Create a hashtable of the array, the creation cost is O(n) but every other access can be done in O(n). But yes space complexity is O(n).

It is better than BST but yes space complexity not as good compared to BS. But yes every time search cost is O(1) which is not the case with BS for all inquiries ...

- ZooZoo March 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Using BST, is not really an option, because the input array is sorted. The BST, would be completely unbalanced and would effectively be like a singly linked list. (hence will give O(N) on search, not the proclaimed O(n log n)). You can try to shuffle the sorted array, but shuffling would also cost O(N).

I like ZooZoo solution, of O(1) search time complexity, O(N) creation time complexity, and O(N) space complexity

- Anonymous June 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Now that I think of it, we can use a generalized version of divide-and-conquer search (instead of dividing by 2, as binary search, we can divide by m (>2)), depending upon (a[max-1]-a[0])/(some distribution/duplication related constant).

It will give a better than log(2,n) performance of Binary search.

- Anonymous June 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We could do a counting sort. Each location will hold the count of the number of occurrences.
Example count[0] = 0, count[1] = 1, count[2] = 1, count[3] = 4..and so on.
Something like count[ ] = { 0,1,1,4,1,1,1,1,3,1}
The index of first occurrence can by created by
index[i] = index[i-1] + count[i-1]

- Anonymous March 18, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More