Programming Languages and Software Engineering

Test your knowledge of programming language concepts, software engineering principles, and coding practices

19 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

main() { signed int bit=512, i=5; for(;i;i--) { printf("%dn", bit = (bit >> (i - (i -1)))); } }

  1. Compile error
  2. 256256256256256
  3. 55555
  4. runtime error
Question 2 Multiple Choice (Multiple Answers)

void main(){ print(“%d”,scanf(“%s”)) };

  1. Compile error
  2. 11
  3. Hello world
  4. 5
Question 3 Multiple Choice (Single Answer)

void main(){ print(“%d”,printf(“What this prints”)) };

  1. Compile error
  2. What this prints
  3. 11
  4. 15
Question 4 Multiple Choice (Single Answer)

What is the maximum length of command line arguments including space between adjacent arguments

  1. 100
  2. 50
  3. 200
  4. 150
Question 5 Multiple Choice (Single Answer)

main() { signed int bit=512, i=5; for(;i;i--) { printf("%dn", bit = (bit >> (i - (i -1)))); } }

  1. Compile error
  2. 256256256256256
  3. 55555
  4. runtime error
Question 6 Multiple Choice (Single Answer)

void main(){ print(“%d”,scanf(“%s”)) };

  1. Compile error
  2. 11
  3. Hello world
  4. 5
Question 7 Multiple Choice (Single Answer)

void main() { int x=20,y=35; x= y++ + x++; y= ++y + ++x; printf(" %d %d" , x,y); }

  1. x=57 & y=94
  2. x=57,y=55
  3. X = 57 Y= 93
  4. X = 37 Y= 65
Question 8 Multiple Choice (Single Answer)

Which group has had the most impact on modern object-oriented programming practices?

  1. The Gang of Four
  2. The Party of Five
  3. The soft-drink industry
  4. AC/DC
Question 9 Multiple Choice (Single Answer)

What is the best way to preserve type safety in assembly language?

  1. Don't link your modules to modules written in any other language
  2. Make sure you declare all your variables' data types ahead of time
  3. Don't add variables of one type to variables of another
  4. Devout prayer
Question 10 Multiple Choice (Single Answer)

Just-in-time (JIT) compilation improves the performance of languages that compile into bytecode. Which language featured the first JIT compiler?

  1. Java
  2. C#
  3. Smalltalk
  4. Cobol
Question 11 Multiple Choice (Single Answer)

If I told you a key characteristic of my programming language of choice was that it generated threaded code which language would I most likely be talking about?

  1. Pascal
  2. Java
  3. Forth
  4. Python
Question 12 Multiple Choice (Single Answer)

Which of the following is NOT a central tenet of extreme programming?

  1. Refactor your code often
  2. Throw away obsolete code
  3. Debugging is for wimps
  4. Communicate often with the customer
Question 13 Multiple Choice (Single Answer)

What is the relationship between Java and JavaScript?

  1. Netscape invented JavaScript as a stripped-down "lite" version of Java
  2. Java borrowed ideas from JavaScript and made it a full-fledged programming language
  3. They both originate from the same research at Sun Microsystems
  4. There is none; it's all just marketing
Question 14 Multiple Choice (Single Answer)

Why do some consider Ruby to be more "purely" object-oriented than other more popular OOP languages such as Java and C++?

  1. Because Ruby forces object orientation and does not permit procedural or functional style code
  2. Because Ruby makes no distinction between objects and primitive types
  3. Because Ruby's syntax is similar to that of Perl
  4. Because Ruby programmers are full of themselves
Question 15 Multiple Choice (Single Answer)

Failure to validate user input is one of the most common sources of software security vulnerabilities. When is it safe to accept user input without validation?

  1. When the application is running behind a firewall
  2. Never; any program that accepts input can be exploited
  3. When the application is written in Perl using the language's "taint mode"
  4. When the user is your own mother
Question 16 Multiple Choice (Single Answer)

Which of the following is the best way to write reusable code that is easier to maintain?

  1. Use more global variables
  2. Keep variable and function names down to one or two letters
  3. Insert comments throughout your source code files
  4. Use pointer arithmetic wherever possible
Question 17 Multiple Choice (Single Answer)

Of the following who is NOT the inventor of a programming language in current use?

  1. Andrew S. Tanenbaum
  2. Guido van Rossum
  3. Niklaus Wirth
  4. Bjarne Stroustrup
Question 18 Multiple Choice (Single Answer)

To what concept does "the mythical man-month" refer?

  1. The code that would have been written last month if your project was on deadline
  2. The amount of code that you can produce in a month on your salary
  3. The fallacy that assigning more staff to a programming job will complete it faster
  4. The fact that like Sysiphus pushing the boulder you can never finish debugging
Question 19 Multiple Choice (Single Answer)

Hungarian Notation is a variable-naming convention used by some programmers. How did it get its name?

  1. It was called that because of its similarity to Reverse Polish Notation
  2. Its inventor was Hungarian
  3. When you read it out loud it sounds like you're speaking Hungarian
  4. It was invented at the Polytechnic University of Bucharest in Hungary