Python Medium technical 1 views 1 min read

Can you name ten built-in functions in Python and explain each in brief?

Peer-reviewed by HireXTech Technical Panel Updated for 2025/2026 hiring Editorial standards
Practise this track
Interviewer Expectations for this Question
01
Core Competency

Assesses fundamental understanding of Python conventions, runtime behavior, and memory/performance considerations.

02
Evaluation Criteria

Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.

Comprehensive Model Answer Verified Solution

Ten Built-in Functions, you say? Okay, here you go.

complex()- Creates a complex number.

>>> complex(3.5,4)

(3.5+4j)

eval()- Parses a string as an expression.

>>> eval('print(max(22,22.0)-min(2,3))')

20

filter()- Filters in items for which the condition is true.

>>> list(filter(lambda x:x%2==0,[1,2,0,False]))

[2, 0, False]

format()- Lets us format a string.

>>> print("a={0} but b={1}".format(a,b))

a=2 but b=3

hash()- Returns the hash value of an object.

>>> hash(3.7)

644245917

hex()- Converts an integer to a hexadecimal.

>>> hex(14)

'0xe'

input()- Reads and return s a line of string.

>>> input('Enter a number')

Enter a number7

'7'
len()- Returns the length of an object.

>>> len('Ayushi')

6

locals()- Returns a dictionary of the current local symbol table.

>>> locals()

{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, 'a': 2, 'b': 3}

open()- Opens a file.

>>> file=open('tabs.txt')

Candidate Response Strategy & Interview Tips

  1. Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
  2. Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
  3. Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
  4. Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.
Related Topics & Skills
Spotted an error or have an alternative solution?