Adobe Interview Question for Computer Scientists






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

LinkedList will be a good option.
Node will contain multiplir, variable and a power.

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

Can be done using array.
1. Determine the maximum degree out of the provided polynomials.
2. Make the array/arraylist of that size.
3. a[0] represents the constant and a[2] represents the x^2 coefficient.
4. Add the same index values of both arrays in the third array.

Complexity: O(n)+O(m)

Correct me if I am wrong in the complexity.. Just started DAA,, so still learning.

- King@Work June 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Nothing wrong with your apporach but linked list will save a lot of memory. For example consider the following polynomial
a * X ^ 100 + 5. With linked list this can be stored with 2 nodes but array would require 100 elements.

- Anupam Verma December 28, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think , hash data struct would be ideal for storing and adding polynomials.

- Badri July 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i think hash would b a nice for time complexity

- anshulzunke September 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

How would you justify storing with Hash? Can you give example please?

- const volatile March 28, 2012 | Flag


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