Forum Posts
- 2 Answers carrer switch
Hi all,
- naveenkonda89 December 12, 2012
I am currently working in .NET technology, but I wanted to switch to c, c++
My dream is to get an offer from companies like Adode, Google, Microsoft, Amazon etc.,
I have strong command on C and C++ but I don't have real time project experience but very passionate about working in c, c++, data structures and algorithms.
Will these companies look for prior experience in c, c++ or having good command over them with no prior work experience help in getting an offer from Software giants like these?
Please throw some light.| Flag | PURGE - 1 Answer Implement Doubly linked list using single pointer...
Explain how to implement doubly linked lists using only one pointer value x.np per
- Rahul December 10, 2012
item instead of the usual two (next and prev). Assume that all pointer values can be
interpreted as k-bit integers, and define x.np to be x:np D x:next XOR x:pre,
the k-bit “exclusive-or” of x.next and x.prev. (The value NIL is represented by 0.)
Be sure to describe what information you need to access the head of the list. Show
how to implement the SEARCH, INSERT, and DELETE operations on such a list.
Also show how to reverse such a list in O(1) time.| Flag | PURGE - 0 Answers C++ Topic : Related to 'Multiset' functionality
Consider this sample piece of code!
multiset<int> iends; multiset<int>::iterator et1; while(et1!=iends.end()){ multiset<int>::iterator te=et1; et1++; iends.erase(te); } while(et1!=iends.end()){ multiset<int>::iterator te=et1; iends.erase(te); et1++; }
What is the difference between this two pieces of code?
- Psycho December 09, 2012| Flag | PURGE - 2 Answers common ansestor
I have the book Cracking the Coding Interview Fourth eddition. I have a question about the solution to problem 4.6 (Find first common ansestor of two nodes in a binary tree). The solution ends up suggesting some round about way to see if both nodes are on the same side of a given node and what not. It's pretty confusing. But why not just do a depth first search for each of the nodes. Once node is found, record the path back to the root as the recurstion stack unwids. What's the advantage of the complicatd solution offered by your book over this?
- octane.power December 09, 2012| Flag | PURGE - 6 Answers Use of advanced data structures on a Google interview
Hi,
- commercial.eddie December 08, 2012
My friend has recently interviewed with Google. During one of the on-site interviews he was given the following question:
On a Cartesian coordinate system we draw a Bar chart. You can assume that the height of each bar is a natural value. Give an algorithm finding the rectangle of maximum area, bound by the diagram and the x axis. With n being the number of bars, you should do significantly better than O(n^2).
My friend was unable to answer this question, and after we analyzed it at home the only way we could find for meeting the time complexity requirements, is to use a k-d tree\Interval tree data structure for keeping coordinates. These are not basic data structures; They're nearly never discussed during undergraduate studies, and the careercup book doesn't cover this type of questions. Is there a trivial solution we've been missing? Or is it that if I ever interview with Google I should expected to be asked on topics I don't have a chance to be prepared for? This is not what "Cracking the coding interview" is implying.
Please share your thoughts. 10x.| Flag | PURGE - 0 Answers very good question of C language
why C language does not support column major array ??
- charan December 05, 2012| Flag | PURGE - 1 Answer I applied for a position at Am...
I applied for a position at Amazon. I regularly check for the status for the application. Well, much to my surprise, I got a status "under review" for the position, instead of "reviewed, not selected". My question is, how long does it take for them to actually review? I am soo curious! And it has been a couple of days that my status is still "under reviewed".
- plap December 04, 2012| Flag | PURGE - 0 Answers Suggestion...?
Hi Guys.,
- Rythm December 01, 2012
I need a real solution for my career problem, I completed BE(IT) in 2007 with no relevant IT experience as of now, I am good at C, C++, html, css & very very fond of algorithms(No practical Experience),. now i would like to get into IT industry, anybody can Suggest me how to approach, at present i am not getting Interview calls.
Thanks.| Flag | PURGE - 3 Answers System design questions
Hi,
- monadnik November 29, 2012
can anyone please suggest good sources/books to get prepared for the interview questions about system design/scalability/system architecture. It does not necessarily has to be resources about preparing, but something that that develops good intuition about possible problems/pitfalls/approaches would be very helpful. Thanks in advance!| Flag | PURGE - 2 Answers Dynamic programming problem.
Say there are n identical balls and a bag, I want to put these ball in the bag and take them out in different possible ways (one ball can only be put into the bag once). For example, there are two balls, then the different ways are IOIO, IIOO (I means putting in, and O means taking out, you can't do like OOII, OIOI etc.). Find the number of ways of doing this with n identical balls.
- ChenC November 27, 2012
Think a recurrence relation needed for a dynamic programming algorithm. (Time is O(n^2))
I think the answer can be like below, but I work out this answer in a unprofessional way. So, I am still confused about this problem. Can you kindly explain this for me or do you have another answer?
S[i, j] = S[i, j-1] (if i = j)
S[i, j] = S[i, j-1] + S[i-1, j] (if i > j)
S[i, j] = 1 (if j = 0)
Here 'i' is the number of 'I's and 'j' is the number of 'O's.| Flag | PURGE - 2 Answers Python question
how to read input till end of file in python..???
- noob_coder November 24, 2012| Flag | PURGE - 8 Answers Algorithm to sort books
Here is the problem, we have an array of size N, in which random integers are put from 1 to N(all numbers should exist in that array). for example if size is 5, one possible array can be 2 1 4 5 3.
- RG November 20, 2012
Now I want to find minimum moves required to sort this array.
P.S I have tried insertion sort, it doesn't give minimum moves.| Flag | PURGE - 2 Answers Programming Problem
Input: Given 2 integer arrays A[M], B[N], where M, N ranges from 1 to 30K and A[i], B[i] can range between 1 to 1000K.
- BoredCoder November 13, 2012
Generate an output array Z[M] such that:
(1) For each j in B[j]; find the min index i in A[i] such that A[i] >= B[j] and then increase A[i-1] by 1.
(2) If B[j] > A[i] for all i then no effect
(3) If B[j] <= A[0] then no effect.
After processing this way generate the output from the above operations to A.
Complexity Constraints: Worst-case time should be O(M+N+H) where H=max(B[N]) and worst-case should be O(M) apart from the input arrays A and B. You can modify the input arrays also.| Flag | PURGE