Computer Knowledge

Programming Languages and Compilers

2,284 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice technology testing
  1. PERL

  2. TSL

  3. SQA Basic

  4. VB

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

QTP (QuickTest Professional, now UFT) uses VBScript as its scripting language. 'VB' is correct as it refers to VBScript. TSL is for WinRunner, SQA Basic is for SQA Robot, and PERL is unrelated.

Multiple choice technology web technology
  1. C

  2. java

  3. C#

  4. cobol

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Ruby's reference implementation (MRI) is written in C. This allows Ruby to be portable and performant. Other implementations exist (JRuby in Java, IronRuby in C#), but the core Ruby interpreter is C-based.

Multiple choice technology web technology
  1. java

  2. C

  3. Ruby

  4. Cobol

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Ruby on Rails is a web framework written in Ruby. Rails leverages Ruby's metaprogramming capabilities and follows Ruby conventions - it cannot be written in Java, C, or COBOL as it depends on Ruby's language features.

Multiple choice technology web technology
  1. Mongrel

  2. Apache

  3. Webrick

  4. Tomcat

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

WEBrick is Ruby's built-in HTTP server library and serves as the default development server for Rails applications. While production environments typically use more performant servers like Puma or Unicorn, WEBrick is included with Ruby and requires no additional configuration for development work.

Multiple choice technology web technology
  1. It is a Programming Language

  2. Its is a frame work

  3. Its is a tool

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Ruby is a dynamic, object-oriented programming language created by Yukihiro Matsumoto. It emphasizes simplicity and productivity, with an elegant syntax that is natural to read and easy to write. Ruby on Rails is a framework built using Ruby, not the language itself.

Multiple choice technology web technology
  1. It is a Programming Language

  2. Its is a frame work

  3. Its is a tool

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Rails is a web application framework written in Ruby. It provides structure for database, web service, and web page development. A programming language (A) is what you write code IN, not what gives you web scaffolding.

Multiple choice technology web technology
  1. C

  2. java

  3. C#

  4. cobol

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Ruby's reference implementation (MRI) is written in C. This allows Ruby to run on any platform with a C compiler. Java, C#, and COBOL are not the implementation language of Ruby.

Multiple choice technology web technology
  1. java

  2. C

  3. Ruby

  4. Cobol

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Rails is written in Ruby itself (a 'self-hosting' framework). The Rails codebase is pure Ruby, which contributes to its expressiveness and developer productivity.

Multiple choice technology web technology
  1. It is a Programming Language

  2. Its is a frame work

  3. Its is a tool

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Ruby is a general-purpose, object-oriented programming language. It can be used for web development, scripting, data processing, and more. A framework (B) provides structure for specific types of applications.

Multiple choice technology web technology
  1. It is a Programming Language

  2. Its is a frame work

  3. Its is a tool

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Rails is a web application framework that provides structure for building database-backed web applications. It is not a programming language (A) - you write Ruby code that uses the Rails framework.

Multiple choice technology programming languages
  1. 4

  2. 5

  3. 6

  4. 7

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In C, adjacent string literals are concatenated during compilation. 'Kumar' 'Singh' becomes 'KumarSingh', and 'Bittoo' 'Roshan' becomes 'BittooRoshan'. The array contains: 'Ritesh', 'KumarSingh', 'Happy', 'BittooRoshan', 'Go' = 5 elements.

Multiple choice technology programming languages
  1. p = realloc( ptr, 10 * sizeof( struct ritesh));

  2. realloc( ptr, 9 * sizeof( struct ritesh) );

  3. p+= malloc( 9 * sizeof( struct ritesh) );

  4. p = realloc( ptr, 9 * sizeof( struct ritesh) );

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

realloc expands existing allocation. Option A correctly uses realloc to resize ptr for 10 elements. Option B is missing assignment (memory leak), Option C uses malloc and adds to pointer (wrong), Option D only allocates 9 elements. Note: question uses 'ptr' in text but 'p' as variable name - minor inconsistency.