Nicola Miotto
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Python - 30mins ## Task 1: Parse an encoded string In this Python challenge, you need to write a function that accepts an encoded string as a parameter. This string will contain a first name, last name, and an id. Values in the string can be separated by any number of zeros. The id is a numeric value but will contain no zeros. The function should parse the string and return a Python dictionary that contains the first name, last name, and id values. An example input would be: ``` "Robert000Smith000123". ``` The function should return the following output: ``` { "first_name": "Robert", "last_name": "Smith", "id": "123" } ``` ## Task 2 [Given a string which could contains numbers and characters. Please write a program using list comprehension to provide frequency of characters with an output of sorted dictionary](https://codeshare.io/yoPoJn) ``` Example for 2: # "aaddbsbbbdcc" -> {'a':2, 'b': 4, 'c':2, 'd':3} # "2234413" -> {'1':1, '2':2, '3':2, '4':2} ``` ## Task 3 [Given a list of names and a letter, returns the names that start with that letter](https://codeshare.io/yoPoJn) ``` Example for 3: # "n", ["Nicola", "christoph", "akos", "pablo", "nabila"] -> ["nicola", nabila"] # 1, ["nicola", "christoph", "akos", "pablo", "nabila"] -> [] # "b", ["nicola", "christoph", "akos", "pablo", "nabila", 1234, list()] -> [] ``` ## Task 4 [Given a string which is an english sentence. Please write a python program(function) to check if the string is a pangram. A pangram is a sentence containing every letter in the english alphabet(a to z). If it is a pangram then print "yes", otherwise return how many letters it is short of becoming a pangram.](https://codeshare.io/yoPoJn) ``` Example for 4: # input = "The Quick Brown Fox Jumps Over The Lazy Dog" -> "yes" # input = "The Quick Brown Fox Jumps Over The Lazy Cat" -> 2 ``` ## Questions 1. What is a decorator? 2. What is the difference between tuples and list? 3. Where do you use `yield`? 4. How can you do type annotation in Python? # SQL ## Understanding a query - 20mins 1. What does this query try to do? 2. Does it run? And how would you optimize it? ``` WITH recent_articles AS ( SELECT target_market, article_id, published_at, RANK() OVER (PARTITION BY target_market ORDER BY published_at) r FROM articles ) SELECT target_market, article_id, published_at, SUM(clicks) AS total_clicks FROM recent_articles s JOIN article_interactions i ON i.article_id = s.article_id WHERE published_at > '2021-01-01' AND r > 5 GROUP BY 1, 2 HAVING total_clicks > 3; ``` Notes: - `article_id` is unique only within a target market - `articles` table contains data since 2019 - `article_interactions` table includes the following columns: `target_market`, `article_id`,`clicks`, `interacted_at` ## Write an SQL query to find all participants that appear at least three times consecutively. ``` +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | year | int | +-------------+---------+ ``` id is the primary key for this table and id is an autoincrement column. ``` participants ╔════╦══════╦══════╗ ║ id ║ name ║ year ║ ╠════╬══════╬══════╣ ║ 1 ║ Arun ║ 2001 ║ ║ 2 ║ Arun ║ 2002 ║ ║ 3 ║ Arun ║ 2003 ║ ║ 4 ║ Arun ║ 2004 ║ ║ 5 ║ John ║ 2009 ║ ║ 6 ║ John ║ 2010 ║ ║ 7 ║ John ║ 2011 ║ ║ 8 ║ Bala ║ 2014 ║ ║ 9 ║ Bala ║ 2015 ║ ║ 10 ║ Bala ║ 2017 ║ ║ 11 ║ chan ║ 2014 ║ ║ 12 ║ chan ║ 2015 ║ ║ 13 ║ chan ║ 2017 ║ ╚════╩══════╩══════╝ ``` Output should be like this: ``` ╔══════╗ ║ name ║ ╠══════╣ ║ Arun ║ ║ John ║ ╚══════╝ ``` Return the resultant table in any order. ## Theoretical questions 1. What is the difference between WHERE and HAVING? 2. What is the difference between UNION and UNION ALL? 3. What is the difference between FULL OUTER JOIN and CROSS JOIN (aka Cartesian JOIN)? 4. What is the difference between DELETE and TRUNCATE? 5. What are window functions? 6. What is the difference between RANK(), DENSE_RANK() and ROW_NUMBER() ? 7. What does ACID stand for? Why is it important? # Design & Architecture The BI and data science team extracts the data from snowflake datawarehouse to perform trends analysis and reporting. We are ingesting the data from multiple sources like APIs, events and legacy databases. 1. How will you design a framework to ingest the data from multiple sources to create a datalake and datawarehouse to help the BI team for reporting and dashboarding? Please feel free to use [excalidraw](https://excalidraw.com) to draw. 2. How will you apply data security in your framework? 3. How will you move data from legacy database(mysql) to AWS? 4. How will you apply monitoring and alerting/notifications in your system at various stages? ### (Optional) Oracle 1. What is and PCTFree index? 2. What is a bitmap index and its use cases? # Distributed data processing -15mins ## General 1. What is skew? Why is it good/bad for data processing/storage? 2. Explain columnar data storage. What are the advantages/disadvantages of it? ## Snowflake 1. What is Snowpipe? 2. What are Stages? 3. What are warehouses? 4. How does Snowflake physically store the data? 5. Which types of indexes does Snowflake offer? 6. What is the difference between `CREATE TABLE ... LIKE/CLONE ...`? 7. How do you ensure referential integrity in Snowflake? ## (Optional) Redshift 1. What is distkey and sortkey? 2. What are the distribution styles and use cases for them? 3. How does Redshift leverage columnar orientation? 4. What type of indexes does Redshift offer? ## (Optional) Kafka 1. What are topics and partitions? 2. What happens inside Kafka when a producer is sending data to it? 3. What are consumer groups? # Docker - 10mins What is the difference between: - ENTRYPOINT and CMD? - ADD and COPY? - `docker exec` and `docker run`? # AWS - 15mins 1. What does this error tell you? How would you resolve it? ``` An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied ``` 2. Can I have a bucket called `my-bucket` and Akos will create the same `my-bucket` bucket in this own AWS account one day later? 3. You are trying to upload a 6GB file to AWS S3 and receive the message saying that "Your proposed upload exceeds the maximum allowed object size". What is a possible solution for the problem? 5. We have multiple groups in a company e.g IT, HR, Directors, Developers etc and we want to give access to specific S3 files to one or more than one group. What would be the cost effective way to do that? 6. Can we ensure that API calls to Amazon DynamoDB or S3 from Amazon EC2 instances in a VPC do not traverse the internet. if yes then how? 7. We have an application where user can update, delete and add new files into his S3 folder. What should we do to prevent the accidental deletion of the users data by him or anyone? # Airflow - 15mins 1. How does the Airflow architecture look like? 2. How are DAGs scheduled? 3. Which of the following DAG definitions are not working? a. DAG(dag_id=..., start_date=) a. DAG( start_date=) a. DAG(dag_id=..., default_args={start_date=...}) b. Task without DAG, task1 = Bash c. Tasks with context manager 4. How do you test your DAGs?

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully