The screen was a live technical interview run by a Karat interviewer over a shared screen, and it opened with a bug-fix on a given codebase and then a coding problem. I took the Citi Karat interview for a new-grad software engineer role in 2026, on the Java and Spring backend track. Using dictkey throws an error if the key is missing, while dict.get(key) returns None or a default value, this is useful when you are not sure if a key exists, so get() is safer in scripts, while indexing is good when the key must be present. The finally block always runs, even if there is a return in try or except, so if you also put a return inside finally, it will replace the earlier return, which is confusing and often a bug, this is why people avoid returning from finally in real code. A shallow copy copies only the outer https://uvik.io/ object, so inner objects are still shared, while a deep copy copies everything fully, this matters when your data has nested lists or dicts, because changing inner data in a shallow copy also changes the original. Exit codes tell the system if your script succeeded or failed, zero means success and any non-zero means error, you can control this using sys.exit(), this is important in automation because other tools check exit codes to know what to do next.
Lambda functions are generally inline, anonymous functions represented by a single expression. Python modules are the files having python code which can be functions, variables or classes. A python module is created by saving a file with the extension of .py. A module can import other modules (other python files) as objects. It returns the shape of the array in terms of row count and column count of the array. We can use the shape attribute of the numpy array to find the shape.
- Python library offers a feature – serialization out of the box.
- Repartition() and coalesce() are Spark operations used to change the number of partitions in an RDD, DataFrame, or Dataset.
- You first count how many times each item appears using a dictionary, then you use something like a heap or sorting to pick the top K, for interviews sorting is simple to explain, but heap is better for big data, this approach avoids checking every pair and is fast enough for real use.
- He is facing issues on creating unique folder names for the operating system .
- Next, I would review ETL logs for errors or rejected records, fix the issue, rerun the ETL job, and validate the target data for accuracy and completeness.
In the rapidly evolving field of data analytics, proficiency in Python has become indispensable. Whether you’re a data scientist, engineer, researcher, or developer, mastering NumPy is essential for efficient data manipulation, scientific computing, and machine learning. This comprehensive course is designed to take you from a beginner’s understanding to an advanced level of proficiency in NumPy. Unlock the full potential of Python’s most essential library for numerical computing, NumPy.
Can You Differentiate Between Responsive, Fixed And Fluid Website Design?
This is a classic interview question designed to test your understanding of basic string manipulation and loop constructs. Understanding Python’s tools for concurrency and parallelism is essential. While we touched upon basic decorators earlier, a deeper dive into their more complex applications and the esoteric world of metaclasses can truly set you apart. Python’s memory management and the infamous Global Interpreter Lock (GIL) are often misunderstood but crucial topics, especially when discussing performance and concurrency. These concepts are vital for handling large datasets efficiently without consuming excessive memory. For those aiming for more senior roles, or simply looking to truly impress your interviewers, diving into these advanced Python topics can be a game-changer.
LTIMindtree Interview Experiences
We opted for a multiprocessing approach, dividing the workload among multiple processes to leverage the full power of available CPU cores. However, due to the GIL, achieving true parallelism with threads was challenging. Since the GIL is released during these waiting periods, it doesn’t impede the overall performance in such scenarios.