Nuno Morais
    • 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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Pedro Pereira (2021-12-06) ## Presentation and getting to know about candidate (Total: 7m) - Thank you for your time! - We present ourselves - Candidate presents himself. Empresa: Agile Store > Agile Power - Gestor de Cliente - Gestor de equipa - link (https://www.agile-power.com/) - prefers back-end 👍 ## Technical interview (Part 1) (Total: 1h15m) A new product requirement states that all Talkdesk calls should be registered in a centralized system. A call has always two participants, a customer and an agent, and it can be either inbound (started by the contact) or outbound (started by the agent). The system must fulfill the following use cases: - Ability to register a new call - Ability to mark a call as finished - Ability to retrieve the data associated with a given call - Ability to list calls matching a given criteria. It should be possible to filter by: -- Start and end dates -- Status (in progress / finished) -- Contact number Clients should be able to interact with this system through a REST API. Each call pertains to a specific tenant (and a tenant can only access calls belonging to it), it must have an unique identifier and a new record must include the following information: - Start date - Source number - Destination number - Direction (inbound/outbound) When a call is marked as finished, the record must also include the corresponding end date. ### 1. Try to keep it under 15 minutes #### Basic Topics: Be attentive to the resource model the candidate proposes: - Resource name (URI path) - did she opted for a plural or singular name? And did she assume a versioning schema from the beginning? If so, why? - Chosen media type(s) (e.g. application/json or application/hal+json) and how that’s communicated (content-type and accept headers) - Which HTTP methods did she opted for each operation (particularly the one to mark a call as finished)? - Which status codes did she considered? (e.g. 201 for success creation, or doesn’t make any distinction between “successful” status codes?) - Pagination of results on the endpoint that retrieves a list of calls - How did the candidate dealt with the “multi-tenancy” requirement? Did she opted for having the tenant-id encoded in the payload or in the URI path? Did she assume the tenant-id is encoded on a JWT for instance? #### Advanced topics - How did the candidate designed the filter by “Contact number” operation? Contact number is not part of the resource representation, so a valid approach would be to allow ODATA like queries such as `?filter=source_number eq '<contact number>' or destination_number eq '<contact number>'` or any other strategy to specify filter queries. - HATEOAS, especially on the endpoint that retrieve a list of calls - Did the candidate mentioned how requests would be authorized? If so, evolve a bit around the topic of authentication/authorization (Basic Auth, OAUTH, etc) > Notes: > Não conhece os conceitos básicos de REST > Muita dificuldade em formular os endpoints básicos > Muita dificuldade com os error code -------------- ### Try to keep it under 20 minutes. #### What programming language would you choose for this implementation? And which application architectural style would you advise? The intention here is to understand whether the candidate acknowledges the benefits of having a well defined structure to guide the application development (easier to build, change, maintain and test). - Usually candidates will describe a layered architecture, and that’s fine. (Controller ↔︎ Application ↔︎ Persistence). How to change the persistence layer independently, for instance? Is is simple to test each layer’s components in isolation? (Dependency injection principle) - If the candidate mentions other architectural styles such as Hexagonal (or any of its variants) or Clean Architecture that’s a plus. - Important to ask which testing strategy she would apply (kind of related with the architectural proposal). Unit tests? Integration tests? E2E? > Notes: > - MVC > - Framework -> Laravel > - Frontend vue > - Não sabe sobre testes -------------- ### Try to keep it under 20 minutes. #### We want this information to be durable and highly available. Which database would you recommend to store calls data? The idea is to assess the rational behind the decision. Questions regarding durability, consistency and availability requirements from the candidate are signs of maturity, and thus should be seen as a plus. Keep in mind that the workload of the app consists mostly on writing new calls. - RDBMS vs NoSQL? Why? - If NoSQL is chosen, then what data model (document vs rows vs key-value) would suit better? - What “ACID” guarantees each engine provides? - Which indexes would the candidate suggest? (it’s a plus if she can provide an explanation of how indexes are implemented) - How can we achieve High Availability (replication)? - Tradeoffs of the different main approaches to replication (single-leader, multi-leader, leaderless) is a plus. > Notes: - postgres é mais rápido que um MySQL :thinking_face: - criar index - decent on indexes (let's be fair) :dance: - ACID was a bust - knows transactions - Schema - :boom: -------------- ### Try to keep it under 20 minutes. #### We now have a MVP almost ready to go to production 🤘. How do we ensure it can cope with the expected traffic? And how can we protect the application from customer spikes? - How does the candidate understand the current “state” of the application? (Monitoring) How can we assess where’s the “tipping point”? - It’s expected that the candidate knows the different application scaling options: vertical and horizontal. What constraints should the system have in order to scale horizontally? (stateless applications) - Does it make sense to apply rate limiting? What to do with requests that are shedded? (Ideally, the API should never loose any writes, so if the candidate suggests something in the lines of queueing requests to be processed asyncronously, that would be a strong plus). - What options can we consider when the dataset grows to the extend that a single machine is no longer capable of storing and processing it? (partitioning/sharding - how?) - Would the candidate change the database provider considering the above-mentioned non-functional requirement? > Notes: - knows alerts - Datadog -------------- ## Technical interview (Part 2) Product evolves with time and now there’s a new requirement: the API should return the contact information associated with a given call, so that it’s possible to feed an UI console with all calls and corresponding contacts. There’s a Contacts API where all the contacts' information is accessible. The team is yet to define how to integrate the Calls API with the Contacts API. So far, the following approaches are on the table: Shared DB ![Shared DB](https://i.imgur.com/vgXGiLG.png) Rest Service Invocation ![Rest Service Invocation](https://i.imgur.com/TsMBuqJ.png) Message Passing Dataflow ![Message Passing Dataflow](https://i.imgur.com/zAxfa9k.png) ### Try to keep it under 20 minutes. (Total: 0h30m) #### Which integration option would you advise? The idea is explore the tradeoffs of each integration “pattern”. It’s perfectly fine if the candidate suggests yet another approach or a “mix” of the proposed options. - Shared database, although is arguably the simplest approach to get running, breaks the micro-services “shared nothing” principle and creates a huge coupling between the two systems. - Intercommunication through the REST API allows both systems to evolve independently and does not break Contacts API encapsulation (the way data is structured is an implementation detail). However, it is a synchronous communication protocol which means that Calls API threads will spend a fairly amount of time waiting for replies from Contacts API (“Synchronous calls are particularly vicious amplifiers that facilitate cascading effects”, Michael T Nygard). So the candidate should be able to describe a few stability patterns to be applied on this integration point (timeout, circuit breaker, error handling). If she suggests caching, we should ask whether it’s distributed or in-process, how to ensure it doesn’t grow indefinitely and also which mechanisms HTTP support to enable resource caching. - Leveraging a Message broker is the option that guarantees more decoupling between the systems. However, it’s not the most straightforward approach as it requires a consumer and a process to transform and store contacts data in the Calls API database. Also, all contacts data must be “backfilled” somehow (how would the candidate suggest to do that?) > Notes: - looking pretty bad, not gonna lie - seems bad at distributed systems, in general - unexperienced in cache - -------------- ### Try to keep it under 10 minutes. #### The application must publish domain events to the org Message Broker whenever a call is created or when a call is marked as finished. How can we ensure at least once semantics? Understand if the candidate is aware of the possible “semantics” (exactly once, at least once, at most once) and of strategies to guarantee them. - Outbox pattern, where the “events” are persisted in the Calls API DB and there’s a worker whose responsibility is to fetch all non-published events and emit them. The key here is that the persistence of the event must be performed in the same “transaction” as the one that inserts/updates the call data. - What are the consequences of at least once semantics? (duplication of events) > Notes: --------------

    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