Coding Skills Flashcards
7 cards from real Mettl practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Coding Skills flashcards as text
What is the primary purpose of an abstract class in Java?
Answer: To define a template with some methods left for subclasses to implement
Abstract classes define partial implementations and enforce contracts via abstract methods that subclasses must implement.
Which of the following correctly identifies a stack overflow?
Answer: Exceeding the call stack limit, often due to infinite recursion
A stack overflow occurs when recursive (or deeply nested) calls exhaust the fixed-size call stack.
In CSS, which selector has the highest specificity?
Answer: ID selector (e.g., `#header`)
ID selectors carry the highest specificity weight (0,1,0,0) among standard CSS selectors.
What is the difference between '==' and '===' in JavaScript?
Answer: '==' checks value only with type coercion; '===' checks value and type strictly
'==' performs type coercion before comparing, while '===' requires both value and type to match.
Which of the following is an example of a linear data structure?
Answer: Linked List
A linked list is linear because elements are arranged sequentially, each pointing to the next.
In Big O notation, what does O(1) represent?
Answer: The algorithm's runtime is constant regardless of input size
O(1) means the operation takes the same amount of time no matter how large the input is.
Which concept allows a function to call itself with a smaller sub-problem until a base case is reached?
Answer: Recursion
Recursion is the technique where a function calls itself, breaking the problem down until a base case terminates the calls.