Kaseya Interview Question for Software Engineer / Developers






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

I could think of this way split the number into 3-3-4 digits so that the btree has 3 levels.
In first level you have a single node containing 000-999 valuses and the corresponding pointers(1000 keys+1000 pointers)
In second level for every one value in the node of above level you have one more node containing totally(1000 nodes each with 1000keys+1000 pointers)

And continue the same in next level too..
Can anyone think of better solution.

- someone September 17, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@someone:
but the size grows exponentially, right?

- anon September 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yes but it will grow if there are those many phone numbers size cannot be more than O(n)

I meant to say that first level node doesn't contain 1000 keys + 1000 pointers from the beginning.It will get populated as and when you store in it

say you have 805-xxx-xxxx
896-xxx-xxxx
these two numbers then the top level node contains 2 keys and two pointers.
What I said was the maximum possible each node can accommodate.
Then one more optimization is you could perform binary search with in a node to check the existence of a part of the phone number.

- someone September 18, 2009 | 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