Texas Instruments Interview Question for Software Engineer / Developers






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

Static linking is carried out only once to produce an executable,and if several processes call the same object module then several copies exist in the memory.

Dynamic linking : Allows a process to add, replace, remove object module during execution, and if several processes call same object module then there is only 1 shared copy between several process in memory.

- Anonymous August 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

When an executable is produced using static linking, all of the needed machine code from the library is copied into the executable file when the link command is run. For example, suppose prog.c is the source code for a simple C program that makes calls to scanf and printf. You compile the program with the command

gccw -c prog.c
and then you link it with the command
gccw -o prog prog.o
Under static linking, the complete machine code translations of scanf and printf are incorporated into the executable file prog.
When dynamic linking is used to create an executable, machine code from the library is not copied into the executable file. Instead, a little bit of information about where to find the library machine code is put in the executable file. When the executable is actually run, the operating system finds the needed library machine code and loads it into computer memory along with the machine code from the executable. Returning to our example, if the sequence of commands

gccw -c prog.c
gccw -o prog prog.o
is executed in an environment with dynamic linking, the file prog will contain the machine code translation of prog.c and information about where to find machine code for functions like scanf and printf, but it won't contain the machine code translations of scanf and printf.
Dynamic linking has many advantages over static linking. Here are two:

Reduced use of disk space. Dynamically linked executables tend to be much smaller than statically linked executables.
More efficient use of memory at run time. Dynamically linked executables allow the operating system to play clever tricks that may reduce total memory use when many programs are running simultaneously. (Ask me in a lab period if you would like a less vague explanation.)

- king kong January 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

thanks for ur answer.....its really a good answer

- ashish kumar dey August 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Dynamically linked libraries can be shared among different processes where as static linked libraries can not be shared and if 2 processes have static linked libraries same part of library should be loaded twice in memory. Where as dynamic linked library allows to share the code of dynamic linked library among processes

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

static linking--in this case we can use the individual files as independent binary files thus the executable file formed is much larger in size but does not depend on the shared libraries

dynamic linking--here the executable file depends heavily on the shared libraries thus,we cannot directly copy paste and use such binary files.Version incompatibility might also be a problem in the case when you copy and paste such a binary

- insanecoder August 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Copy and paste portion is not clear

- Anonymous August 18, 2010 | Flag


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