Adobe Interview Question for Software Engineer / Developers


Country: India
Interview Type: Written Test




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

Assuming j is an integer O(nlogn)

- NewCoderInTown April 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

nlogn

- Leon April 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is log 1 + log 2 + ... + log n which is Theta(n log n).

A more precise value is given by Stirlings formula.

- Anonymous April 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Of course, to be really precise: It is actually ([log 1] + 1)+ ([log 2] + 1) + ... + ([log n] +1 )

where [x] = integral part of x, and log is taken to base 2.

- Anonymous April 19, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I also thought the same O(NlogN)

- getjar.com/todotasklist my android app April 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

O(nlogn)

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

O(nlogn)

- krishna April 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We have sum of logarithms.
log 1 + log 2 + .... + log N

Using product rule from wiki page:

en.wikipedia.org/wiki/Logarithm

we have log (1*2*....*n) = log n!

According to Ramanujan formula from

en.wikipedia.org/wiki/Factorial

log n! = n * log n - n + ....

So, O(log n!) = O(n*log n)

- m@}{ April 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

That's if you want to get all fancy up in here. I can show it's NlogN much more simply:
_
log 1 + log 2 + ... + log N < log N + ... +log N = NlogN (bound from above)
_
log 1 + log 2 + .. + log N > log N/2 + log (N/2+1) + ... + log N > (N/2) * log(N/2) = (N/2) (logN - log2) = O(NlogN) (bound from below)

- eugene.yarovoi April 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

@eugene.yarovoi well thought .....:)

- Anonymous June 07, 2012 | 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