Bloomberg LP Interview Question for Financial Software Developers






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

you will find this article helpfull..

codinghorror.com/blog/2007/03/dude-wheres-my-4-gigabytes-of-ram.html

- Myth March 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

There's no link between 32b/62b and max file size.

max file size is based on the type of inode and block structure.

Quoting an example from my lecture slides:

 Example: 4.3 BSD file system
– Inode contains 12 direct block addresses
– Inode contains 1 indirect block address
– Inode contains 1 double-indirect block address
 If block addrs are 4-bytes and blocks are 1024-bytes,
what is maximum file size?
– Number of block addrs per block = 1024/4 = 256
– Number of blocks mapped by direct blocks  12
– Number of blocks mapped by indirect block  256
– Number of blocks mapped by double-indirect block  256
2
= 65536
– Max file size: (12 + 256 + 65536) * 1024 = 66MB (67,383,296 bytes)

- Sanjay Devnani April 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree to the solution above. The file size has nothing to do with how many 'bit' system it is. It only depends on the inode structure or any allocation strategy used by the file system at hand.

So what is needed to be known is the file system in use.

- nikhil May 25, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

i also agree with the solution. file siaze totally depends on file system.
in unix inode contanis a fild fileSize of 32 bit it limits file size to 4 gb.

- Learn Android: http://learnandroideasily.blogspot.in/ June 15, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The max address in 32bit system is 2^32. I think this would be 4GB file MAX.

- Kishore March 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This is incorrect... There will be page swapping

- bhaskardas4u August 27, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I guess it depends on the page table and its size...and also when he said 32bit system what he mean...it can also be its data bus size not jst addressing capacity...and virtual mem makes it look u have more physical mem than it is present...i need to brush up my concepts to ans exactly, but these are my initial thoughts...

- sriks March 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Virtual memory allows you to have the address space of the program more than the actual physical storage, also allows you to execute many programs simultaneously.

I found these 2 articles abt virtual memory:
ualberta ca/CNS/RESEARCH/LinuxClusters/mem.html#intro
princeton edu/~unix/Solaris/troubleshoot/vm.html

These article excellently explains the virtual memory and mapping of variables from c to memory(segments).

My question here is, how to include "file" access in the virtual memory? ("file" and the "program" are 2 separate things)

- Shrikant Chaudhari March 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Normally in 32 bit systems, OS uses 2GB memory and another 2GB is available for applications. However this can be changed by altering the BIOS and allocating 1GB for OS and 3GB for applications.

- gavinashg March 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

IMO there's no relationship between 32/64b OS and the file size you can access. Even on 32b system you can use 64b integers (or whatever else) and access file of any size. But typically OS API use 64b numbers to address the file position.
Max file size is limited only by file system and nothing else.

- Elephantik April 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The important fragment is "all at the same time". If using a read() system call, then user buffer Orr has to be provided. Likewise for an mmap() based access. To read a 5gb file at the same time, one has to provide a. 5th destination user buffer. This is not possible on a 32 bit VM system without special hacks.

- Sk_seeker May 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The important fragment is "all at the same time". If using a read() system call, then user buffer Orr has to be provided. Likewise for an mmap() based access. To read a 5gb file at the same time, one has to provide a. 5th destination user buffer. This is not possible on a 32 bit VM system without special hacks.

- Sk_seeker May 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Maximum file size depends on 2 things:
1. The data type of the file size variable in the inode e.g. if it is 'int file_size', then MAX_INT bytes can be the size of the file
2. The data block addressing structure inside the inode
- there are usually 9 directly addressed blocks
- 1 indirectly addressed block
- 1 double indirectly addressed block
- 1 triple indirectly addressed block
File size can be the addition of all these block sizes

The actual file size will be the minimum of 1. and 2.

5 GB can't be accessed at the same time since the max address generated by a 32-bit system will be < 5 GB. There will have to be some hacks to the VM e.g. introducing a hierarchy to expose the file as chunks.

- nharryp December 16, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

I think the 4GB is for program's addressable space. Out of the 4Gb some space is reserved by the operating system.

These things complicate the solution.

Can someone list such factors?

- Shrikant Chaudhari March 16, 2011 | 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