{"id":32623,"date":"2023-03-29T06:07:50","date_gmt":"2023-03-29T13:07:50","guid":{"rendered":"https:\/\/coderpad.io\/?post_type=interview-questions&#038;p=32623"},"modified":"2025-09-12T06:25:41","modified_gmt":"2025-09-12T13:25:41","slug":"python-interview-questions","status":"publish","type":"interview-questions","link":"https:\/\/coderpad.io\/interview-questions\/python-interview-questions\/","title":{"rendered":"Python"},"content":{"rendered":"\n<p>Regularly considered one of the most in-demand languages across the world, Python continues to gain a dedicated following due to its superior support for data processing and manipulation.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>According to the <a href=\"https:\/\/coderpad.io\/blog\/hiring-developers\/top-10-in-demand-programming-languages\/\">CoderPad 2024 Developer survey<\/a>, Python is THE most in-demand language among technical recruiters and hiring managers.<\/p>\n<\/blockquote>\n\n\n\n<p>Below you\u2019ll see examples of realistic coding exercises and interview questions that will help you evaluate developers\u2019 Python skills during coding interviews.&nbsp;<\/p>\n\n\n\n<p>You\u2019ll also find a set best practices to ensure your interview questions accurately assess the Python skills of your candidates.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav aria-label=\"Table of Contents\"><ul><li><a href=\"#python-example-question\">Python example question<\/a><ul><\/ul><\/li><li><a href=\"#junior-python-interview-questions\">Junior Python interview questions<\/a><\/li><li><a href=\"#intermediate-python-interview-questions\">Intermediate Python interview questions<\/a><\/li><li><a href=\"#senior-python-interview-questions\">Senior Python interview questions<\/a><\/li><li><a href=\"#more-python-interview-resources\">More Python interview resources<\/a><\/li><li><a href=\"#interview-best-practices-for-python-roles\">Interview best practices for Python roles<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"python-example-question\"><strong>Python example question<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"can-you-fix-this-python-function\">Can you fix this Python function?<\/h3>\n\n\n\n<p>This function works as expected, but it\u2019s very slow on large test cases. Can you figure out what\u2019s wrong and fix it without changing its statistical distribution?<\/p>\n\n\n\n<p>Make the <code>generate_random_list<\/code> function run faster than 100ms for both tests.<\/p>\n\n\n<div\n\tclass=\"sandbox-embed responsive-embed \"\n\tstyle=\"padding-top: 85%\"\ndata-block-name=\"coderpad-sandbox-embed\">\n\t<iframe src=\"https:\/\/embed.coderpad.io\/sandbox?question_id=247256u0026use_question_button\" width=\"640\" height=\"544\" loading=\"lazy\" aria-label=\"Try out the CoderPad sandbox\"><\/iframe>\n<\/div>\n\n\n<section class=\"\n\ticon-lists-block\n\t\n\" data-block-name=\"coderpad-icon-lists-block\">\n    <div class=\"inner\">\n\n    \n            <div class=\"lists lists--2\">\n                            <div class=\"icon-list\">\n        <div class=\"top\">\n                            <div class=\"icon-container\">\n                    <svg class=\"icon icon-lightning-bolt\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" fill=\"none\" viewBox=\"0 0 10 14\"><title>lightning bolt<\/title><path fill=\"currentColor\" d=\"M3.608 13.967c.185.079.4.013.508-.158l4.922-7.82a.41.41 0 0 0-.347-.63H5.407L6.628.511a.41.41 0 0 0-.744-.32L.962 8.011a.41.41 0 0 0 .347.63h3.284l-1.221 4.848a.41.41 0 0 0 .236.478Z\"\/><\/svg>\n\n                <\/div>\n            \n                            <h3 class=\"title\">Python skills to assess<\/h3>\n                    <\/div>\n\n                    <ul class=\"links\">\n                                    <li>\n                        <a >Data manipulation<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Problem solving<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Data visualization<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Object-oriented programming<\/a>\n                    <\/li>\n                            <\/ul>\n        <\/div>\n\n                            <div class=\"icon-list\">\n        <div class=\"top\">\n                            <div class=\"icon-container\">\n                    <svg class=\"icon icon-briefcase\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 25 26\" fill=\"none\"><title>briefcase<\/title><path fill=\"currentColor\" d=\"M5.469 16.125a5.446 5.446 0 0 1-3.907-1.648v6.335a2.35 2.35 0 0 0 2.344 2.344h17.188a2.35 2.35 0 0 0 2.343-2.343v-6.336a5.446 5.446 0 0 1-3.906 1.648H5.47Z\"\/><path fill=\"currentColor\" d=\"M21.094 5.969h-3.125v-.782a2.344 2.344 0 0 0-2.344-2.343h-6.25a2.344 2.344 0 0 0-2.344 2.344v.78H3.906a2.35 2.35 0 0 0-2.344 2.345v2.343a3.906 3.906 0 0 0 3.907 3.906h2.343V12.22a.781.781 0 1 1 1.563 0v2.344h6.25v-2.344a.781.781 0 1 1 1.563 0v2.344h2.343a3.907 3.907 0 0 0 3.907-3.907V8.312a2.351 2.351 0 0 0-2.344-2.343Zm-12.5-.782a.781.781 0 0 1 .781-.78h6.25a.781.781 0 0 1 .781.78v.782H8.594v-.782Z\"\/><\/svg>\n\n                <\/div>\n            \n                            <h3 class=\"title\">Jobs using Python<\/h3>\n                    <\/div>\n\n                    <ul class=\"links\">\n                                    <li>\n                        <a >Django developer<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Python engineer<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Data analyst\/scientist<\/a>\n                    <\/li>\n                                    <li>\n                        <a >Machine learning engineer<\/a>\n                    <\/li>\n                            <\/ul>\n        <\/div>\n\n                    <\/div>\n    \n    <\/div>\n<\/section>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"junior-python-interview-questions\">Junior Python interview questions<\/h2>\n\n\n\n<p><strong>Question: What is the difference between a tuple and a list in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A list is a mutable sequence of elements, while a tuple is an immutable sequence of elements. This means that you can modify a list by adding, removing or changing elements, but you cannot do the same with a tuple.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to find the sum of the even numbers in a list. What is wrong with the code, and how can it be fixed?<\/strong><\/p>\n\n\n\n<p><strong>Answer:&nbsp;<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">numbers = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>]\ntotal = <span class=\"hljs-number\">0<\/span>\n  <span class=\"hljs-keyword\">for<\/span> number <span class=\"hljs-keyword\">in<\/span> numbers:\n  \u00a0\u00a0<span class=\"hljs-keyword\">if<\/span> number % <span class=\"hljs-number\">2<\/span> == <span class=\"hljs-number\">0<\/span>\n   \u00a0\u00a0\u00a0total += number\nprint(total)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is missing a colon after the if statement. The fixed code is:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">numbers = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>]\n\ntotal = <span class=\"hljs-number\">0<\/span>\n<span class=\"hljs-keyword\">for<\/span> number in numbers:\n  <span class=\"hljs-keyword\">if<\/span> number % <span class=\"hljs-number\">2<\/span> == <span class=\"hljs-number\">0<\/span>:\n  \u00a0\u00a0total += number\n<span class=\"hljs-keyword\">print<\/span>(total)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What is the difference between a function and a method in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A function is a standalone block of code that performs a specific task, while a method is a function that is associated with an object and can access and modify its data.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a dictionary with the keys and values reversed from the original dictionary. What is wrong with the code, and how can it be fixed?<\/strong><\/p>\n\n\n\n<p><strong>Answer:&nbsp;<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">original_dict = {<span class=\"hljs-string\">\"one\"<\/span>: <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-string\">\"two\"<\/span>: <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-string\">\"three\"<\/span>: <span class=\"hljs-number\">3<\/span>}\n\nreversed_dict = {}\n\n<span class=\"hljs-keyword\">for<\/span> key, value <span class=\"hljs-keyword\">in<\/span> original_dict.items():\n    reversed_dict&#91;value] = key\nprint(reversed_dict)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is correct.<\/p>\n\n\n\n<p><strong>Question: What is the difference between a while loop and a for loop in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A for loop is used to iterate over a sequence, such as a list or a string, while a while loop is used to repeat a block of code as long as a certain condition is true.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a list of the squares of the first five integers. What is wrong with the code, and how can it be fixed?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong>&nbsp;<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">squares = &#91;]\n\n<span class=\"hljs-keyword\">for<\/span> i <span class=\"hljs-keyword\">in<\/span> range(<span class=\"hljs-number\">5<\/span>)\n\u00a0\u00a0squares.append(i ** <span class=\"hljs-number\">2<\/span>)\nprint(squares)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is missing a colon after the for statement. The fixed code is:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">squares = &#91;]\n<span class=\"hljs-keyword\">for<\/span> i <span class=\"hljs-keyword\">in<\/span> range(<span class=\"hljs-number\">5<\/span>):\n\u00a0\u00a0squares.append(i ** <span class=\"hljs-number\">2<\/span>)\nprint(squares)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What is the difference between the &#8220;is&#8221; operator and the &#8220;==&#8221; operator in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The &#8220;<code>is<\/code>&#8221; operator checks if two objects are the same object, while the &#8220;<code>==<\/code>&#8221; operator checks if two objects have the same value.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to remove all the even numbers from a list. What is wrong with the code, and how can it be fixed?<\/strong><\/p>\n\n\n\n<p><strong>Answer:&nbsp;<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">numbers = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>]\n\n<span class=\"hljs-keyword\">for<\/span> number <span class=\"hljs-keyword\">in<\/span> numbers:\n\n<span class=\"hljs-keyword\">if<\/span> number % <span class=\"hljs-number\">2<\/span> == <span class=\"hljs-number\">0<\/span>\n\n\u00a0\u00a0numbers.remove(number)\n\nprint(numbers)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is modifying the list while iterating over it, which can lead to unexpected results. The fixed code is to create a new list instead:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">numbers = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>]\n\nodd_numbers = &#91;]\n\n<span class=\"hljs-keyword\">for<\/span> number <span class=\"hljs-keyword\">in<\/span> numbers:\n\n<span class=\"hljs-keyword\">if<\/span> number % <span class=\"hljs-number\">2<\/span> != <span class=\"hljs-number\">0<\/span>:\n\n\u00a0\u00a0odd_numbers.append(number)\n\nprint(odd_numbers)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What is the purpose of the <code>pass<\/code> statement in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The <code>pass<\/code> statement is used as a placeholder when a statement is required syntactically, but no code needs to be executed.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a list of the first five even numbers. What is wrong with the code, and how can it be fixed?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">even_numbers = &#91;<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">8<\/span>]<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is correct.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"intermediate-python-interview-questions\">Intermediate Python interview questions<\/h2>\n\n\n\n<p><strong>Question: What is a generator in Python? How is it different from a regular function?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A generator is a special type of function in Python that returns an iterator object, which can be iterated over using a <code>for<\/code> loop. The key difference between a generator and a regular function is that a generator can <code>yield<\/code> values one at a time, whereas a regular function <code>returns<\/code> all values at once. This makes generators more memory-efficient, as they do not need to generate all values at once and store them in memory.<\/p>\n\n\n\n<p><strong>Question: What is the difference between a class method and an instance method in Python?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A class method is a method that is bound to the class and not the instance of the class. It can be called on the class itself, without the need to create an instance of the class. An instance method, on the other hand, is bound to the instance of the class and can only be called on an instance of the class.<\/p>\n\n\n\n<p><strong>Question: What is the purpose of the <code>__str__<\/code> method in Python classes? How is it different from the <code>__repr__<\/code> method?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The <code>__str__<\/code> method is used to define the string representation of an object, and is typically used for displaying the object to end-users. The <code>__repr__<\/code> method, on the other hand, is used to define the &#8220;official&#8221; string representation of an object, and is typically used for debugging and development purposes. The main difference between the two is that <code>__str__<\/code> is called when <code>str()<\/code> is called on an object, while <code>__repr__<\/code> is called when <code>repr()<\/code> is called on an object.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a class for a basic calculator, but it is not working correctly. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Calculator<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.result = <span class=\"hljs-number\">0<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">add<\/span><span class=\"hljs-params\">(self, num1, num2)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.result = num1 + num2\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">subtract<\/span><span class=\"hljs-params\">(self, num1, num2)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.result = num1 - num2<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The <code>add<\/code> and <code>subtract<\/code> methods are not actually returning any values, so they are not useful for external code that wants to use the calculator. To fix this, we can modify the methods to return the result instead of storing it as an attribute of the object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Calculator<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.result = <span class=\"hljs-number\">0<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">add<\/span><span class=\"hljs-params\">(self, num1, num2)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">return<\/span> num1 + num2\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">subtract<\/span><span class=\"hljs-params\">(self, num1, num2)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">return<\/span> num1 - num2<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What is a lambda function in Python? How is it different from a regular function?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A lambda function is a small anonymous function in Python that can have any number of arguments, but can only have one expression. The main difference between a lambda function and a regular function is that a lambda function is defined inline, without a name, and is typically used as a simple, one-line function that is not reusable.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a generator function that returns a Fibonacci sequence, but it is not working correctly. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">fibonacci<\/span><span class=\"hljs-params\">()<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0a, b = <span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">while<\/span> <span class=\"hljs-literal\">True<\/span>:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">yield<\/span> a\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0a, b = b, a + b<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The code looks correct, but the starting values for <code>a<\/code> and <code>b<\/code> should be <code>0<\/code> and <code>1<\/code>, respectively. The current code initializes <code>a<\/code> as <code>1<\/code> and <code>b<\/code> as <code>2<\/code>, which does not generate the correct Fibonacci sequence.<\/p>\n\n\n\n<p><strong>Question: What is a metaclass in Python? How is it different from a regular class?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A metaclass is a class that defines the behavior of other classes. It is used to customize the creation of classes and their instances, and can be used to enforce certain constraints or provide additional functionality to classes. The main difference between a metaclass and a regular class is that a metaclass is used to define the behavior of other classes, whereas a regular class is used to define objects that can be instantiated and used in a program.<\/p>\n\n\n\n<p><strong>Question: The following code is supposed to create a class that represents a bank account, but it is not working correctly. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">BankAccount<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, balance)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance = balance\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">deposit<\/span><span class=\"hljs-params\">(self, amount)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance += amount\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">withdraw<\/span><span class=\"hljs-params\">(self, amount)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance -= amount\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">check_balance<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(<span class=\"hljs-string\">\"Your balance is: \"<\/span>, self.balance)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The code looks correct, but there is no error handling for situations where the user tries to withdraw more money than they have in their account. To fix this, we can add a check in the <code>withdraw<\/code> method to ensure that the amount being withdrawn does not exceed the current balance:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">BankAccount<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, balance)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance = balance\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">deposit<\/span><span class=\"hljs-params\">(self, amount)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance += amount\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">withdraw<\/span><span class=\"hljs-params\">(self, amount)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">if<\/span> amount &gt; self.balance:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">raise<\/span> ValueError(<span class=\"hljs-string\">\"Insufficient funds\"<\/span>)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0self.balance -= amount\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">check_balance<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(<span class=\"hljs-string\">\"Your balance is: \"<\/span>, self.balance)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: The following code is supposed to create a function that takes a list of integers and returns only the even numbers, but it is not working correctly. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_even_numbers<\/span><span class=\"hljs-params\">(numbers)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0even_numbers = &#91;x <span class=\"hljs-keyword\">for<\/span> x <span class=\"hljs-keyword\">in<\/span> numbers <span class=\"hljs-keyword\">if<\/span> x % <span class=\"hljs-number\">2<\/span> == <span class=\"hljs-number\">0<\/span>]\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">return<\/span> even_numbers<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The code looks correct, but it can be improved by using a generator expression instead of a list comprehension to generate the even numbers on the fly and save memory:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_even_numbers<\/span><span class=\"hljs-params\">(numbers)<\/span>:<\/span>\n\n\u00a0\u00a0\u00a0\u00a0even_numbers = (x <span class=\"hljs-keyword\">for<\/span> x <span class=\"hljs-keyword\">in<\/span> numbers <span class=\"hljs-keyword\">if<\/span> x % <span class=\"hljs-number\">2<\/span> == <span class=\"hljs-number\">0<\/span>)\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-keyword\">return<\/span> even_numbers<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What is the difference between a generator function and a normal function in Python? Provide an example of a generator function.<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Generator function is a type of function that yields a sequence of values instead of returning a single value.<\/li>\n\n\n\n<li>Normal function returns a single value and then exits.<\/li>\n\n\n\n<li>Generator functions use the <code>yield<\/code> keyword to return a value and pause the execution of the function.<\/li>\n\n\n\n<li>Normal functions use the <code>return<\/code> keyword to return a value and immediately exit the function.<\/li>\n<\/ul>\n\n\n\n<p>Example of a generator function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">my_generator<\/span><span class=\"hljs-params\">(n)<\/span>:<\/span>\n    i = <span class=\"hljs-number\">0<\/span>\n    <span class=\"hljs-keyword\">while<\/span> i &lt; n:\n        <span class=\"hljs-keyword\">yield<\/span> i\n        i += <span class=\"hljs-number\">1<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This generator function returns a sequence of numbers from 0 to n-1. It does not use the <code>return<\/code> keyword but instead uses <code>yield<\/code> to pause and resume the function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"senior-python-interview-questions\">Senior Python interview questions<\/h2>\n\n\n\n<p><strong>Question: What is the purpose of lambda functions in Python, and how are they different from regular functions?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> Lambda functions are used to create small, anonymous functions that can be used in place of regular functions. They are different from regular functions in that they do not have a name and can only contain a single expression.<\/p>\n\n\n\n<p><strong>Question: What is a generator function in Python, and how is it different from a regular function?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> A generator function is a special type of function that can be used to generate a sequence of values on-the-fly. It is different from a regular function in that it uses the &#8220;yield&#8221; keyword to return values one-at-a-time instead of returning a list of all values at once.<\/p>\n\n\n\n<p><strong>Question: What is the purpose of the &#8220;yield&#8221; keyword in Python, and how is it used in generator functions?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> The <code>yield<\/code> keyword is used in generator functions to return a value and temporarily suspend the function&#8217;s execution. When the generator function is called again, it resumes execution from the point it left off and continues generating values one-at-a-time.<\/p>\n\n\n\n<p><strong>Question: What is meta-programming in Python, and how is it used?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> Meta-programming is writing code that can manipulate code at runtime. It is used to create generic, reusable code, or to modify the behavior of existing code dynamically.<\/p>\n\n\n\n<p><strong>Question: This code is supposed to create a generator that yields the first n numbers in the Fibonacci sequence. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">   <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">fibonacci<\/span><span class=\"hljs-params\">(n)<\/span>:<\/span>\n       a, b = <span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>\n       <span class=\"hljs-keyword\">for<\/span> i <span class=\"hljs-keyword\">in<\/span> range(n):\n           <span class=\"hljs-keyword\">yield<\/span> b\n           a, b = b, a+b\n\n   print(fibonacci(<span class=\"hljs-number\">5<\/span>))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The code is correct, but the <code>print()<\/code> statement is printing the generator object instead of the sequence of numbers. To print the sequence of numbers, you can convert the generator to a list:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-18\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">   <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">fibonacci<\/span><span class=\"hljs-params\">(n)<\/span>:<\/span>\n       a, b = <span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>\n       <span class=\"hljs-keyword\">for<\/span> i <span class=\"hljs-keyword\">in<\/span> range(n):\n           <span class=\"hljs-keyword\">yield<\/span> b\n           a, b = b, a+b\n\n   print(list(fibonacci(<span class=\"hljs-number\">5<\/span>)))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-18\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: This code is supposed to return a list of all odd numbers from the input list. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-19\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">  <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_odd_numbers<\/span><span class=\"hljs-params\">(nums)<\/span>:<\/span>\n     odd_nums = filter(<span class=\"hljs-keyword\">lambda<\/span> num: num % <span class=\"hljs-number\">2<\/span>)\n     <span class=\"hljs-keyword\">return<\/span> list(odd_nums)\n  nums = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">10<\/span>]\n  print(get_odd_numbers(nums))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-19\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The lambda function inside the&nbsp;filter()&nbsp;function is missing the argument&nbsp;nums&nbsp;in the expression. The corrected code is:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-20\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"> <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">get_odd_numbers<\/span><span class=\"hljs-params\">(nums)<\/span>:<\/span>\n     odd_nums = filter(<span class=\"hljs-keyword\">lambda<\/span> num: num % <span class=\"hljs-number\">2<\/span>, nums)\n     <span class=\"hljs-keyword\">return<\/span> list(odd_nums)\nnums = &#91;<span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">4<\/span>, <span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">10<\/span>]\nprint(get_odd_numbers(nums))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-20\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Question: What are decorators in Python, and how are they used?<\/strong><\/p>\n\n\n\n<p><strong>Answer:<\/strong> Decorators are a way to modify the behavior of a function or class in Python without changing its source code. They are implemented as callable objects that take another function or class as an argument and return a modified version of it.<\/p>\n\n\n\n<p><strong>Question: This code is supposed to use a lambda function to sort a list of dictionaries by the value of a specific key. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-21\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\">data = &#91;{<span class=\"hljs-string\">'name'<\/span>: <span class=\"hljs-string\">'Alice'<\/span>, <span class=\"hljs-string\">'age'<\/span>: <span class=\"hljs-number\">28<\/span>}, {<span class=\"hljs-string\">'name'<\/span>: <span class=\"hljs-string\">'Bob'<\/span>, <span class=\"hljs-string\">'age'<\/span>: <span class=\"hljs-number\">21<\/span>}, {<span class=\"hljs-string\">'name'<\/span>: <span class=\"hljs-string\">'Charlie'<\/span>, <span class=\"hljs-string\">'age'<\/span>: <span class=\"hljs-number\">35<\/span>}]\n\nsorted_data = sorted(data, key=<span class=\"hljs-keyword\">lambda<\/span> x: x&#91;<span class=\"hljs-string\">'age'<\/span>])\nprint(sorted_data)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-21\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer: <\/strong><\/p>\n\n\n\n<p>The code is correct and will sort the list of dictionaries by the age key.<\/p>\n\n\n\n<p><strong>Question: This code is supposed to create a metaclass that allows classes to be initialized with a dictionary of attributes. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-22\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">DictMeta<\/span><span class=\"hljs-params\">(type)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__new__<\/span><span class=\"hljs-params\">(mcs, name, bases, attrs)<\/span>:<\/span>\n        obj = super().__new__(mcs, name, bases, attrs)\n        obj.__dict__.update(attrs)\n        <span class=\"hljs-keyword\">return<\/span> obj\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyClass<\/span><span class=\"hljs-params\">(metaclass=DictMeta)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, data)<\/span>:<\/span>\n        self.data = data\n\nmy_instance = MyClass({<span class=\"hljs-string\">'name'<\/span>: <span class=\"hljs-string\">'Alice'<\/span>, <span class=\"hljs-string\">'age'<\/span>: <span class=\"hljs-number\">28<\/span>})\nprint(my_instance.name, my_instance.age)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-22\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-23\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">DictMeta<\/span><span class=\"hljs-params\">(type)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__new__<\/span><span class=\"hljs-params\">(mcs, name, bases, attrs, **kwargs)<\/span>:<\/span>\n        new_attrs = {}\n        <span class=\"hljs-keyword\">for<\/span> key, value <span class=\"hljs-keyword\">in<\/span> attrs.items():\n            <span class=\"hljs-keyword\">if<\/span> isinstance(value, dict):\n                new_attrs.update(value)\n            <span class=\"hljs-keyword\">else<\/span>:\n                new_attrs&#91;key] = value\n        <span class=\"hljs-keyword\">return<\/span> super().__new__(mcs, name, bases, new_attrs)\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyClass<\/span><span class=\"hljs-params\">(metaclass=DictMeta)<\/span>:<\/span>\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">__init__<\/span><span class=\"hljs-params\">(self, name=None, age=None)<\/span>:<\/span>\n        self.name = name\n        self.age = age\n\nmy_instance = MyClass({<span class=\"hljs-string\">'name'<\/span>: <span class=\"hljs-string\">'Alice'<\/span>, <span class=\"hljs-string\">'age'<\/span>: <span class=\"hljs-number\">28<\/span>})\nprint(my_instance.name, my_instance.age)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-23\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In the <code>DictMeta<\/code> class, the <code>__new__<\/code> method should call <code>__init__<\/code> instead of <code>obj.__dict__.update(attrs)<\/code> to properly initialize the attributes of the class. In the <code>MyClass<\/code> class, the <code>__init__<\/code> method should update the <code>__dict__<\/code> attribute of the instance with the <code>data<\/code> parameter to properly initialize the instance attributes.<\/p>\n\n\n\n<p><strong>Question: This code is supposed to use a generator function to yield all prime numbers up to a given limit. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-24\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">primes<\/span><span class=\"hljs-params\">(limit)<\/span>:<\/span>\n    i = <span class=\"hljs-number\">2<\/span>\n    <span class=\"hljs-keyword\">while<\/span> i &lt; limit:\n        <span class=\"hljs-keyword\">for<\/span> j <span class=\"hljs-keyword\">in<\/span> range(<span class=\"hljs-number\">2<\/span>, i):\n            <span class=\"hljs-keyword\">if<\/span> i % j == <span class=\"hljs-number\">0<\/span>:\n                <span class=\"hljs-keyword\">break<\/span>\n        <span class=\"hljs-keyword\">else<\/span>:\n            <span class=\"hljs-keyword\">yield<\/span> i\n        i += <span class=\"hljs-number\">1<\/span>\n\nprint(list(primes(<span class=\"hljs-number\">20<\/span>)))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-24\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> The code is correct and will generate a list of prime numbers up to 20.<\/p>\n\n\n\n<p><strong>Question: This code is supposed to use a context manager to open a file, write some data to it, and then automatically close the file. Fix the code.<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-25\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python shcb-wrap-lines\"><span class=\"hljs-keyword\">with<\/span> open(<span class=\"hljs-string\">'output.txt'<\/span>, <span class=\"hljs-string\">'w'<\/span>) <span class=\"hljs-keyword\">as<\/span> f:\n    f.write(<span class=\"hljs-string\">'hello, world'<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-25\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Answer:<\/strong> <\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-26\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">with<\/span> open(<span class=\"hljs-string\">'output.txt'<\/span>, <span class=\"hljs-string\">'w'<\/span>) <span class=\"hljs-keyword\">as<\/span> f:\n    f.write(<span class=\"hljs-string\">'hello, worldn'<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-26\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The code is correct, but it should include a newline character at the end of the string to properly format the output in the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"more-python-interview-resources\">More Python interview resources<\/h2>\n\n\n\n<p>For more guides on improving your knowledge of Python and acing interviews, we have outlined helpful blog posts below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/coderpad.io\/blog\/development\/classes-object-oriented-programming-python\/\">Guide to Classes and Object-Oriented Programming in Python<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/coderpad.io\/blog\/development\/python-list-comprehension-guide\/\">Python List Comprehension \u2013 The Comprehensive Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/coderpad.io\/blog\/development\/an-introduction-to-linked-list-data-structures\/\">An Introduction to Linked List Data Structures<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/coderpad.io\/blog\/development\/testing-in-python-types-of-tests-and-how-to-write-them\/\">Testing in Python: Types of Tests and How to Write Them<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/coderpad.io\/blog\/coding-challenges\/tiny-interview-python-unit-testing\/\">Code Challenge: Python Unit Testing<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.codingame.com\/work\/python-interview-questions\/\" target=\"_blank\" rel=\"noopener\">Python Interview Questions by Codingame<\/a><\/li>\n<\/ul>\n\n\n<section class=\"logo-row-block\">\n    <div class=\"inner\">\n                    <h2 class=\"headline\">1,000 Companies use CoderPad to Screen and Interview Developers<\/h2>\n        \n                    <div class=\"logos logos--grayscale\" >\n                                    <div>    <svg class=\"logo logo-spotify\" role=\"img\" viewBox=\"0 0 538 167\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><title>Spotify<\/title><path d=\"M83.743 0C37.494 0 0 37.493 0 83.742c0 46.251 37.494 83.741 83.743 83.741 46.254 0 83.744-37.49 83.744-83.741 0-46.246-37.49-83.738-83.745-83.738L83.743 0zm38.404 120.78a5.217 5.217 0 0 1-7.18 1.73c-19.662-12.01-44.414-14.73-73.564-8.07a5.222 5.222 0 0 1-6.249-3.93 5.213 5.213 0 0 1 3.926-6.25c31.9-7.288 59.263-4.15 81.337 9.34 2.46 1.51 3.24 4.72 1.73 7.18zm10.25-22.802c-1.89 3.072-5.91 4.042-8.98 2.152-22.51-13.836-56.823-17.843-83.448-9.761-3.453 1.043-7.1-.903-8.148-4.35a6.538 6.538 0 0 1 4.354-8.143c30.413-9.228 68.222-4.758 94.072 11.127 3.07 1.89 4.04 5.91 2.15 8.976v-.001zm.88-23.744c-26.99-16.031-71.52-17.505-97.289-9.684-4.138 1.255-8.514-1.081-9.768-5.219a7.835 7.835 0 0 1 5.221-9.771c29.581-8.98 78.756-7.245 109.83 11.202a7.823 7.823 0 0 1 2.74 10.733c-2.2 3.722-7.02 4.949-10.73 2.739h-.004zm94.56 3.072c-14.46-3.448-17.03-5.868-17.03-10.953 0-4.804 4.52-8.037 11.25-8.037 6.52 0 12.98 2.455 19.76 7.509.2.153.46.214.71.174a.933.933 0 0 0 .63-.386l7.06-9.952a.95.95 0 0 0-.18-1.288c-8.07-6.473-17.15-9.62-27.77-9.62-15.61 0-26.52 9.369-26.52 22.774 0 14.375 9.41 19.465 25.67 23.394 13.83 3.187 16.17 5.857 16.17 10.629 0 5.29-4.72 8.58-12.32 8.58-8.44 0-15.33-2.85-23.03-9.51a.98.98 0 0 0-.69-.23c-.26.02-.49.14-.65.33l-7.92 9.42c-.33.4-.29.98.09 1.32 8.96 8 19.98 12.22 31.88 12.22 16.82 0 27.69-9.19 27.69-23.42.03-12.007-7.16-18.657-24.77-22.941l-.03-.013zm62.86-14.26c-7.29 0-13.27 2.872-18.21 8.757v-6.624a.945.945 0 0 0-.94-.949h-12.95c-.52 0-.94.426-.94.949v73.601c0 .52.42.95.94.95h12.95c.52 0 .94-.43.94-.95v-23.23c4.94 5.53 10.92 8.24 18.21 8.24 13.55 0 27.27-10.43 27.27-30.369.02-19.943-13.7-30.376-27.26-30.376l-.01.001zm12.21 30.375c0 10.149-6.25 17.239-15.21 17.239-8.85 0-15.53-7.41-15.53-17.239 0-9.83 6.68-17.238 15.53-17.238 8.81-.001 15.21 7.247 15.21 17.237v.001zm50.21-30.375c-17.45 0-31.12 13.436-31.12 30.592 0 16.972 13.58 30.262 30.91 30.262 17.51 0 31.22-13.39 31.22-30.479 0-17.031-13.62-30.373-31.01-30.373v-.002zm0 47.714c-9.28 0-16.28-7.46-16.28-17.344 0-9.929 6.76-17.134 16.07-17.134 9.34 0 16.38 7.457 16.38 17.351 0 9.927-6.8 17.127-16.17 17.127zm68.27-46.53h-14.25V49.664a.944.944 0 0 0-.94-.948h-12.95c-.52 0-.95.426-.95.948V64.23h-6.22c-.52 0-.94.426-.94.949v11.127c0 .522.42.949.94.949h6.22v28.795c0 11.63 5.79 17.53 17.22 17.53 4.64 0 8.49-.96 12.12-3.02.3-.16.48-.48.48-.82v-10.6c0-.32-.17-.63-.45-.8a.918.918 0 0 0-.92-.04c-2.49 1.25-4.9 1.83-7.6 1.83-4.15 0-6.01-1.89-6.01-6.11V77.26h14.25c.52 0 .94-.426.94-.949V65.185a.918.918 0 0 0-.93-.949l-.01-.006zm49.64.057v-1.789c0-5.263 2.02-7.61 6.54-7.61 2.7 0 4.87.536 7.3 1.346.3.094.61.047.85-.132a.94.94 0 0 0 .39-.77v-10.91a.937.937 0 0 0-.67-.909c-2.56-.763-5.84-1.546-10.76-1.546-11.95 0-18.28 6.734-18.28 19.467v2.74h-6.22c-.52 0-.95.426-.95.948v11.184c0 .522.43.949.95.949h6.22v44.405c0 .53.43.95.95.95h12.94c.53 0 .95-.42.95-.95V77.258h12.09l18.52 44.402c-2.1 4.66-4.17 5.59-6.99 5.59-2.28 0-4.69-.68-7.14-2.03a1.03 1.03 0 0 0-.75-.07c-.25.09-.46.27-.56.51l-4.39 9.63c-.21.46-.03.99.41 1.23 4.58 2.48 8.71 3.54 13.82 3.54 9.56 0 14.85-4.46 19.5-16.44l22.46-58.037a.925.925 0 0 0-.1-.881.924.924 0 0 0-.77-.412h-13.48c-.41 0-.77.257-.9.636l-13.81 39.434-15.12-39.46a.944.944 0 0 0-.88-.61h-22.12v-.003zm-28.78-.057h-12.95c-.52 0-.95.426-.95.949v56.481c0 .53.43.95.95.95h12.95c.52 0 .95-.42.95-.95V65.183a.947.947 0 0 0-.95-.949v-.004zm-6.4-25.719c-5.13 0-9.29 4.152-9.29 9.281a9.289 9.289 0 0 0 9.29 9.289c5.13 0 9.28-4.157 9.28-9.289 0-5.128-4.16-9.281-9.28-9.281z\" fill=\"#1ED760\"\/><\/svg>\n\n<\/div>\n                                    <div>    <svg class=\"logo logo-linkedin\" role=\"img\" viewBox=\"0 0 882 224\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><title>LinkedIn<\/title><g fill=\"#0A66C2\"><path d=\"M0 33.083h34.482V158.69h63.84v31.822H0V33.083zM113.566 83.77h33.127v106.682h-33.127V83.77zm16.563-53.037c10.541.002 19.214 8.676 19.214 19.217 0 10.542-8.675 19.217-19.217 19.217-10.542 0-19.217-8.675-19.217-19.217 0-10.542 8.675-19.217 19.217-19.217h.003m155.137 2.326h33.127v94.083l37.544-43.42h40.615l-43.479 49.39 42.564 57.385h-41.636l-35.166-52.734h-.435v52.727h-33.127l-.007-157.43zM165.061 83.781h31.812v14.58h.452a34.841 34.841 0 0 1 31.367-17.234c33.593 0 39.776 22.102 39.776 50.815v58.503h-33.127v-51.867c0-12.38-.227-28.296-17.253-28.296-17.219 0-19.876 13.482-19.876 27.395v52.755h-33.127l-.024-106.65z\"\/><path d=\"M466.315 124.703c.003-.156.005-.313.005-.469 0-10.896-8.966-19.862-19.862-19.862-.16 0-.32.002-.482.006-11.965-.745-22.467 8.373-23.409 20.325h43.748zm28.061 47.274a58.385 58.385 0 0 1-45.3 21.226c-33.128 0-59.65-22.113-59.65-56.354 0-34.24 26.52-56.343 59.65-56.343 30.962 0 50.38 22.084 50.38 56.343v10.387h-76.889c1.97 12.124 12.685 21.038 24.965 20.77a28.298 28.298 0 0 0 23.641-13.037l23.203 17.008zm74.128-62.42c-16.563 0-26.5 11.06-26.5 27.175 0 16.115 9.933 27.184 26.5 27.184s26.526-11.042 26.526-27.184c0-16.143-9.942-27.175-26.526-27.175m57.023 80.875H595.03v-14.148h-.452a41.684 41.684 0 0 1-32.934 16.798c-31.829 0-52.796-22.972-52.796-55.457 0-29.834 18.555-57.23 49.055-57.23 13.71 0 26.516 3.751 34.028 14.148h.435V33.048h33.157l.004 157.384zm223.637.062h-33.127v-51.878c0-12.37-.22-28.296-17.229-28.296-17.254 0-19.894 13.478-19.894 27.395v52.775h-33.126V83.808h31.801v14.58h.446a34.893 34.893 0 0 1 31.377-17.233c33.575 0 39.766 22.084 39.766 50.815l-.014 58.524zM708.41 69.225h-.004c-10.546 0-19.224-8.677-19.224-19.223s8.678-19.224 19.224-19.224c10.545 0 19.222 8.676 19.224 19.22v.004c0 10.544-8.676 19.222-19.22 19.223m16.563 121.27h-33.16V83.807h33.16v106.688zM865.678.015H675.165c-8.943-.1-16.388 7.17-16.497 16.113v191.304c.105 8.948 7.55 16.228 16.497 16.132h190.513c8.97.113 16.44-7.166 16.56-16.132V16.116c-.12-8.962-7.6-16.233-16.56-16.115\"\/><\/g><\/svg>\n\n<\/div>\n                                    <div>    <svg class=\"logo logo-openai\" role=\"img\" viewBox=\"0 0 1180 320\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><title>Open AI<\/title><path d=\"m367.44 153.84c0 52.32 33.6 88.8 80.16 88.8s80.16-36.48 80.16-88.8-33.6-88.8-80.16-88.8-80.16 36.48-80.16 88.8zm129.6 0c0 37.44-20.4 61.68-49.44 61.68s-49.44-24.24-49.44-61.68 20.4-61.68 49.44-61.68 49.44 24.24 49.44 61.68z\"\/><path d=\"m614.27 242.64c35.28 0 55.44-29.76 55.44-65.52s-20.16-65.52-55.44-65.52c-16.32 0-28.32 6.48-36.24 15.84v-13.44h-28.8v169.2h28.8v-56.4c7.92 9.36 19.92 15.84 36.24 15.84zm-36.96-69.12c0-23.76 13.44-36.72 31.2-36.72 20.88 0 32.16 16.32 32.16 40.32s-11.28 40.32-32.16 40.32c-17.76 0-31.2-13.2-31.2-36.48z\"\/><path d=\"m747.65 242.64c25.2 0 45.12-13.2 54-35.28l-24.72-9.36c-3.84 12.96-15.12 20.16-29.28 20.16-18.48 0-31.44-13.2-33.6-34.8h88.32v-9.6c0-34.56-19.44-62.16-55.92-62.16s-60 28.56-60 65.52c0 38.88 25.2 65.52 61.2 65.52zm-1.44-106.8c18.24 0 26.88 12 27.12 25.92h-57.84c4.32-17.04 15.84-25.92 30.72-25.92z\"\/><path d=\"m823.98 240h28.8v-73.92c0-18 13.2-27.6 26.16-27.6 15.84 0 22.08 11.28 22.08 26.88v74.64h28.8v-83.04c0-27.12-15.84-45.36-42.24-45.36-16.32 0-27.6 7.44-34.8 15.84v-13.44h-28.8z\"\/><path d=\"m1014.17 67.68-65.28 172.32h30.48l14.64-39.36h74.4l14.88 39.36h30.96l-65.28-172.32zm16.8 34.08 27.36 72h-54.24z\"\/><path d=\"m1163.69 68.18h-30.72v172.32h30.72z\"\/><path d=\"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z\"\/><\/svg>\n\n<\/div>\n                                    <div>    <svg class=\"logo logo-shopify\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 214 61\"><title>Shopify<\/title><path fill=\"#95BF47\" d=\"M52.95 56.02 36.94 60 0 53.61s4.408-34.083 4.571-35.283c.22-1.59.273-1.64 1.958-2.17l5.723-1.772c.356-2.552 1.612-5.848 3.264-8.472 2.347-3.728 5.242-5.827 8.148-5.91 1.506-.045 2.764.465 3.744 1.515a5 5 0 0 1 .203.234c.157-.013.311-.028.467-.028h.009c2.25.004 4.114 1.287 5.384 3.714.35.675.638 1.382.86 2.11 1.124-.348 1.791-.554 1.794-.556.268-.08.957-.186 1.31.167.353.352 3.925 3.822 3.925 3.822s4.272.065 4.49.083a.58.58 0 0 1 .526.489c.041.303 6.574 44.467 6.574 44.467zM28.732 3.72c.686 1.769.86 3.817.882 5.288l2.866-.887c-.458-1.488-1.543-3.983-3.748-4.401zm-1.051 5.888c.02-1.607-.155-3.982-.958-5.66-.856.353-1.579.97-2.095 1.525-1.388 1.489-2.518 3.762-3.114 6.044l6.167-1.91zm-13.36 4.134 5.066-1.568c.564-2.966 1.979-6.041 3.825-8.021.712-.764 1.471-1.35 2.257-1.758-.491-.323-1.065-.473-1.748-.458-4.486.13-8.4 7.136-9.4 11.805zm9.01 4.958c-8.132.512-11.817 6.199-11.462 11.81.421 6.668 7.086 6.429 7.342 10.487.062.98-.547 2.367-2.253 2.475-2.61.165-5.87-2.295-5.87-2.295L9.841 46.48s3.239 3.47 9.124 3.1c4.902-.31 8.304-4.232 7.943-9.965-.46-7.288-8.644-7.967-8.84-11.078-.037-.571.001-2.844 3.607-3.072 2.458-.155 4.532.788 4.532.788l1.86-6.956s-1.603-.8-4.736-.597z\"\/><path fill=\"#5E8E3E\" d=\"M45.851 11.066c-.218-.02-4.489-.084-4.489-.084s-3.572-3.47-3.925-3.821a.87.87 0 0 0-.496-.228l.002 53.065L52.95 56.02s-6.532-44.162-6.574-44.465a.581.581 0 0 0-.526-.49h.001z\"\/><path d=\"M74.032 33.864c-1.84-1-2.787-1.841-2.787-3 0-1.471 1.314-2.417 3.367-2.417 2.389 0 4.522.998 4.522.998l1.682-5.154s-1.547-1.21-6.1-1.21c-6.337 0-10.729 3.629-10.729 8.73 0 2.893 2.05 5.102 4.787 6.679 2.209 1.26 2.998 2.156 2.998 3.47 0 1.367-1.105 2.472-3.155 2.472-3.056 0-5.942-1.58-5.942-1.58l-1.788 5.156s2.666 1.788 7.152 1.788c6.522 0 11.202-3.208 11.202-8.993-.001-3.1-2.367-5.31-5.209-6.94zm25.981-10.834c-3.208 0-5.733 1.525-7.678 3.838l-.105-.053 2.787-14.567h-7.258l-7.047 37.076h7.258l2.42-12.674c.946-4.787 3.418-7.73 5.732-7.73 1.63 0 2.262 1.104 2.262 2.682 0 1-.105 2.21-.315 3.208l-2.734 14.515h7.258l2.839-14.99c.316-1.577.527-3.47.527-4.732-.003-4.103-2.159-6.574-5.945-6.574h-.001zm22.35 0c-8.731 0-14.514 7.888-14.514 16.67 0 5.627 3.47 10.149 9.992 10.149 8.572 0 14.357-7.677 14.357-16.67 0-5.206-3.051-10.15-9.835-10.15zm-3.576 21.247c-2.472 0-3.524-2.104-3.524-4.734 0-4.154 2.157-10.938 6.101-10.938 2.577 0 3.417 2.21 3.417 4.366 0 4.469-2.154 11.306-5.994 11.306zm31.975-21.247c-4.899 0-7.679 4.312-7.679 4.312h-.104l.421-3.891h-6.416c-.315 2.63-.895 6.625-1.472 9.623l-5.049 26.557h7.258l1.997-10.728h.159s1.489.946 4.26.946c8.519 0 14.093-8.73 14.093-17.565 0-4.89-2.157-9.254-7.468-9.254zm-6.942 21.35c-1.884 0-2.999-1.051-2.999-1.051l1.21-6.784c.842-4.522 3.208-7.52 5.733-7.52 2.209 0 2.892 2.05 2.892 3.997 0 4.68-2.787 11.359-6.836 11.359v-.001zm24.77-31.763c-2.313 0-4.154 1.84-4.154 4.206 0 2.157 1.367 3.63 3.418 3.63h.105c2.262 0 4.207-1.526 4.26-4.207 0-2.104-1.42-3.63-3.629-3.63zm-10.149 36.707h7.256l4.945-25.715h-7.311l-4.89 25.715zm30.66-25.768h-5.049l.262-1.21c.421-2.471 1.894-4.68 4.313-4.68a7.505 7.505 0 0 1 2.313.368l1.42-5.68s-1.262-.63-3.945-.63c-2.577 0-5.152.736-7.099 2.418-2.472 2.104-3.629 5.153-4.207 8.204l-.209 1.21h-3.367l-1.052 5.47h3.367l-3.839 20.3h7.258l3.839-20.3h4.996l.999-5.47zm17.459.054s-4.537 11.43-6.574 17.669h-.106c-.138-2.01-1.788-17.67-1.788-17.67h-7.626l4.367 23.61c.106.527.053.844-.158 1.21-.843 1.63-2.262 3.21-3.945 4.367-1.367.999-2.892 1.63-4.101 2.05L188.627 61c1.473-.315 4.522-1.526 7.099-3.944 3.314-3.103 6.363-7.89 9.518-14.41l8.888-19.038h-7.572v.002z\"\/><\/svg>\n\n<\/div>\n                                    <div>    <svg class=\"logo logo-lyft\" role=\"img\" viewbox=\"0 0 199 141\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><title>Lyft<\/title><path d=\"M.746 3.343h30.06v80.674c0 12.767 5.84 20.372 10.458 23.632-4.889 4.346-19.829 8.149-30.966-1.087C3.732 101.118.746 92.166.746 83.745V3.343zm187.863 67.014v-8.478h9.168V32.136h-10.068C183.844 14.279 167.946.898 148.933.898c-21.903 0-39.658 17.756-39.658 39.658v69.459c6.24.877 13.674-.109 19.999-5.354 6.565-5.445 9.551-14.396 9.551-22.817v-2.559h15.013V49.542h-15.013v-8.986h.036c0-5.562 4.509-10.071 10.072-10.071 5.562 0 10.089 4.509 10.089 10.071v29.801c0 21.902 17.774 39.658 39.676 39.658V80.428c-5.562 0-10.089-4.509-10.089-10.071zM74.761 32.136v43.651c0 2.478-2.056 4.487-4.593 4.487s-4.593-2.009-4.593-4.487V32.136H35.831v51.338c0 9.235 3.132 20.915 17.385 24.718 14.268 3.807 22.545-4.074 22.545-4.074-.754 5.192-5.644 8.995-13.521 9.81-5.96.616-13.582-1.358-17.384-2.988v27.199c9.688 2.857 19.935 3.78 29.963 1.834 18.199-3.531 29.685-18.742 29.685-38.979V32.136H74.761z\" fill=\"#EA0B8C\" fill-rule=\"evenodd\"\/><\/svg>\n\n<\/div>\n                                    <div>    <svg class=\"logo logo-united-airlines\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 463.936 88\"><title>United Airlines<\/title><path fill=\"#fff\" d=\"M0-14.425a10.74 10.74 0 0 0-3.658.64l-.013.005v.439c.071-.027.193-.068.371-.109.089-.02.178-.038.266-.053l.093-.013c1.15-.165 2.14.069 2.735.751 1.301 1.493.223 4.56-2.409 6.85-.335.292-.679.556-1.028.793l-.028.018v.731c.106-.073.212-.147.316-.224.143.242 1.096 1.763 1.113 1.789.071-.046.276-.177.525-.346a13.341 13.341 0 0 0 .983-.74l-1.455-1.669c.147-.145.64-.635 1.031-1.1.092.07 1.304 1.01 1.789 1.445A12.49 12.49 0 0 0 1.673-6.51C1.004-6.949-.384-7.741-.384-7.741c.231-.366.429-.733.591-1.095 0 0 1.619.633 2.28.958a8.447 8.447 0 0 0 .487-1.213C2.154-9.423.69-9.772.558-9.803c.086-.316.143-.624.166-.921a17.71 17.71 0 0 1 2.496.448 4.172 4.172 0 0 0-.013-.971 14.655 14.655 0 0 0-2.497-.239 2.882 2.882 0 0 0-.165-.667s1.173-.103 2.399.041a3.32 3.32 0 0 0-.225-.388 5.581 5.581 0 0 0-.204-.264s-1.037-.079-2.238.101a2.406 2.406 0 0 0-.371-.415 9.706 9.706 0 0 1 2.028-.212c-.302-.207-.616-.346-.616-.346-.848.016-1.737.252-1.808.271-.242-.142-.431-.199-.454-.206l-.002-.001.001-.001c.069-.021.724-.219 1.204-.271H.257c-.653-.086-1.552.119-1.656.144a5.088 5.088 0 0 0-.478-.067s.484-.14 1.124-.23c.583-.082 2.538-.322 3.787 1.359 1.183 1.592.753 4.062-.853 6.431A12.992 12.992 0 0 1 .666-4.343c-.492.511-.99.953-1.465 1.33a12.95 12.95 0 0 1-2.358 1.509c-.171.091-.342.177-.514.259v.77c1.372-.649 2.185-1.267 2.185-1.267l1.155 1.64s.895-.561 1.793-1.3h.001-.001L.078-2.969H.077A15.402 15.402 0 0 0 1.522-4.43s1.436 1.275 1.593 1.425c.456-.514.874-1.054 1.245-1.617a36.681 36.681 0 0 0-1.736-1.272s.585-.936.823-1.507c0 0 .947.517 1.842 1.098.219-.49.401-.998.531-1.517-.588-.355-1.895-.938-1.895-.938.112-.44.179-.87.198-1.285 0 0 .95.301 1.908.782a5.491 5.491 0 0 0-.081-1.186c-.811-.39-1.89-.654-1.89-.654a3.974 3.974 0 0 0-.28-.93s.981.184 1.848.536a2.86 2.86 0 0 0-.483-.754c-.556-.304-1.82-.535-1.82-.535a3.683 3.683 0 0 0-.458-.484c.398.055 1.018.196 1.018.196-.682-.334-1.45-.526-1.459-.529-.001 0-.152-.1-.334-.197 0 0 1.906.391 2.941 1.172.094.07.184.149.275.237.105.1.196.212.276.322C7.647-9.244 5.863-3.804.835 0h1.87a69.676 69.676 0 0 1-.381-.423 16.424 16.424 0 0 0 1.648-1.758L5.217-.942c.488-.555.94-1.148 1.34-1.772 0 0-.654-.627-1.35-1.232.559-.903.904-1.803.904-1.803.053.039.731.543 1.426 1.19.335-.735.543-1.671.543-1.671-.724-.659-1.467-1.13-1.467-1.13a8.143 8.143 0 0 0 .196-1.519s.787.468 1.467 1.066a5.828 5.828 0 0 0-.126-1.318c-.675-.584-1.424-.976-1.424-.976-.001 0-.073-.49-.313-1.082l.006.003c.046.023.404.205 1.036.655-.493-.639-1.341-1.268-1.341-1.268a3.888 3.888 0 0 0-.277-.406 10.488 10.488 0 0 1 1.894 1.662c.208.261.399.594.547.975.04.104.075.208.106.311.462 1.559.178 3.311-.343 4.746C7.44-2.857 6.439-1.312 5.265 0h2.214c.215-.304.408-.594.606-.927-.148-.225-.822-1.013-.822-1.013a13.23 13.23 0 0 0 .969-1.915s.45.499.803 1.012c.347-.83.509-1.696.509-1.696-.238-.397-.77-1.013-.77-1.013a8.217 8.217 0 0 0 .193-1.606c.266.318.625.82.625.82v-.003c-.068-.984-.576-1.88-.688-2.068l-.011-.061a8.225 8.225 0 0 0-.249-.912c.572.843.939 1.791.939 1.791.235.61.376 1.38.376 2.218 0 .444-.089 2.76-1.858 5.373h.56a18.102 18.102 0 0 0 .936-2.026c.007.021.129.342.219.675.188-.663.322-1.354.397-2.064-.024-.092-.074-.242-.102-.332 0 0 .12-.604.168-1.292a10.558 10.558 0 0 1-.193 3.899c-.099.393-.219.779-.35 1.14h.477c.398-1.146.603-2.354.603-3.568 0-5.987-4.852-10.857-10.816-10.857m-3.671 7.152v1.444c.256-.166.512-.35.763-.553zm.348-5.977a5.231 5.231 0 0 0-.348.254v.335a8.708 8.708 0 0 1 1.015-.684 4.499 4.499 0 0 0-.667.095m.975 5.686-1.323-.925v-.79c.673-.957.77-2.056.18-2.592a1.034 1.034 0 0 0-.18-.131v-.394l.011.006s.843-.667 1.512-.954c.162.011.317.034.464.068-1.001.424-1.74.951-1.791.988.103.061.196.137.209.147a11.2 11.2 0 0 1 2.051-.979c.145.066.285.149.406.242-1.163.327-2.281.91-2.281.91.063.074.119.153.167.238a.967.967 0 0 1 .019-.008c1.191-.51 2.455-.771 2.455-.771.099.136.181.287.243.454 0 0-1.135.13-2.595.598.064.202.082.353.082.355 0 0 1.377-.308 2.646-.342a3.22 3.22 0 0 1-.018.667c-.752-.039-2.542.056-2.613.061 0 0-.006.258-.073.501 0 0 1.308.042 2.498.264a5.69 5.69 0 0 1-.349.84 46.185 46.185 0 0 0-2.313-.6 3.867 3.867 0 0 1-.312.606s1.47.642 2.035.956h.001v.001c-.245.366-.731.88-.731.88a35.374 35.374 0 0 0-.4-.296\" transform=\"matrix(5.083 0 0 5.32 388.73 87.99)\"\/><path fill=\"#1414d2\" d=\"M0-12.312c5.964 0 10.816 4.87 10.816 10.857 0 1.214-.205 2.422-.603 3.569h2.655v-16.54H-3.671v2.759l.013-.005A10.74 10.74 0 0 1 0-12.312m-3.671 5.146c.673-.957.77-2.056.18-2.592a1.034 1.034 0 0 0-.18-.131zm3.465-3.486c-.595-.682-1.585-.916-2.735-.751l-.093.013a5.209 5.209 0 0 0-.266.053c-.178.041-.3.082-.371.109v.345c.114-.09.229-.175.348-.254.229-.05.452-.081.667-.095-.332.19-.716.447-1.015.684v.265l.011.006s.843-.667 1.512-.954c.162.011.317.034.464.068-1.001.424-1.74.951-1.791.988.103.061.196.137.209.147a11.2 11.2 0 0 1 2.051-.979c.145.066.285.149.406.242-1.163.327-2.281.91-2.281.91.063.074.119.153.167.238a.967.967 0 0 1 .019-.008c1.191-.51 2.455-.771 2.455-.771.099.136.181.287.243.454 0 0-1.135.13-2.595.598.064.202.082.353.082.355 0 0 1.377-.308 2.646-.342a3.22 3.22 0 0 1-.018.667c-.752-.039-2.542.056-2.613.061 0 0-.006.258-.073.501 0 0 1.308.042 2.498.264a5.69 5.69 0 0 1-.349.84 46.185 46.185 0 0 0-2.313-.6 3.867 3.867 0 0 1-.312.606s1.47.642 2.035.956h.001v.001c-.245.366-.731.88-.731.88a35.374 35.374 0 0 0-.4-.296l-1.323-.925v1.216l.763.891a9.003 9.003 0 0 1-.763.553v.725l.028-.018c.349-.237.693-.501 1.028-.793 2.632-2.29 3.71-5.357 2.409-6.85m3.24.127C1.785-12.206-.17-11.966-.753-11.884c-.64.09-1.124.23-1.124.23.143.013.338.039.478.067.104-.025 1.003-.23 1.656-.144h.002c-.48.052-1.135.25-1.204.271l-.001.001.002.001c.023.007.212.064.454.206.071-.019.96-.255 1.808-.271 0 0 .314.139.616.346a9.706 9.706 0 0 0-2.028.212c.128.114.256.251.371.415 1.201-.18 2.238-.101 2.238-.101s.14.171.204.264c.08.116.162.261.225.388-1.226-.144-2.399-.041-2.399-.041.08.209.135.432.165.667.136-.001 1.174.001 2.497.239.042.303.046.628.013.971a17.71 17.71 0 0 0-2.496-.448c-.023.297-.08.605-.166.921.132.031 1.596.38 2.416.712a8.447 8.447 0 0 1-.487 1.213c-.661-.325-2.28-.958-2.28-.958-.162.362-.36.729-.591 1.095 0 0 1.388.792 2.057 1.231A12.49 12.49 0 0 1 .631-3.105C.146-3.54-1.066-4.48-1.158-4.55a17.84 17.84 0 0 1-1.031 1.1l1.455 1.669a13.038 13.038 0 0 1-.983.74c-.249.169-.454.3-.525.346-.017-.026-.97-1.547-1.113-1.789-.104.077-.21.151-.316.224V.868c.172-.082.343-.168.514-.259A12.95 12.95 0 0 0-.799-.9 14.86 14.86 0 0 0 .666-2.23c.584-.6 1.092-1.227 1.515-1.864 1.606-2.369 2.036-4.839.853-6.431m2.55.571a2.356 2.356 0 0 0-.276-.322 2.82 2.82 0 0 0-.275-.237c-1.035-.781-2.941-1.172-2.941-1.172.182.097.333.197.334.197.009.003.777.195 1.459.529 0 0-.62-.141-1.018-.196.165.144.321.311.458.484 0 0 1.264.231 1.82.535 0 0 .266.274.483.754-.867-.352-1.848-.536-1.848-.536.13.292.223.605.28.93 0 0 1.079.264 1.89.654.07.385.096.783.081 1.186-.958-.481-1.908-.782-1.908-.782a6.409 6.409 0 0 1-.198 1.285s1.307.583 1.895.938a9.219 9.219 0 0 1-.531 1.517c-.895-.581-1.842-1.098-1.842-1.098-.238.571-.823 1.507-.823 1.507.015.01.989.679 1.736 1.272A14.294 14.294 0 0 1 3.115-.892c-.157-.15-1.593-1.425-1.593-1.425-.433.502-.916.992-1.445 1.461h.001L1.462.711h.001-.001c-.898.739-1.793 1.3-1.793 1.3L-1.486.371s-.813.618-2.185 1.267v.476H.835C5.863-1.691 7.647-7.131 5.584-9.954M5.265 2.114C6.439.801 7.44-.744 8.041-2.398c.521-1.435.805-3.187.343-4.746a4.392 4.392 0 0 0-.106-.311 3.763 3.763 0 0 0-.547-.975 10.488 10.488 0 0 0-1.894-1.662c.102.132.196.268.277.406 0 0 .848.629 1.341 1.268-.632-.45-.99-.632-1.036-.655l-.006-.003c.24.592.312 1.082.313 1.082 0 0 .749.392 1.424.976.094.432.132.875.126 1.318-.68-.598-1.467-1.066-1.467-1.066a8.143 8.143 0 0 1-.196 1.519s.743.471 1.467 1.13c0 0-.208.936-.543 1.671a18.11 18.11 0 0 0-1.426-1.19s-.345.9-.904 1.803c.696.605 1.35 1.232 1.35 1.232-.4.624-.852 1.217-1.34 1.772L3.972-.068A16.424 16.424 0 0 1 2.324 1.69l.381.424Zm2.214 0h.622C9.87-.5 9.959-2.816 9.959-3.26c0-.838-.141-1.608-.376-2.218 0 0-.367-.948-.939-1.791.062.188.182.57.249.912l.011.061c.112.188.62 1.084.688 2.068v.003s-.359-.502-.625-.82a8.217 8.217 0 0 1-.193 1.606s.532.616.77 1.013c0 0-.162.866-.509 1.696-.353-.513-.803-1.012-.803-1.012A13.23 13.23 0 0 1 7.263.173s.674.788.822 1.013c-.198.333-.391.623-.606.928m1.182 0A18.2 18.2 0 0 0 9.597.087c.007.021.129.342.219.675.188-.663.322-1.354.397-2.064-.024-.092-.074-.242-.102-.332 0 0 .12-.604.168-1.292a10.558 10.558 0 0 1-.193 3.899 11.97 11.97 0 0 1-.35 1.141zM14.117.753a.68.68 0 1 0 0 1.36.68.68 0 0 0 0-1.36m0 .101a.58.58 0 1 1-.002 1.16.58.58 0 0 1 .002-1.16m-.244.236h.323c.125 0 .208.073.208.185s-.073.177-.182.19l.221.289h-.133l-.206-.284h-.13v.284h-.101zm.101.097v.19h.219c.07 0 .104-.034.104-.094 0-.063-.036-.096-.104-.096zm-57.351-9.261h3.198v6.07h2.462v-6.07h3.197v-2.234h-8.857zm14.969 2.799h5.118v-1.762h-5.118v-1.237h5.513v-2.034h-7.976v8.304h8.021v-2.034h-5.558zm11.896 1.037h2.192c1.604 0 2.327-.587 2.327-1.918s-.723-1.918-2.327-1.918h-2.192zm-2.463-6.07h4.745c3.299 0 4.813 1.433 4.813 4.152 0 2.719-1.514 4.152-4.813 4.152h-4.745zm-30.513 8.304h2.463v-8.304h-2.463zm-6.587-3.472-4.586-4.832h-2.429v8.304h2.293v-5.263l5.005 5.263h2.011v-8.304h-2.294zm-20.402-.595v-4.237h2.463v4.112c0 1.582.751 2.249 2.197 2.249 1.446 0 2.197-.667 2.197-2.249v-4.112h2.463v4.237c0 2.96-1.497 4.236-4.66 4.236-3.163 0-4.66-1.276-4.66-4.236\" transform=\"matrix(5.083 0 0 5.32 388.73 76.75)\"\/><\/svg>\n\n<\/div>\n                            <\/div>\n            <\/div>\n<\/section>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/d2h1bfu6zrdxog.cloudfront.net\/wp-content\/uploads\/2023\/03\/g2-leader-winter-2023.png\" alt=\"\" class=\"wp-image-32119\"\/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/d2h1bfu6zrdxog.cloudfront.net\/wp-content\/uploads\/2023\/03\/g2-users-love-us.png\" alt=\"\" class=\"wp-image-32120\"\/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"interview-best-practices-for-python-roles\">Interview best practices for Python roles<\/h2>\n\n\n\n<p>Python interviews can vary on everything from the engineering role involved to the level of candidate being interviewed. In order to get the best results from your Python interview questions, we recommend following these best practices when working with your candidates:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use technical questions that reflect actual business cases with your organization \u2013 this is more interesting for the candidate and will better showcase the skills match with your team.<\/li>\n\n\n\n<li>Encourage the candidate to ask questions. Make the exercise a collaborative experience.<\/li>\n\n\n\n<li>If you\u2019re using Python for data analysis, make sure the candidate has a solid understanding of data structures.<\/li>\n<\/ul>\n\n\n\n<p>Additionally, you\u2019ll want to follow standard interview etiquette with your Python interviews \u2013 tailor the interview question complexity to the level of development skills of your candidates, ensure prompt feedback to the candidates about their status in the job search process, and make sure you leave time for candidates to ask questions either about the assessment or working with you and your team.<\/p>\n","protected":false},"parent":0,"menu_order":0,"template":"","class_list":["post-32623","interview-questions","type-interview-questions","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/interview-questions\/32623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/interview-questions"}],"about":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/types\/interview-questions"}],"wp:attachment":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/media?parent=32623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}