Qualcomm Interview Question Software Engineer / Developers




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

Global and static variables are stored in bss section of the data segment. Local variables are stored on the stack and are valid until the program exits from the function in which they are defined.

Any comments on optimization, guys?

- Gavid on December 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Processors reload global variables every time it occurs, they never stores its value in registers so it affect system performance and might be critical in Embedded System Performance

- Rohan Desai on January 06, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

BSS = Block Started by Symbol

- Gavid on December 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

That doesn't answer the question of when to use them. Perhaps something like, use globals as a last resort, because since they are accessible to everyone class, all bets are off. They could be getting modified all over the place, so debugging can be very difficult.

- Anonymous on December 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

That doesn't answer the question of when to use them. Perhaps something like, use globals as a last resort, because since they are accessible to everyone class, all bets are off. They could be getting modified all over the place, so debugging can be very difficult.

- Anonymous on December 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Data segment is divided into 3 parts data, BSS, Heap

data part is further divided into 2 parts Read only memory & read write memory...
all global and static variables that are intialsed to a value but not to '0'(deafult intialisation) are stored in data part.
All constats are stored in Read only memory in data part.

BSS - All global and static variables which are not initialized to any value (but will be initialized to 0 as default initialization) will be stored in BSS part.

Heap - managed by malloc, calloc, realloc...

Please read the wiki for data segment..

- JackMaster on January 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

well, according to wiki, data segment is divide into 4: data, stack, bss, heap.
stack: local var
data: constants
heap: dynamically allocated var
bss: global var and static var which is not initialized

- jiez on January 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@Jiez...its mentioned tht the main memory (RAM) is divided in 2 parts - data segment and stack..and data segment is further divided into 3 parts...the above mentioned main memory is only a part of the main memory which doesn't include the address space occupied by OS or device drivers or any ISR...

- JackMaster on January 06, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book walking you through 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