InterviewPitch

Land the job you want — prepare
with Real interviews Q&A

Curated interview questions, company-wise guides and coding rounds. Practice mock interviews, improve with feedback, and track your progress.

Q&A
Top curated interview packs
Company-wise & role-wise packs, quality assured.
Mock interview
AI scoring
Coding rounds
Top 10 sets
Beginner
1. What is Ada?

Ada is a structured, statically typed, high-level programming language designed for reliability and safety-critical systems. It features built-in support for design-by-contract, strong typing, and concurrent real-time execution.

Beginner
2. Who developed Ada?

Bagian dari U.S. Department of Defense (DoD) in the late 1970s to replace hundreds of disparate programming languages then in use within military systems. It was named after Ada Lovelace, often credited as the first computer programmer.

Beginner
3. Why is Ada used in safety-critical systems?

Because of its uncompromising features: strong static typing, compile-time checks, safe pointer interfaces, and built-in concurrency support. It heavily minimizes the occurrences of runtime system vulnerabilities, crashes, and undefined behaviors.

Beginner
4. What is strong typing in Ada?

Strong typing in Ada means the compiler enforces strict differentiation between types. For example, you cannot accidentally add an integer measuring Speed to an integer measuring Distance without explicit conversions, preventing logical programming mistakes.

Beginner
5. What is a package in Ada?

A package is the fundamental modular unit in Ada used for grouping logically related declarations and implementations together. It consists of a specification file (interface) and a body file (implementation), ensuring clean encapsulation.

Beginner
6. What is a procedure in Ada?

A procedure is a subprogram in Ada that executes an action but does not return a value. It can communicate inputs and outputs to calling blocks using parameters marked with modes: in, out, or in out.

Beginner
7. What is a function in Ada?

A function is a subprogram in Ada that performs computations and must return a single value of a specified type using a return statement.

Beginner
8. What is a variable declaration example?

In Ada, variables are declared using the pattern: Variable_Name : Type_Name := Initial_Value;

Ada
X : Integer := 10;
Beginner
9. What is a constant in Ada?

Constants are declared by adding the constant keyword right after the colon delimiter, which guarantees they cannot be modified after compilation.

Ada
Pi : constant Float := 3.14;
Beginner
10. What is an if statement in Ada?

An if statement checks condition states and ends explicitly with an end if; statement.

Ada
if X > 0 then Put_Line("Positive"); end if;
Beginner
11. What is a loop in Ada?

Loops in Ada can be controlled using standard ranges or index iterations. Numeric attributes can be formatted as output text using the 'Image attribute.

Ada
for I in 1..10 loop Put_Line(Integer'Image(I)); end loop;
Beginner
12. What is an array in Ada?

Arrays explicitly define their boundary conditions during creation (e.g., indexes 1 to 5).

Ada
 A : array (1..5) of Integer;
Beginner
13. What is a record in Ada?

A record allows programmers to group elements of varying types together into a cohesive custom type definition, similar to a struct in C.

Ada
type Person is record Name : String(1..20); Age  : Integer; end record;
Beginner
14. What is exception handling in Ada?

Ada handles runtime exception boundaries using structured blocks, stopping failures from destabilizing complex critical environments.

Ada
begin -- Potentially unsafe operation X := Y / Z; exception when Constraint_Error => Put_Line("Division by zero or overflow!"); end;
Beginner
15. What is the entry point of an Ada program?

The program's entry execution context starts within a standard procedure mapped directly as the main system loop configuration block.

Ada
 procedure Main is begin -- Execution starts here Put_Line("Main entry execution"); end Main;
Intermediate
16. What is a task in Ada?

A task is an active concurrent execution thread managed directly by Ada's compiler and runtime platform layer, enabling native, portable multi-threading support.

Ada
task type Worker is
entry Start;
end Worker;

task body Worker is
begin
accept Start;
Put_Line("Task is running concurrently.");
end Worker;
Intermediate
17. What is rendezvous in Ada?

A rendezvous is Ada's fundamental synchronization mechanism, allowing safe data exchanges and thread coordination when multiple tasks meet.

Ada
-- Task communication handshake
accept Start do
-- Synchronized mutual-exclusion zone
Put_Line("Rendezvous active");
end Start;
Intermediate
18. What is generic in Ada?

Generic components are templates parameterized with types, subprograms, or values, facilitating compilation-level type-safe code reuse.

Ada
generic type Element is private;
procedure Swap(A, B : in out Element);
Intermediate
19. What is subtype?

A subtype defines a subset of an existing base type's values without instantiating a completely new distinct type category.

Ada
subtype Positive_Integer is Integer range 1 .. Integer'Last;
Intermediate
20. What is access type?

Access types are type-safe pointer alternatives in Ada used to securely allocate and dereference memory addresses dynamically.

Ada
type Int_Ptr is access Integer; My_Ptr : Int_Ptr;
Intermediate
21. What is tagged type?

A tagged type enables object-oriented programming (OOP) paradigms in Ada, acting as a className base to support dynamic dispatching and inheritance.

Ada
type Instrument is tagged record ID   : Integer; Name : String(1..10); end record;
Intermediate
22. What is a protected object?

A protected object provides coordinated lock synchronization, encapsulating data and locking thread entries automatically for concurrent access.

Intermediate
23. What is overloading?

Ada allows overloading, enabling multiple subprograms to declare identical names provided their signature parameters vary.

Ada
procedure Display(Item : Integer); procedure Display(Item : Float);
Intermediate
24. What is recursion?

Recursion occurs when subprograms execute self-calls recursively to partition mathematical problems into manageable chunks.

Intermediate
25. What is pragma?

A pragma is a compiler directive used to configure optimizations, constraints, calling profiles, or target behaviors directly.

Ada
pragma Optimize(Time); -- Instructs compiler to focus on execution speed
Intermediate
26. What is range constraint?

Range constraints restrict variable domains dynamically, catching overflow logic errors automatically via runtime type-checking engines.

Intermediate
27. What is dynamic allocation example?

Memory allocations are safely structured using pointer constructors inside active heap spaces.

Ada
Ptr : access Integer := new Integer'(10);
Intermediate
28. What is discriminated record?

Discriminated records function similarly to variant records, altering structural properties based on dynamic discriminant variables.

Ada
type Buffer(Size : Positive) is record Data : String(1 .. Size); end record;
Intermediate
29. What is task entry?

Task entries establish structured communication interfaces to accept parameter payloads safely across thread boundaries.

Ada
task Server is entry Get_Status(Code : out Integer); end Server;
Intermediate
30. What is delay statement?

Delay statements yield task executions temporarily, pausing threads for precise durations.

Ada
delay 2.5; -- Pause task execution for 2.5 seconds
Advanced
36. What is real-time support in Ada?

Ada provides native, deterministic scheduling models, priority-inversion controls, and clock systems vital for high-reliability embedded targets.

Ada
pragma Priority(Interrupt_Priority'Last);
Advanced
37. What is Ravenscar profile?

The Ravenscar Profile is a specialized tasking subset that guarantees deterministic, analyzable, and safety-certifiable real-time concurrency.

Ada
 pragma Profile(Ravenscar);
Advanced
38. What is contract-based programming?

Contract-based programming leverages Pre (preconditions) and Post (postconditions) aspects to mathematically verify subprogram correct states at boundaries.

Ada
procedure Deposit(Amount : Positive) with Pre  => Amount > 0, Post => Balance = Balance'Old + Amount;
Advanced
39. What is SPARK Ada?

SPARK is a specialized language subset and formal verification toolset. It mathematically proves the absence of runtime errors (like division by zero or buffer overflows) and verifies correctness.

Ada
procedure Safety_Critical_Process with SPARK_Mode => On;