Bloomberg LP Interview Question for Financial Software Developers


Country: United States
Interview Type: Phone Interview




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

I'm not exactly sure what they're asking, but what if the threads don't operate directly on the same memory? Then maybe you could have some sort of inter-thread message passing instead to communicate between threads.

- jvo February 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 votes

we could use multiversion concurrency control. when writing a key, each thread write its own version with a timestamp. when reading a key, we try to find the latest value.

- hezj07 April 12, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Please explain in simple words

- gur July 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

copy on write

- USTChucat February 07, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Versioned writes. Each thread has it's own copy of object in question (shadow copy) which it works on, no need of locks.

- Second Attempt February 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think this concentrates distributed system concepts such as master worker,linda

- sai February 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if you were able to implement linda in the shared space then.this would work as the reading process would only read the data but cannot edit it in the tuple space.thread which need to write will take the take the tuple from tuple space and update the tuple and place it back in tuple space.if mean while some thread which need the that variable or data will be blocked.

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

what is linda?? can you explain/eloborate??

- GouthamP August 03, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

For the people who are saying to copy the data before writing (using immutable objects), that only solves dirty reads. It doesn't solve multiple, concurrent writers, because the copy, update, pointer replacement operation is not atomic, so during that process, before the pointer is updated, another thread might start its own copy operation in order to write.

- dcrafti February 07, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Pointer replacement is atomic. All lock-free containers are based on this

- AndrewJD February 07, 2013 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Yes, and there should be a atomic compare-and-swap operation to solve the concurrent writes issue

- USTChucat February 07, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Saying that there should be an atomic compare and swap operation doesn't help with actually having one.

The atomic update doesn't solve the problem of needing to:
- read the value as an input into calculating a new value,
- doing the calculation itself.
Only then can the atomic pointer update take place. In the meantime, other threads can be reading the memory, as an input, that will soon be out of date.
So, while it is possible to do what's being asked for some class of problems, it's not possible for anything that relies an order of execution.

Of course, with literally unlimited memory, if there's also unlimited processing power, then anything is possible, by using predictive execution.

- dcrafti February 07, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think we can achieve this using volatile keyword for shared data. It instructs thread to maintain a local copy of shared data and threads can run concurrently with independent copy of data.

- Dev February 08, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think your explanation is wrong not sure about your point, because Volatile keyword specifies not to have any cache copy of the variable, which mean each thread can not have a local copy of volatile variable.

- yarli August 02, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

correct me if i am wrong..

- Dev February 08, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If memory is not the concern, then may be using volatile or keeping all variables static.

- Wolverine September 23, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Software Transcational Memory

- VR February 16, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Is that even possible? Locking is to prevent overwriting state. So even if memory is unlimited we,d still need to lock access to any shared state.

- Sameer February 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Is that even possible? Locking is to prevent overwriting state. So even if memory is unlimited we,d still need to lock access to any shared state.

- Sameer February 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree with sameer. Threads work with shared memory, the locking mechanism is used to prevent threads from simultaneous access to the critical section in the program, so having unlimited memory not solve concurrency issues.

- Matru February 06, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

immutable structures. When you need to change data just make a new copy and replace reference to new structure. When data doesn't changed no protection is required.

- AndrewJD February 06, 2013 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

I Think it may not be possible, as lock are used for consistency and improve the system performance from loss of data.
If there is unlimited memory also If anyone try to edit the data which is used by some one in the system. This may led to incosistency in the state and system may crash some time.

- Anonymous May 26, 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