Matters AI: Ronda 2 Entrevista JavaScript

Matters AI Ronda 2 en JavaScript: ejercicios de programación funcional (currying y composición), filter y reduce, y explicación de igualdad y cortocircuito con código.

16 sept 2025 • 3 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Matters AI Ronda 2 Entrevista JavaScript presenta ejercicios prácticos para evaluar conceptos de programación funcional, currying, composición y conocimiento de igualdad y cortocircuito en JavaScript. A continuación se reescribe el artículo original en español con soluciones claras y código de referencia.

Tareas planteadas 1 Implementar custom filter y reduce 2 Implementar función de currying dinámica 3 Implementar función compose 4 Predecir salidas de expresiones con igualdad y cortocircuito

Implementación de un custom filter Ejemplo de implementación que replica el comportamiento de Array.prototype.filter Array.prototype.miFilter = function(callback, thisArg) { const resultado = []; for (let i = 0; i < this.length; i++) { if (i in this) { if (callback.call(thisArg, this[i], i, this)) { resultado.push(this[i]); } } } return resultado; }

Implementación de un custom reduce Versión básica que replica Array.prototype.reduce Array.prototype.miReduce = function(reducer, inicial) { let i = 0; let acumulador = inicial; if (arguments.length < 2) { while (i < this.length && !(i in this)) i++; if (i >= this.length) throw new TypeError('Reduce of empty array with no initial value'); acumulador = this[i++]; } for (; i < this.length; i++) { if (i in this) acumulador = reducer(acumulador, this[i], i, this); } return acumulador; }

Función de currying dinámica Currying que acepta cualquier número de argumentos por llamada hasta completar la aridad original de la función function curry(fn) { return function curried(...args) { if (args.length >= fn.length) { return fn.apply(this, args); } return function(...more) { return curried.apply(this, args.concat(more)); }; }; }

Ejemplo de uso de curry Si tenemos function suma(a, b, c) return a + b + c; entonces const cs = curry(suma); cs(1)(2)(3) devuelve 6 y cs(1, 2)(3) tambien devuelve 6

Función compose Composición de funciones de derecha a izquierda const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);

Predicción de salidas y explicación Ejemplo 1 igualdad con doble igual y cortocircuito AND console.log de la expresión mehul == lakhanpal && mehul devuelve true porque la operación lakhanpal && mehul evalua a mehul cuando ambos operandos son truthy, y comparar mehul con mehul con el operador == da true Ejemplo 2 igualdad estricta y cortocircuito OR console.log de la expresión mehul === lakhanpal || mehul devuelve false en la comparación estricta del primer operando porque lakhanpal || mehul devuelve lakhanpal si el primer operando es truthy; comparar mehul === lakhanpal da false. Si se evalua la expresión completa con OR y se imprime el resultado final, la interpretación depende del lugar de paréntesis pero la idea central es entender que && devuelve el operando derecho cuando ambos son truthy y || devuelve el primer operando truthy

Conceptos evaluados Se prueban programación funcional en JavaScript, currying y composición, diferencias entre == y === y mecanismos de cortocircuito con && y ||

Acerca de Q2BSTUDIO Q2BSTUDIO es una empresa de desarrollo de software y aplicaciones a medida especializada en ofrecer soluciones personalizadas para empresas que buscan transformar sus procesos con tecnología avanzada. Ofrecemos servicios de software a medida, aplicaciones a medida y soluciones integrales de inteligencia artificial para empresas. Si buscas un socio en desarrollo de productos digitales, puedes conocer nuestros servicios de desarrollo en la página de desarrollo de aplicaciones y software a medida.

Servicios y palabras clave En Q2BSTUDIO cubrimos inteligencia artificial, ciberseguridad, servicios cloud aws y azure, servicios inteligencia de negocio, ia para empresas, agentes IA y power bi. Nuestras capacidades abarcan desde consultoría en ciberseguridad y pentesting hasta implementaciones en la nube y proyectos de business intelligence con Power BI. Para soluciones de inteligencia artificial puedes explorar nuestros servicios de inteligencia artificial para empresas.

Por qué elegirnos Trabajamos con metodologías ágiles para entregar software robusto y escalable. Integramos seguridad desde el diseño para proteger datos críticos, diseñamos arquitecturas en servicios cloud aws y azure y creamos dashboards y pipelines de datos para servicios inteligencia de negocio. Nuestra experiencia en agentes IA y automatización permite optimizar procesos y mejorar la toma de decisiones con datos y modelos a medida.

Contacto y próximo paso Si tu objetivo es implementar una solución a medida que combine software, inteligencia artificial y seguridad, Q2BSTUDIO puede acompañarte desde el diseño hasta la operación. Contacta con nuestro equipo para evaluar tu caso y diseñar una ruta técnica y de negocio ajustada a tus necesidades.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat