Data Interview Qs - Identity Matrix

Identity Matrix
Python Data Structures Arrays Matrix

Can you build a function that prints an identity matrix, given the identity matrix size?

Examples:

Input: 2
Output: 
       1 0
       0 1
         

Input: 4
Output: 
       1 0 0 0
       0 1 0 0
       0 0 1 0
       0 0 0 1

Function will be written in Python for premium users.





Want the solutions? Upgrade to premium to access detailed solutions to each problem (including this one).

Was this email forwarded to you? You can join our list here to receive questions


Unsubscribe

Older messages

Parking space probabilities

Friday, January 22, 2021

Data Interview Qs Parking space probabilities Data Analysis Python Pandas External Dataset Data Manipulation Data Visualization Statistics Probability Mass Function Suppose you're analyzing the

Bayes' Theorem

Wednesday, January 20, 2021

Data Interview Qs Bayes' Theorem Statistics Bayes' Theorem What is Bayes' Theorem? Explain how it can be useful in a machine learning context? Want the solutions? Upgrade to premium to

Sorting algorithm

Monday, January 18, 2021

Data Interview Qs Sorting algorithm Python Algorithms Given the following Python function, write out what the output would be at each stage: n = 1 while n < 3: m = n + 1 while m < 4: m += 1 print

Avg. sales by location in SQL

Friday, January 15, 2021

Data Interview Qs Avg. sales by location in SQL SQL Database Querying You are given the below tables, showing Store, Product, and Sales information for a chain of grocery stores. The columns are

Cleaning and analyzing employee data

Friday, January 15, 2021

Data Interview Qs Cleaning and analyzing employee data Data Analysis Python Pandas Data Manipulation Data Cleaning Below is a snippet from a table that contains information about employees that work at

You Might Also Like

The worst of the VC fund performance may be behind us

Friday, May 10, 2024

Plus: Zeekr's shares pop and Dell's data breach did include personal data View this email online in your browser By Christine Hall Friday, May 10, 2024 Good afternoon, and welcome to TechCrunch

DeepMind releases AlphaFold 3 - Weekly News Roundup - Issue #466

Friday, May 10, 2024

Plus: OpenAI releases Model Spec; Neuralink publishes progress update; Tesla shares new video of Optimus; growing meat with Gatorade; and more! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Issue #540: Jam winners, AGILE, and game of life in 3D

Friday, May 10, 2024

Weekly newsletter about HTML5 Game Development. Is this email not displaying correctly? View it in your browser. Issue #540 - May 10th 2024 If you have anything you want to share with the HTML5 game

🕹️ The Future of Game Emulators — We Tried Browsing the Web With Safari 1.0

Friday, May 10, 2024

Also: How Linux Got Its Name, and More! How-To Geek Logo May 10, 2024 Did You Know Honey crisp apples were developed by the Minnesota Agricultural Experiment Station's Horticultural Research Center

JSK Daily for May 10, 2024

Friday, May 10, 2024

JSK Daily for May 10, 2024 View this email in your browser A community curated daily e-mail of JavaScript news How to Create Objects in JavaScript In programming, objects are fundamental building

iOS Dev Weekly - Issue 660

Friday, May 10, 2024

Happy Birthday to … the Worldwide Developers Conference! 🎂 View on the Web Archives ISSUE 660 May 10th 2024 Comment Reading this post from Jim Luther wishing WWDC a happy 35th birthday set me thinking

Startups Weekly: Trouble in EV land and Peloton is circling the drain

Friday, May 10, 2024

Plus: The quirky rabbit R1 and Tesla's relationship with lidar View this email online in your browser By Haje Jan Kamps Friday, May 10, 2024 Welcome to Startups Weekly — Haje's weekly recap of

Daily Coding Problem: Problem #1437 [Hard]

Friday, May 10, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. Given an array of numbers, find the length of the longest increasing

A Crushing Blow

Friday, May 10, 2024

Apple needs to read the room in which they find themselves... A Crushing Blow By MG Siegler • 10 May 2024 View in browser View in browser What came first, the quip or the commercial? What a silly

Charted | How Americans Feel About Federal Government Agencies 💸

Friday, May 10, 2024

Americans love the National Park Service. They hate the IRS. But what about the ones in between? View Online | Subscribe Presented by Voronoi: The App Where Data Tells the Story FEATURED STORY How