71 questions for “Data Types & Structures”

Found in 1 field. Select a question to see its full answer.

Information Technology

71 questions in 4 technologies

#QuestionTechnologyTopicLevel
1What's the difference between shallow copy and deep copy for a nested data structure, and which functions perform each? Python › Data Types & StructuresPythonData Types & StructuresIntermediate
2How would you implement a custom, memory-efficient data structure using __slots__ instead of a regular class with a __dict__? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
3How do dictionaries maintain insertion order internally since Python 3.7, and what data structure change made this both possible and efficient? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
4How would you use collections.Counter to efficiently count occurrences and find the most common elements in a large dataset? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
5How would you choose between a list, a set, a dict, and a specialized structure like heapq for efficiently finding the K smallest/largest elements in a large dataset? Python › Data Types & StructuresPythonData Types & StructuresAdvanced
6What is the difference between a set and a list in terms of uniqueness and ordering? Python › Data Types & StructuresPythonData Types & StructuresBeginner
7What is the difference between a Python list and a tuple? Python › Data Types & StructuresPythonData Types & StructuresBeginner
8How do you access, add, and remove items from a dictionary? Python › Data Types & StructuresPythonData Types & StructuresBeginner
9How do slicing operations work on a list, including negative indices and step values? Python › Data Types & StructuresPythonData Types & StructuresIntermediate
10Why must dictionary keys (and set elements) be hashable, and what makes an object hashable in Python? Python › Data Types & StructuresPythonData Types & StructuresIntermediate